summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPing Cheng <pinglinux@gmail.com>2013-03-07 14:11:30 -0800
committerJason Gerecke <killertofu@gmail.com>2013-03-11 11:24:56 -0700
commit7a1aadb24b6573809d7324f2549bed749ad1a7f2 (patch)
tree867f4803a2afa37ed3119f1ce9b7bb808c925d71
parentc3b4e869924291ee1ec72a2f02fc1986873efe92 (diff)
downloadxf86-input-wacom-7a1aadb24b6573809d7324f2549bed749ad1a7f2.tar.gz
Resume button events for pucks
wcmBTNChannel was statically assigned to PAD_CHANNEL by commit 1f9bf45b, which excluded button events for CURSOR tools. This patch allows usbParseBTNEvent to process button events for both CURSOR and PAD tools. wcmBTNChannel is removed from wcmUSBData since we do not need it anymore. Signed-off-by: Ping Cheng <pingc@wacom.com> Reviewed-by: Jason Gerecke <killertofu@gmail.com>
-rw-r--r--src/wcmUSB.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index 980dac3..db7c045 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -32,7 +32,6 @@
typedef struct {
int wcmLastToolSerial;
- int wcmBTNChannel;
int wcmDeviceType;
Bool wcmPenTouch;
Bool wcmUseMT;
@@ -460,8 +459,6 @@ static void usbWcmInitPadState(InputInfoPtr pInfo)
ds->device_type = PAD_ID;
ds->device_id = PAD_DEVICE_ID;
ds->serial_num = channel;
-
- private->wcmBTNChannel = channel;
}
int usbWcmGetRanges(InputInfoPtr pInfo)
@@ -1651,8 +1648,12 @@ static void usbDispatchEvents(InputInfoPtr pInfo)
}
else if (event->type == EV_KEY)
{
+ /* Button events can be from puck or expresskeys */
+ int btn_channel = (ds->device_type == CURSOR_ID) ?
+ channel : PAD_CHANNEL;
+
usbParseKeyEvent(common, event, channel);
- usbParseBTNEvent(common, event, private->wcmBTNChannel);
+ usbParseBTNEvent(common, event, btn_channel);
}
} /* next event */