2

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
  • 1,075
  • 4
  • 22
  • 33

2 Answers2

3

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
  • 17,461
1

type $ xev | sed -ne '/^KeyPress/,/^$/p' and catch the unicode for your keyboard keypress; for example, letter a unicode is 0x61.

Then, edit ~/.xbindkeysrc and add your own shortcut at the end of the file as following:

#Comment of what the binding (is doing)/(is for)
"xdotool key <target key>"
       <source key>

E.g.,:

#Switch Workspaces
"xdotool key 'super+0xff09'"
        b:2

Finally, don't forget to make $xbindkeys -p to update the conf used.