xbindkeys to remap extra mouse buttons

1

I'm following this tutorial but cant seem to get this working

I used xev and confirmed the two mouse buttons I want to map are button 8 and button 9

I want to map them to the "a" and "s" keys on the keyboard.

I tried the following variations in my .xbindkeysrc but it doesn't do anything when I click my mouse buttons (I confirmed that remapping keyboard keys to commands like "xterm" does work).

"a"
  b:8

m:0x0 + c:38
  b:8

xte 'key a'
  b:8


xte 'key 0x61'
  b:8

Also tried these variations with "b:8 + release"

Nothing is working not sure why

user1028270

Posted 2017-02-11T20:58:11.183

Reputation: 763

[Solved] by mapping mouse buttons to keyboard keys via xkbset: see Use keys for mouse buttons on linux. Alternative to AHK? https://superuser.com/questions/313926/use-keys-for-mouse-buttons-on-linux-alternative-to-ahk

– Russo – 2018-06-07T08:48:44.103

Answers

2

The format for ~/.xbindkeysrc is:

"command to execute"
  keys

You want to execute the command xte 'key 0x61', because this command simulates a press of the key a, so you need

"xte 'key 0x61'"
  b:2   

(That's probably the only variation you didn't try...). Putting anything execept a shell command between the double quotes, like a or m:0x0 + c:38, make no sense: xbindkeys would try to execute that just if you typed it in a shell, and of course that's not a sensible Linux command like xte. Likewise, using commands without double quotes won't work.

dirkt

Posted 2017-02-11T20:58:11.183

Reputation: 11 627