I'm considering getting a 60% keyboard and want to try out working with that layout before buying the actual keyboard.
I'm trying to map arrow keys to caps lock + ijkl and disable the real arrow keys. I've found out how to remap it, but when I try to disable the real arrow keys, the remapped ones break. Here's a working map:
keycode 66 = Mode_switch
keycode 31 = i I Up
keycode 44 = j J Left
keycode 45 = k K Down
keycode 46 = l L Right
To disable arrow up I add
keycode 111 =
And as soon as I do that, ijkl don't work as characters anymore, but act as arrows even without pressing the modifier(caps lock). How do I disable the arrow keys without breaking my previous mapping?
Best Answer
After reading in and getting some information around. It appears that the issue is that you have to delete the modifiers before actually doing the remapping.
To the answer :
After changing the settings my
xmodmap
looks like:xmodmap: up to 4 keys per modifier, (keycodes in parentheses):
Investigation of
Mode_switch
brings us to the conclusion thatCaps_Lock
has been successfully mapped:Now xmodmap the excerpt from the man pages:
The following configuration works but you have to hold Caps_Lock while using the i,j,k,l (exactly as written in the man pages):
Edit
vim ~/.Xmodmap
:Now to the big question:
How to make the i,j,k,l keys work while Caps_Lock on? You will probably have to make changes to
xkb
, which I have to think over.Edit
Yes, you can. I have figured it out.
Note: this applies to all keyboards, all layouts, thus is good for testing. If you want to do it via
xkb
properly you have to create your own layout and have a group1 and group2 + do the mapping.The bellow is a hack ideal for testing your keyboard(s) (don't forget to backup your
../basic
file!):Warning this applies to all keyboards, all variants.
Edit file: sudo vim /usr/share/X11/xkb/compat/basic
Note: If you have multiple layout it can interfere with those.