Archive for the dontask Category

anarkey2.png Gustavo Boiko gave it a name so I threw in a couple of additional code lines to justify the name change. Unlike your previously unnamed hack, which generated only simultaneous key combinations, Anarkey handles sequential keystrokes as well. The configuration file format handles key “chords” like lilypond, so with Anarkey you can use

abc <64 102> 38 56 54

in the configuration file to generate a sequence of fake keystrokes ALT+Right, A, B and C when you run ./ak abc. Build with gcc -o ak ak.c -lXtst, ak.c is listed below. The code is released to the public domain, please refer to the original hack for additional details.

(more…)

Suppose that, for some reason, you’d like to have a program that sends a key combination such as <Control+Left Arrow> to your X server. You can do that trivially using the X Test extension and XTestFakeKeyEvent, but if you want something a bit more flexible you can add a configuration file like

fwd     64 102
back    64 100

where the command back would simulate simultaneous keypresses of ALT (keycode 64) and Left Arrow (keycode 100). Don’t ask why would someone want to do something like this — the only thing I can assure you is that we had a good reason. If that’s your case, the following C program is what you need. Released to the public domain, compile and link against libXtst.

Update: a better version is available.

(more…)