Skip to main content

SysAdmin Blog

remapping mouse buttons under X11

Alexander Bochmann Wednesday 01 of December, 2010
Ever since I bought an Evoluent VerticalMouse, having the middle mouse button on the scroll wheel felt kind of awkward. Since it already has three buttons on the right hand side, I'm now using the actual middle button, and the one on the bottom as right button. Remapping is done vie a custom script in /etc/X11/Xsession.d (only works if the mouse is connected when X is starting up, but that's good enough for me).

# if a vertical mouse is connected, remap it's keys

xinput list | grep "Kingsis Peripherals  Evoluent VerticalMouse 3" >/dev/null
if [ $? -eq 0 ]; then
        # this probably only works for me :)
        ID=`xinput list | awk '/VerticalMouse/ { print $8 }' | sed 's/id=//'`
        # remap VerticalMouse buttons (middle click away from scroll wheel)
        xinput set-button-map $ID 1 0 2 4 5 6 7 3 9 10 11 12 13
fi


(Under Windows, I'm using X-Mouse button control (cache) for the same task.)