1. How do I globally map Caps Lock to AltGr?
I don't need CapsLock and rather would like to have an easy access AltGr Key there
2. I want to map all movement keys to vim
-like positions
- AltGr+F = Backspace
- AltGr+H = LeftArr
- AltGr+J = DownArr
- AltGr+L = RightArr
- AltGr+K = UpArr
- AltGr+U = PgUp
- AltGr+D = PgDown
- AltGr+S = Enter
- AltGr+3 = Pos1
- AltGr+$ = End
- AltGr+X = Del
So I can easily walk through my code without moving the hand away from the 10-Finger-Position (like in vim
editor)
I found this answer: How do I remap the caps lock key to the backspace key?
suggesting using
xmodmap -e "keycode [code] = [new key]"
see: http://wiki.linuxquestions.org/wiki/List_of_Keysyms_Recognised_by_Xmodmap
But I cannot figure out, how to add this to a combination of for example AltGr+J
Another start would be to set the "Alternative Character Key" in unity-control-center
->Keyboard->Shortcuts->Typing as Caps Lock
Update:
I found some solutions (see below) but all of them don't work in all applications, I guess it is a global setting called "XFree 4" that is used by some apps.
1. How do I set the key bindings for XFree 4 also?
2. How do I make the changes upgrade-save?
/usr/share/X11/xkb/rules/{evdev,evdev.lst,evdev.xml}
(Ideally, there should be directories likeevdev.lst.d
, but apparently xkb didn’t think of that.) … Since my solution is not a complete answer, I’ll just add it as comments here, and people can modify their answers to include it. – Sep 27 '22 at 14:08evdev
you add a line likeMyOptions:my_option = MyOptions(my_option)
. Inevdev.lst
, you addMyOptions = My own Options
,MyOptions:my_option My great new option
for (mandatory) descriptions, and inevdev.xml
you add a new<group allowMultipleSelection="true">
that is analogous to the others in the file, but useMyOptions
as group.configItem.name, andMyOptions:my_option
as group.option.configItem.name, with the same descriptions as inevdev.lst
. – Sep 27 '22 at 14:18diff -u
to make a.patch
file out of, respectivelyevdev
,evdev.lst
, andevdev.xml
with and without the added lines (at the end), and then put thepatch
commands into a shell script file, together with aninstall -o root -g root -m 644 MyOptions /usr/share/X11/xkb/symbols/
. Asetxkbmap -option MyOptions:my_option
enables the option from a command line or your shortcut. – Sep 27 '22 at 14:23MyOptions
too. And contain the sectionxkb_symbols "my_option" { … }
with only lines ofkey
and before them, a line ofkey.type[GroupX] = "SOME_GROUP"
inside, that you need to look up from the key type in your original layout. (Because some keys have more shift levels than others. E.g. with my NEO 2.0 layout, I haveGroup1
being"EIGHT_LEVEL_ALPHABETIC_LEVEL_FIVE_LOCK"
.) Nopartial …
line is needed anywhere. – Sep 27 '22 at 14:30MyOptions
andmy_option
are arbitrary names, and you choose your own more descriptive one. :) … They just have to be the same everywhere. – Sep 27 '22 at 14:31MyOptions:my_option = MyOptions(my_option)
must beMyOptions:my_option = +MyOptions(my_option)
. Note the added+
. – Sep 27 '22 at 14:38