Saturday, January 9, 2010

Application-Specific Wacom Buttons

EDIT: Updated!
EDIT(Jan 14): Updated again.  It seems that in the previous version, the app would stop working after the computer was put to sleep.  Hopefully this update fixes that problem (I haven't tested it but the changes won't stop the rest from working).
How many people have been plagued by the scrolling problem present in Firefox 3.5+ when using the panning feature of Wacom tablets?  I know I have been but now there's a partial solution: a little app I developed called AppSpecificWacom.

This app allows you to set what buttons on the pen do what for a specific application.  I wrote this because support for this doesn't exist for the Graphire tablets and I required app-specific settings.

Currently, it's limited to the first pen device (no mouse, puck, etc) registered in the first detected tablet.  For me, that's the pen. UPDATED: use the transducer and tablet keys to modify which tablet and device to remap.  As a consequence, the list of applications are now in the Applications array.  As another consequence, you must remove your current preference file in your Library/Preferences folder.

Drop this app in your startup apps and edit "/Users//Library/Preferences/com.r0ssar00.AppSpecificWacom.plist" for your application-specific requirements.

In short, to target an application, you may use either the name or bundle identifier of the application.  Example: for Firefox, to target using the name, you would use

<key>name</key>
<string>Firefox</string>


to target using bundle identifier

<key>bundle_id</key>
<string>org.mozilla.firefox</string>


I recommend you target using the bundle identifier.

As for the button remaps, do something similar to

<key>tip</key>
<string>click</string>
<key>barrel</key>
<string>right click</string>


Currently, you may use: tip, barrel, barrel2, eraser
barrel is the button closest to the tip and barrel2 closest to the eraser.

For the remap, you may use: back, forward, click, double click, click lock, right click, middle click, pan, 4th click, 5th click, pressure hold, mode toggle, auto erase, erase, ink toggle, show desktop, show help, pie menu, supa fine

The default mapping for the eraser is auto erase.
The default mapping for the tip is click.

On startup, it stores the current mappings so you won't lose them but if you currently have any of the buttons on the pen mapped to either a run application, keystroke, or the menu, this may be lost(I haven't tested it).  I may fix this in the future but right now, I'm not using it so I'm not writing code to support it.

EDIT: renamed the application!  Make sure to delete any old versions and remove the original startup item before you use the new version.  Also, the old preferences won't be copied over so before you run the new version, rename your preferences file to com.r0ssar00.AppSpecificTablet.plist
Grab the binary here.

EDIT: oops, forgot to mention how I managed to fix the Firefox scrolling issue using this.  I setup barrel2 to middle click in Firefox and then installed the Grab and Drag extension for Firefox.  I then setup Grab and Drag to initiate a drag when the middle mouse button is pressed.  Added bonus: middle-clicking a link will still work :D