View previous topic :: View next topic |
Author |
Message |
Vilietha n00b

Joined: 16 Apr 2008 Posts: 23
|
Posted: Sat Mar 28, 2015 9:56 am Post subject: Middle mouse button remapping and emulation |
|
|
Hi everyone,
I have a mouse with many buttons. I would like to remap the middle mouse button to another mouse button. Do you know how I can do that?
Also, I tried to emulate my middle mouse button with
Code: |
Section "InputClass"
Identifier "whatever"
MatchIsPointer "on"
Option "Emulate3Buttons" "on"
EndSection |
in ~/.xinitrc, but it doesnt work. Do you know how to get that working too?
I look forward to your answers.
Best wishes,
Vilietha |
|
Back to top |
|
 |
ayvango Tux's lil' helper

Joined: 08 Feb 2012 Posts: 118
|
Posted: Wed Apr 01, 2015 2:29 pm Post subject: |
|
|
You should use xinput set-button-map. For more information see man xinput. imwheel program should also be useful for you. It allows to map some mouse keys to keyboard combinations.
I have logitech mouse with two additional buttons. I'm using xinput and imwheel combo to swap middle button with an additional, because it is easy to press it while using mouse wheel. Other two buttons I've mapped to Shift+Insert and Ctrl+Insert.
.imwheelrc
Code: |
".*"
None, Thumb1, Shift_L|Insert
None, Thumb2, Control_L|Insert
|
runImwheel.sh
Code: |
#/bin/sh
DISTINGUISH="Logitech"
XINPUT="/usr/bin/xinput"
IMWHEEL="/usr/bin/imwheel"
ID=$($XINPUT list | grep $DISTINGUISH | cut -f 2 - | cut -b 4\,5 -)
if [ ! -z $ID ]; then
$XINPUT set-button-map $ID 1 8 3 4 5 6 7 2 9 10 11 12 13 14 15 16
PID=$(pidof $IMWHEEL)
if [ ! -z $PID ]; then
kill $PID
fi
$IMWHEEL
fi
|
|
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|