On Wed, Mar 16, 2011 at 03:56:10PM -0700, Ping Cheng wrote: > Touchscrren is in absolute mode. Send left click down/up when
typo i'm not quite sure how the mode relates to the sending of click down/up events. can you clarify this? > the first finger touches/leaves the tablet. > > Signed-off-by: Ping Cheng <[email protected]> > --- > src/wcmUSB.c | 20 ++++++++++++++------ > 1 files changed, 14 insertions(+), 6 deletions(-) > > diff --git a/src/wcmUSB.c b/src/wcmUSB.c > index 6fe5926..5669e1a 100644 > --- a/src/wcmUSB.c > +++ b/src/wcmUSB.c > @@ -982,9 +982,16 @@ static int usbParseAbsEvent(WacomCommonPtr common, > return change; > } > > +#define MOD_BUTTONS(bit, value) do { \ > + shift = 1<<bit; \ (bit) in parens please. > + ds->buttons = (((value) != 0) ? \ should probably be just (value) ? ... C treats nonzero as true. > + (ds->buttons | (shift)) : (ds->buttons & ~(shift))); \ > + } while (0) mix of tabs/spaces > + > static int usbParseAbsMTEvent(WacomCommonPtr common, struct input_event > *event) > { > int change = 1; > + int shift; if shift is only used within the macro, it should be declared there. I know that the macro was broken to begin with, but seems like a good time to clean it up. Reviewed-by: Peter Hutterer <[email protected]> otherwise (i.e. for the actual change.. Cheers, Peter > wcmUSBData* private = common->private; > WacomDeviceState *ds; > > @@ -1003,6 +1010,13 @@ static int usbParseAbsMTEvent(WacomCommonPtr common, > struct input_event *event) > ds->device_id = TOUCH_DEVICE_ID; > ds->serial_num = private->wcmMTChannel+1; > ds->sample = (int)GetTimeInMillis(); > + > + /* Send left click down/up for touchscreen > + * when the first finger touches/leaves the tablet. > + */ > + if (TabletHasFeature(common, WCM_LCD) && > + !private->wcmMTChannel) > + MOD_BUTTONS(0, event->value != -1); > break; > > case ABS_MT_POSITION_X: > @@ -1042,12 +1056,6 @@ static struct > { PAD_ID, BTN_0 } > }; > > -#define MOD_BUTTONS(bit, value) do { \ > - shift = 1<<bit; \ > - ds->buttons = (((value) != 0) ? \ > - (ds->buttons | (shift)) : (ds->buttons & ~(shift))); \ > - } while (0) > - > static int usbParseKeyEvent(WacomCommonPtr common, > struct input_event *event, WacomDeviceState *ds, > WacomDeviceState *dslast) > -- > 1.7.4 ------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d _______________________________________________ Linuxwacom-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
