The i3 FAQ has migrated to All content here is read-only.
Ask Your Question

How can I change the left and right mouse buttons?

asked 2012-12-21 22:04:17 +0000

anonymous user


Recently i've had a problem with my mouse,i really love i3 and maybe i falled in love,for this situation i need to change the right button to the left.Is there anyway to do this.. Is there any idea about how to solve it ?thanks in advance

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2012-12-24 20:29:29 +0000

c1b3rh4ck gravatar image

updated 2012-12-24 20:31:23 +0000

Hi folks Michael's option is good,however it seems difficult to identify your mouse buttons.Here is how i solved with some of help:

Using the xmodmap we can identify the correct buttons. For those with the same question:

"xmodmap - utility for modifying keymaps and pointer button mappings in X",by default the mouse configuration is :

xmodmap -e "pointer = 3 2 1 "

if you want to change or invert left-right mouse buttons you only need to change the pointer position

xmodmap -e "pointer = 1 2 3 " you could add this lines in i3 config,beside you could do a quick script :


current=$(xmodmap -pp | head -5 | tail -1 | awk '{print $2}');

if [ "$current" -eq "1" ]


    xmodmap -e "pointer = 3 2 1";


    xmodmap -e "pointer = 1 2 3";


If you want to identify your mouse buttons copy this in a terminal:

xev | grep button

Best Regards.

edit flag offensive delete link more

answered 2012-12-21 22:10:47 +0000

Michael gravatar image

This page explains how to remap mouse buttons in X11:

This is not i3-specific.

edit flag offensive delete link more


Hi that's an interesting and quick option ,however it seems is a little bit complicated identify your mouse buttons.

c1b3rh4ck gravatar imagec1b3rh4ck ( 2012-12-24 20:10:40 +0000 )edit

Question Tools


Asked: 2012-12-21 22:04:17 +0000

Seen: 1,116 times

Last updated: Dec 24 '12