diff options
author | Chris Bagwell <chris@cnpbagwell.com> | 2010-12-31 17:18:50 -0600 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-01-10 13:48:52 +1000 |
commit | a1fe875f59e1fba06787d4a7a99130c31261d491 (patch) | |
tree | d8c76426a93eae8dcc9e5888924d81269b72ea06 /src/wcmUSB.c | |
parent | 3d1e060c6f3f92474c19a39b529ac92323df4ac9 (diff) | |
download | xf86-input-wacom-a1fe875f59e1fba06787d4a7a99130c31261d491.tar.gz |
set 1FGT/2FGT based on wcmKeys instead of ID
This allows new tochpad/touchscreens to be supported
without modifications to xf86-input-wacom.
BTN_TOOL_FINGER/DOUBLETAP/TRIPLETAP have incompatible meanings
between generic and protocol 4/5 devices. Add logic to detect
generic devices very early and override default value of
wcmProtocolLevel to help out wcmKeys parsing.
Newer touchscreens will work in relative mode because currently only
tablet_id informs this. Generic protocols may eventually have
something in kernel that can be queried for touchscreen vs.
touchpad.
Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
Reviewed-by: Ping Cheng <pinglinux@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/wcmUSB.c')
-rw-r--r-- | src/wcmUSB.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/wcmUSB.c b/src/wcmUSB.c index c25e67c..765b41e 100644 --- a/src/wcmUSB.c +++ b/src/wcmUSB.c @@ -1364,6 +1364,7 @@ static int usbProbeKeys(InputInfoPtr pInfo) struct input_id wacom_id; WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; WacomCommonPtr common = priv->common; + unsigned long abs[NBITS(ABS_MAX)] = {0}; if (ioctl(pInfo->fd, EVIOCGBIT(EV_KEY, (sizeof(unsigned long) * NBITS(KEY_MAX))), common->wcmKeys) < 0) @@ -1380,6 +1381,20 @@ static int usbProbeKeys(InputInfoPtr pInfo) return 0; } + if (ioctl(pInfo->fd, EVIOCGBIT(EV_ABS, sizeof(abs)), abs) < 0) + { + xf86Msg(X_ERROR, "%s: usbProbeKeys unable to ioctl " + "abs bits.\n", pInfo->name); + return 0; + } + + /* The wcmKeys stored above have different meaning for generic + * protocol. Detect that and change default protocol 4 to + * generic. + */ + if (!ISBITSET(abs, ABS_MISC)) + common->wcmProtocolLevel = WCM_PROTOCOL_GENERIC; + return wacom_id.product; } |