I am trying to setup xbindkeys in Kubuntu, since I got a new mouse with some useless buttons. I was trying to bind the F5 key to the windows-logo button on my mouse, which I identified as c:134.

Unfortunately it does not seem to work. Here is what I do in .xbindkeysrc

"xte 'key F5'"

This does not work. However, if I type into a terminal: sleep 10; xte 'key F5' and switch to another window, after 10 seconds the F5 key is correctly emulated (for example, it will refresh the current browser page).

It is not a problem of the key identification, either. This one will correctly launch Kate.


I really don't get it, why xte won't emulate the key!

Any suggestions?

  • This is a problem with how xbnidkeys works I'm afraid. With the keyboard you can pound the keys really hard and it works, but I've never tried this with mouse buttons. You could try xdotool (very similar to xte) or make a script with your xte commands and call that from xbindkeys. – Seth Jan 31 '14 at 2:57
  • I don't understand why would a keystroke be different from a mouse button press. I can launch Kate using the mouse button, but I cannot send F5 to the currently focused window. Anyway, I tried both xdotool and putting the xte command into a script, but none works. – Palantir Feb 1 '14 at 18:07
"xdotool key --delay 0 --clearmodifiers F5"
    c:134 + Release

Source: http://www.ict.griffith.edu.au/anthony/info/X/event_handling.txt (search for 'Generating X Keyboard Events')

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.