Re: [PATCH 2/2] Use TIPSWITCH for TOUCH

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 9 Apr 2010, Rafi Rubin wrote:

> TipSwitch is a better match for touch.  Confidence and InRange work
> for more current firmwares, but with some older versions only
> TipSwitch is appropriate.

Thanks.

> @@ -171,10 +174,15 @@ static int ntrig_event (struct hid_device *hid, struct hid_field *field,
>  			 * to emit a normal (X, Y) position
>  			 */
>  			if (!nd->reading_mt) {
> -				input_report_key(input, BTN_TOOL_DOUBLETAP,
> -						 (nd->confidence != 0));
> +				/*
> +				 * TIPSWITCH indicates the presence of a
> +				 * finger.  DOUBLETAP is emitted are both
> +				 * emitted to support legacy drivers.
> +				 */

This comment has some slightly strange wording.

>  				input_report_key(input, BTN_TOUCH,
> -						 (nd->confidence != 0));
> +						 nd->tipswitch);
> +				input_report_key(input, BTN_TOOL_DOUBLETAP,
> +						 nd->tipswitch);
>  				input_event(input, EV_ABS, ABS_X, nd->x);
>  				input_event(input, EV_ABS, ABS_Y, nd->y);
>  			}
> @@ -213,7 +221,8 @@ static int ntrig_event (struct hid_device *hid, struct hid_field *field,
>  
>  			/* emit a normal (X, Y) for the first point only */
>  			if (nd->id == 0) {
> -				nd->first_contact_confidence = nd->confidence;
> +				nd->first_contact_touch = nd->confidence &&
> +					nd->tipswitch;
>  				input_event(input, EV_ABS, ABS_X, nd->x);
>  				input_event(input, EV_ABS, ABS_Y, nd->y);
>  			}
> @@ -243,7 +252,7 @@ static int ntrig_event (struct hid_device *hid, struct hid_field *field,
>  
>  			nd->reading_mt = 0;
>  
> -			if (nd->first_contact_confidence) {
> +			if (nd->first_contact_touch) {
>  				switch (value) {
>  				case 0:	/* for single touch devices */
>  				case 1:

Thanks,

-- 
Jiri Kosina
SUSE Labs, Novell Inc.
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux