2

I created a .Xmodmap file to remap my Caps_Lock to Mode_switch. This allows me to reassign my Arrow/Navigation Block of the keyboard to the home row.
Everything worked fine, until I realized, that programs written on the java platform and use Swing (like Jetbrains' editors) don't recognize these remaps.

Now I want to port these settings to xkb, as it is deprecated to use xmodmap.
(I think this could be the solution for this problem, but I really don't know how to make the same with xkb.) The xkb configuration is confusing to me, and seems like a really complicated approach for just this few remaps.

So, how can I do this?

I would really, prefer another approach/workaround for the java problem, so I could keep my xmodmap configuration.

Here is my .Xmodmap file:

! Disable Caps Lock and use it as mode switch
keycode 66 = Mode_switch Mode_switch

! Toggle Caps Lock with <Mode_switch> + <Control_R>
keysym Control_R = Control_R Control_R Caps_Lock

! Remap navigation block to ijkl...
keysym j = j J Left Left
keysym l = l L Right Right
keysym i = i I Up Up
keysym k = k K Down Down
keysym u = u U Home Home
keysym o = o O End End

! ö Ö
keycode 47 = odiaeresis Odiaeresis BackSpace BackSpace

keysym h = h H Delete Delete 
keysym n = n N Prior Prior

! enable mu for use with Iso_Level_3 (the right alt key on german keyboards)
keysym m = m M Next Next mu mu

! Space to Escape
keysym space = space space Escape


And here is my xmodmap output:

xmodmap:  up to 4 keys per modifier, (keycodes in parentheses):

shift       Shift_L (0x32),  Shift_R (0x3e)
lock        Mode_switch (0x42)
control     Control_L (0x25),  Control_R (0x69)
mod1        Alt_L (0x40),  Meta_L (0xcd)
mod2        Num_Lock (0x4d)
mod3      
mod4        Super_L (0x85),  Super_R (0x86),  Super_L (0xce),  Hyper_L (0xcf)
mod5        ISO_Level3_Shift (0x5c),  Mode_switch (0xcb)
uloco
  • 956

2 Answers2

2

I found the solution to allow remapped keys using xmodmap such as your arrows in pycharm:

Use national layouts for shortcuts in Settings > Keymap

See this link: https://youtrack.jetbrains.com/issue/IDEA-263057

aless80
  • 121
2

There was no way for me to make this work with xmodmap and fortunately I stumbled upon a guy who already made something similar with xkb. Just follow this link and follow the instructions there to extend your keyboard layout with the "extend" layout, which maps Caps_Lock to ISO_Level_5. http://forum.colemak.com/viewtopic.php?id=1438&p=1

Please read further in the forum to see how I solved a few little problems which bothered me.
If your ttys and capslock is not working properly, look here: http://forum.colemak.com/viewtopic.php?id=1438&p=4.

Thanks to Øystein Bech "DreymaR" Gadmar, for making this possible!

Have fun!

uloco
  • 956