Jump to content


Photo

HowTo: mapping extra mouse buttons (Linux)


  • Please log in to reply
No replies to this topic

#1 Sneaker

Sneaker

    Member

  • Member
  • PipPip
  • 15 posts

Posted 06 September 2018 - 06:12 PM

TL;DR use evrouter

 

I recently decided to try to get some of the extra buttons on my mouse to do various darkmod actions in linux (Fedora 28).  Darkmod does not notice them when you try to make a shortcut within the game.

 

I initially tried xbindkeys and xautomation (xte).  This worked in the terminal but not in fullscreen (presumadly, xbindkeys needs a window focus), so I tried evrouter which does work.

 

1. add your userid to the "input" group to read the appropriate event device files in /dev/input/by-id/*

# gpasswd -a userid input

 

In my case I needed these two device files to notice all buttons:

/dev/input/by-id/usb-Logitech_G300s_Optical_Gaming_Mouse-event-mouse
/dev/input/by-id/usb-Logitech_G300s_Optical_Gaming_Mouse-if01-event-kbd

 

2. use evrouter to show you the button press/event it sees when you press your mouse button:

$ evrouter --dump /dev/input/by-id/*

 

there will be a line that says "fill this in".  place this line in ~/.evrouterrc and replace the "fill this in" with the appropriate key syntax... I have "g" mapped to zoom scope so that is "XKey/g".

 

e.g.

"Logitech G300s Optical Gaming Mouse" "/dev/input/by-id/usb-Logitech_G300s_Optical_Gaming_Mouse-event-mouse" none key/275 "XKey/g"

 

add any other buttons/events as wanted to .evrouterrc

 

3. run evrouter on the appropriate dev files.

 

e.g.

$ evrouter /dev/input/by-id/usb-Logitech_G300s_Optical_Gaming_Mouse-event-mouse /dev/input/by-id/usb-Logitech_G300s_Optical_Gaming_Mouse-if01-event-kbd

 

4. play darkmod with extra button support

 

5. profit


Edited by Sneaker, 06 September 2018 - 06:15 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users