Jump to content
The Dark Mod Forums
Sign in to follow this  
Sneaker

HowTo: mapping extra mouse buttons (Linux)

Recommended Posts

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...