Ping, was this a comment about the patch or a general statement? The patch limits special logic to Bamboo Touch series when invoked with pad type.
But in general, we need to support calling GetRanges() with pads for cases when user defines devices in xorg.conf. Most devices with pad support also share same /dev/input/event? with stylus/eraser. Depending on order specified in xorg.conf, it can be the init of pad that will get the MaxX/MaxY values for other types and store in common struct for them to reference later. And the patch still allows for that. Chris On Sat, Feb 27, 2010 at 7:24 PM, Ping Cheng <pingli...@gmail.com> wrote: > Pad doesn't need MaxX/Y and ResX/Y since it doesn't send motion > events. So, there is no need to get range for pad, except for > Intuos3/4 and Cintiq's, which is for the menu strips. > > Ping > > On Tue, Feb 23, 2010 at 6:55 PM, <ch...@cnpbagwell.com> wrote: >> From: Chris Bagwell <ch...@cnpbagwell.com> >> >> For Bamboo P&T devices, both a touch and pad type are >> shared for single input device and can be called in any >> order based on xorg.conf. And normal HAL order is to >> invoke usbGetRanges() from pad first. >> >> This meant all logic related to IsTouch() was not >> correctly running. Updated to treat pad type as >> touch in special case of Bamboo P&T. >> >> This is applies to devices that have both BTN_TOOL_FINGER >> and BTN_TOOL_DOUBLETAP which currently is limitted to >> Bamboo touch devices. >> >> Signed-off-by: Chris Bagwell <ch...@cnpbagwell> >> --- >> src/wcmUSB.c | 21 ++++++++++++++++----- >> 1 files changed, 16 insertions(+), 5 deletions(-) >> >> diff --git a/src/wcmUSB.c b/src/wcmUSB.c >> index ed53897..466ffae 100644 >> --- a/src/wcmUSB.c >> +++ b/src/wcmUSB.c >> @@ -613,6 +613,17 @@ int usbWcmGetRanges(LocalDevicePtr local) >> unsigned long abs[NBITS(ABS_MAX)] = {0}; >> WacomDevicePtr priv = (WacomDevicePtr)local->private; >> WacomCommonPtr common = priv->common; >> + int is_touch; >> + >> + is_touch = IsTouch(priv); >> + /* Bamboo P&T have both Touch and Pad types on same >> + * device. Its normal for this to be called for pad >> + * case and logic requires it to act same as Touch >> + * case. >> + */ >> + if (IsPad(priv) && >> + common->tablet_id >= 0xd0 && common->tablet_id <= 0xd3) >> + is_touch = 1; >> >> if (ioctl(local->fd, EVIOCGBIT(0 /*EV*/, sizeof(ev)), ev) < 0) >> { >> @@ -647,7 +658,7 @@ int usbWcmGetRanges(LocalDevicePtr local) >> xf86Msg(X_ERROR, "%s: xmax value is wrong.\n", local->name); >> return !Success; >> } >> - if (!IsTouch(priv)) >> + if (!is_touch) >> common->wcmMaxX = absinfo.maximum; >> else >> common->wcmMaxTouchX = absinfo.maximum; >> @@ -664,7 +675,7 @@ int usbWcmGetRanges(LocalDevicePtr local) >> xf86Msg(X_ERROR, "%s: ymax value is wrong.\n", local->name); >> return !Success; >> } >> - if (!IsTouch(priv)) >> + if (!is_touch) >> common->wcmMaxY = absinfo.maximum; >> else >> common->wcmMaxTouchY = absinfo.maximum; >> @@ -673,7 +684,7 @@ int usbWcmGetRanges(LocalDevicePtr local) >> * or touch physical X for TabletPCs with touch */ >> if (ioctl(local->fd, EVIOCGABS(ABS_RX), &absinfo) == 0) >> { >> - if (IsTouch(priv)) >> + if (is_touch) >> common->wcmTouchResolX = absinfo.maximum; >> else >> common->wcmMaxStripX = absinfo.maximum; >> @@ -683,13 +694,13 @@ int usbWcmGetRanges(LocalDevicePtr local) >> * or touch physical Y for TabletPCs with touch */ >> if (ioctl(local->fd, EVIOCGABS(ABS_RY), &absinfo) == 0) >> { >> - if (IsTouch(priv)) >> + if (is_touch) >> common->wcmTouchResolY = absinfo.maximum; >> else >> common->wcmMaxStripY = absinfo.maximum; >> } >> >> - if (IsTouch(priv) && common->wcmTouchResolX && common->wcmMaxTouchX) >> + if (is_touch && common->wcmTouchResolX && common->wcmMaxTouchX) >> { >> common->wcmTouchResolX = >> (int)(((double)common->wcmTouchResolX) >> / ((double)common->wcmMaxTouchX) + 0.5); >> -- >> 1.6.6 >> >> >> ------------------------------------------------------------------------------ >> Download Intel® Parallel Studio Eval >> Try the new software tools for yourself. Speed compiling, find bugs >> proactively, and fine-tune applications for parallel performance. >> See why Intel Parallel Studio got high marks during beta. >> http://p.sf.net/sfu/intel-sw-dev >> _______________________________________________ >> Linuxwacom-devel mailing list >> Linuxwacom-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel >> > ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel