I would like to map the AltGr key on my keyboard to produce Ctrl+Alt. I am aware of xkb and xmodmap. As far as I could tell, however, using those you can only map from key combinations onto single keys, not the other way round.
Asked
Active
Viewed 3,691 times
1 Answers
1
After trying and failing to get it to work with a combination of xbindkeys and xvkbd/xte (I could never get certain characters {, [, ], }, \, etc. to behave properly, perhaps because I use a Scandinavian keyboard layout), I finally found a simple and practical solution: Autokey. Here are the exact instructions to get it working:
- Install Autokey through Ubuntu Software (I used the GTK-version, not KDE) or by:
sudo apt-get install autokey-gtk. - Configure one script per key, e.g. for
{use this code:keyboard.send_keys("<alt_gr>+7")and set the hotkey to Ctrl+Alt+7 (first set hotkey to 7 then add Ctrl and Alt as modifiers). This at least worked for the most important code-writing keys:{ [ ] } \. - Add autokey to Startup Applications (search for “start” to find it) and then add a program with “autokey” as the command.
This solution will work for anything running in the current X-session (I think) but will not work if you start a new terminal session using Ctrl+Alt+[F2-F6].
Zanna
- 72,312