Devices like early Bamboos and the Graphire4 have "mouse" buttons
(e.g. BTN_FORWARD) instead of the usual buttons found on Intuos
and Cintiq tablets (e.g. BTN_0). Mouse buttons are currently
ignored when counting the number of pad keys present (unless there
is no puck for them to be assigned to), which causes 'nbuttons'
to be wrong on these two devices. This results in the forward and
back buttons being un-remappable, being outside the number of
actions allocated.

This patch has the driver check for mouse buttons on pad devices
if no usual buttons were found. I'm not aware of any tablets with
both "mouse" and "usual" buttons on the pad device, so this should
be sufficient to fix the problem.

Signed-off-by: Jason Gerecke <killert...@gmail.com>
---
 src/wcmUSB.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index 4ec91b7..643c8f2 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -375,7 +375,8 @@ static Bool usbWcmInit(InputInfoPtr pInfo, char* id, float 
*version)
                if (ISBITSET (common->wcmKeys, padkey_codes [i]))
                        usbdata->padkey_code [usbdata->npadkeys++] = 
padkey_codes [i];
 
-       if (!(ISBITSET (common->wcmKeys, BTN_TOOL_MOUSE)))
+       if (!(ISBITSET (common->wcmKeys, BTN_TOOL_MOUSE)) ||
+               (usbdata->npadkeys == 0 && IsPad(priv)))
        {
                /* If mouse buttons detected but no mouse tool
                 * then they must be associated with pad buttons.
-- 
1.7.10.4


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to