6

I'm using debian linux with X11 and dwm as a window manager. I have an application that make me press the same key three times in a row, I want to automate this, so instead of pressing three times I would only have to press F1 (or any other key) once.

How do I do this?

4

I would like to suggest autokey or xbindkeys.

The autokey has GTK and QT GUIs, it supports python scripts and text pasting.

The xbindkeys is a more low-level thing, but you may prefer it since you decided to use dwm. I can't find a good how-to for Debian, so here is an article on Arch Wiki, it should give an idea of how to use it.

Both tools allow to execute some commands or scripts, but actually they can't repeat keystrokes out of the box. If you need to send some keyboard events to the X server (which is different from pasting some text), then you can use xdotool in combination with autokey or xbindkeys.

All these tools are available in the official Debian repositories, so it is easy to install them with apt-get.

| improve this answer | |
  • 1
    Thanks, xdotool seems to do the job, xbindkeys can be replaced by dwm – iveqy Jul 24 '14 at 22:37
  • 1
    autokey on its own worked well for me for sending key-presses. In scripts, keyboard.send_key("<down>") can be used to send the down arrow key, for example. See the included example scripts. – Frepa May 6 '15 at 9:36

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.