Selective Pointer device remapping in linux

0

I just got an HP 2710p (hp tablet, with digitizer), and I've played around with linux for a while now, and thought I would go ahead and install it. Everything works fine, excepting normal tablet functions, which is to be expected. I'm working on the screen rotation, and there are on-screen keyboards, etc, but I'm having issues with the stylus.
I can tap and left click with the stylus as normal, but the side button (which in windows functions as a right mouse button) appears as a 'button 2' to xev (a middle/scroll wheel button). I can switch 'button 2' and 'button 3' universally using xmodmap, but I'd like to do so exclusively for stylus so I don't screw up regular pointing devices.
Altering xorg.conf (which is surprisingly bare) with the recommended sections (adding sections for each of the stylus buttons) does nothing.
I'm running crunchbang, which is an ubuntu/debian varient with openbox as the windows manager.
Thanks

Also, as a seperate note, does anybody know how to detect when I rotate and/or latch the lid shut? I was thinking maybe I could run a script to switch the buttons when I close it, but I can't find any information.

None

Posted 2009-08-18T19:43:32.287

Reputation:

Answers

2

Since you're already familiar with xmodmap, this shouldn't be too difficult. Have a look at xinput. Unlike xmodmap, this lets you specify a device for which you want the remapping.

  • Run xinput list to get a list of devices
  • Get the name for the sylus
  • Remap the buttons for that device using xinput set-button-map "StylusName" 1 2 3 etc

Check this Ubuntu community document for an example of how it's used to remap mouse buttons.

user4358

Posted 2009-08-18T19:43:32.287

Reputation:

Works great! you just have to remember to sudo xinput set-button-map...
Also, the effects disappear after a reboot, so don't forget to write a quick startup script if you want it in effect all the time.
Thanks!
– None – 2009-08-21T03:53:59.973

Glad it did. The other issues you mention have also been discussed here: How to add a task to an ubuntu system at boot-up: http://superuser.com/questions/21767/setting-a-default-cpu-frequency-in-ubuntu/21782#21782, and how to enable a script to run with root permissions (not required if it runs as part of the boot-up sequence): http://superuser.com/questions/26271/how-can-i-pass-root-password-to-a-script/26280#26280

– None – 2009-08-21T06:46:19.283