Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

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.

share|improve this question

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.

share|improve this answer
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! – Anonymous Aug 21 '09 at 3:53
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:…, and how to enable a script to run with root permissions (not required if it runs as part of the boot-up sequence):… – nagul Aug 21 '09 at 6:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.