19

I know I can use xinput to remap mouse buttons on only one mouse but leave others unchanged. This is very useful. In my case, I use it to connect two mice to my desktop, one right-handed and the other left-handed.

Can something like this also be done when there's more than one keyboard connected? Can I remap keys to other keys on one keyboard, and leave others unchanged?

In my specific case my mouse appears to be registered as an additional keyboard and its 6th and 7th button are translated to pageup and pagedown, I would like to bind them to copy/paste instead - but I don't want to affect the regular pageup and pagedown keys on my standard keyboard.

Here's how the output of xinput looks - the keyboard in question is with id 10:

$ xinput
⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ SteelSeries Diablo III Gaming Mouse       id=9    [slave  pointer  (2)]
⎜   ↳ SteelSeries Diablo III Gaming Mouse       id=11   [slave  pointer  (2)]
⎜   ↳ Logitech USB Optical Mouse                id=12   [slave  pointer  (2)]
⎣ Virtual core keyboard                     id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Power Button                              id=7    [slave  keyboard (3)]
    ↳ Creative Technology Ltd SB Tactic3D Rage USB  id=8    [slave  keyboard (3)]
    ↳ SteelSeries Diablo III Gaming Mouse       id=10   [slave  keyboard (3)]
    ↳ Logitech USB Keyboard                     id=13   [slave  keyboard (3)]
    ↳ Logitech USB Keyboard                     id=14   [slave  keyboard (3)]
    ↳ HP WMI hotkeys                            id=15   [slave  keyboard (3)]
Jon S.
  • 90
Oak
  • 291

2 Answers2

1

Your question is more about remapping mouse buttons than keyboard buttons, right ? I think ImWheel can remap several devices. I use it and have a writeup here: http://www.gdargaud.net/Hack/LinuxMouse.html

dargaud
  • 1,028
0

This can't be done with xinput/xf86-input-evdev, you would have to do it directly in evdev, check out evtest package.