The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
0

How can I change the left and right mouse buttons?

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

anonymous user

Anonymous

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
0

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 :

!/bin/bash

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

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

then

    xmodmap -e "pointer = 3 2 1";

else

    xmodmap -e "pointer = 1 2 3";

fi

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

xev | grep button

Best Regards.

edit flag offensive delete link more
0

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

Michael gravatar image

This page explains how to remap mouse buttons in X11: http://wiki.birth-online.de/know-how/...

This is not i3-specific.

edit flag offensive delete link more

Comments

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

Stats

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

Seen: 1,116 times

Last updated: Dec 24 '12