The HP TC1100 has three buttons on the side of the display that are triggered
with the stylus. This patch adds support for these buttons, with the buttons
available under the following xsetwacom button IDs:
ID 13 = Rotate
ID 14 = Writing tool
ID 15 = On-screen keyboard

Signed-off-by: Erich E. Hoover <[email protected]>
---
 src/wcmISDV4.c |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/src/wcmISDV4.c b/src/wcmISDV4.c
index 82c709d..436e973 100644
--- a/src/wcmISDV4.c
+++ b/src/wcmISDV4.c
@@ -634,6 +634,37 @@ static int isdv4Parse(InputInfoPtr pInfo, const
unsigned char* data, int len)
                }
        }

+       /* handle TC1100 stylus buttons */
+       if ((data[0] == 0xC1) && ((data[1] & 0xF0) == 0))
+       {
+               int oldTPCButton = common->wcmTPCButton;
+               int button = (int) data[1];
+
+               DBG(2, common, "Tablet Button 0x%x\n", data[1]);
+
+               common->wcmTPCButton = 0;
+
+               /* do not reset relative values here */
+               ds = &common->wcmChannel[0].work;
+
+               /* first send the tablet button press event */
+               ds->proximity = 1;
+               ds->buttons = button << (WCM_MAX_MOUSE_BUTTONS - 4);
+               ds->pressure = common->wcmMaxZ;
+               ds->device_id = STYLUS_DEVICE_ID;
+               ds->device_type = STYLUS_ID;
+               wcmEvent(common, channel, ds);
+               
+               /* then immediately after send the release event */
+               ds->buttons = 0;
+               ds->pressure = 0;
+               ds->proximity = 0;
+               wcmEvent(common, channel, ds);
+
+               common->wcmTPCButton = oldTPCButton;
+               return common->wcmPktLength;
+       }
+
        /* Coordinate data bit check */
        if (data[0] & CONTROL_BIT) /* control data */
                return common->wcmPktLength;
-- 
1.7.1

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to