Skip to content

Instantly share code, notes, and snippets.

@heftig
Created July 19, 2010 04:22
Show Gist options
  • Save heftig/481008 to your computer and use it in GitHub Desktop.
Save heftig/481008 to your computer and use it in GitHub Desktop.
commit a11fa01c78990aa56cc81e54ff72e7d282a7a24b
Author: Jan Steffens <jan.steffens@gmail.com>
Date: Mon Jul 19 06:07:49 2010
Swap stylus buttons 2 and 3 for Tablet PCs
There are only a few TPC pens with 2 buttons, and arguably right-click
is more useful than middle-click.
diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c
index 19b9a03..5650afc 100644
--- a/src/wcmValidateDevice.c
+++ b/src/wcmValidateDevice.c
@@ -678,6 +678,15 @@ int wcmParseOptions(LocalDevicePtr local, int hotplugged)
if ( !priv->wcmMMonitor )
priv->wcmMMonitor = xf86SetBoolOption(local->options, "MMonitor", 1);
+ /* Swap stylus buttons 2 and 3 for Tablet PCs */
+ if (TabletHasFeature(common, WCM_TPC) && IsStylus(priv))
+ {
+ if (priv->button[1] == 2)
+ priv->button[1] = 3;
+ if (priv->button[2] == 3)
+ priv->button[2] = 2;
+ }
+
for (i=0; i<WCM_MAX_BUTTONS; i++)
{
sprintf(b, "Button%d", i+1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment