Give a combination of xbindkeys and xvkbd a try. xbindkeys
listens for the keys and sends the translation to xvkbd.
sudo apt-get install xbindkeys xvkbd
xbindkeys --defaults > ~/.xbindkeysrc
Open .xbindkeysrc
in your favourite editor. I commented everything else out, but it's good to refer to if required.
To check it out, I tried mapping Ctrl+; to Ctrl+V
"xvkbd -xsendevent -text "\Cv""
control + semicolon
I expect you're after something like this
"xvkbd -xsendevent -text "\C\S\[Left]""
Super+Control+Shift+J
Save the file, then run xbindkeys
.
In order to reload any configuration changes, I killed the xbindkeys
process then restarted.
xbindkeys syntax
I worked out the key combination by using a GUI for xbindkeys
sudo apt-get install xbindkeys-config
xbindkeys-config
Once you run that, press Get Key for the combination to put into the second line of your .xbindkeysrc
file.
xvkbd syntax
From the manual:
\r - Return
\t - Tab
\b - Backspace
\e - Escape
\d - Delete
\S - Shift (modify the next character; please note that modify with ``\S'' will be ignored in many cases. For example, ``a\Cb\ScD\CE'' will be interpreted as a, Control-b, c, Shift-D, and Control-Shift-E.)
\C - Control (modify the next character)
\A - Alt (modify the next character)
\M - Meta (modify the next character)
\[keysym] - the keysym keysym (e.g., \[Left]), which will be processed in the similar matter with other general characters
\{keysym} - the keysym keysym (e.g., \{Left}), which will be processed in more primitive matter and can also be used for modofier keys such as Control_L, Meta_L, etc.; also, \{+keysym} and \{+keysym} will simulate press and release of the key, respectively [Version 3.3]
\Ddigit - delay digit * 100 ms
\xvalue - move mouse pointer (use "+" or "-" for relative motion)
\yvalue - move mouse pointer (use "+" or "-" for relative motion)
\mdigit - simulate click of the specified mouse button
Love to hear how it works out and if the combination was fit for your purpose. It looks good as a keymapper, but not necessarily a macro runner.
Best Answer
You can use
xbindkeys
to grab the keys andxvkbd
to send keys.Create a file
.xbindkeysrc
in your home directory and paste this text:Then start
xbindkeys
and it should work. Probably you want to map more keys, then after you edited the.xbindkeysrc
you can runpkill -HUP xbindkeys
to send a HUP signal to xbindkeys (or kill xbindkeys and start it again).To see the key names that xbindkeys sees, you can run
xbindkeys -mk
(man xbindkeys
has more info).To see the key names that xvkbd knows, have a look in /usr/include/X11/keysymdef.h (maybe someone else knows a better method?).
xbindkeys only runs until your X session ends, so you probably want to put it in your startup (auto-start) programs.