5

I made CapsLock the Hyper-key via gnome-tweaks

Sorry, I have only the german screenshot. "Feststelltaste" means "CapsLock"

gnome-tweaks-capslock-de

Now I would like to map

  • Hyper-u to Arrow-Up
  • Hyper-n to Arrow-Down
  • Hyper-i to Page-Up
  • Hyper-m to Page-down
  • Hyper-j to Pos1
  • Hyper-ö to End (on my german layout this character is right to "l")

It would be great if this could be done by doing config in $HOME.

For example via .xmodmaprc

Related question: Make arrow-up/down, Pos1, End, Del ... more easy

Every solution is welcome

I am open for every solution which works. Maybe there is way to solve this via eBPF or an own uinput-device?

Background

I like the then fingers touch typing. I am happy with my QWERTZ layout for a-Z. But these special keys always make me leave the comfortable position with the pointer fingers on "F" and "J".

guettli
  • 1,777

2 Answers2

1

When Caps Lock behavior is set to default, i.e, "Disabled"

Caps Lock behavior set to default

create .xmodmap file with below content,
keycode 66 is the Physical Caps Lock Key on My Keyboard

clear lock
keycode 66 = Mode_switch
add lock = Mode_switch
keycode 30 = u U Up
keycode 57 = n N Down
keycode 31 = i I Prior
keycode 58 = m M Next

Run

xmodmap .xmodmap
PRATAP
  • 22,460
  • I get this error message from xmodmap X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 118 (X_SetModifierMapping) Value in failed request: 0x17 Serial number of failed request: 17 Current serial number in output stream: 17 – guettli Dec 19 '21 at 20:25
  • Ignore it n check the key combination if it's Working or not. I got the error but combination worked. – PRATAP Dec 19 '21 at 20:31
  • It works in gedit. But not in Chromium and not in PyCharm :-( – guettli Dec 19 '21 at 21:08
  • @guetti that worked for me in chromium in my Ubuntu 20.04, I dont know about PyCharm. if you are exclusively looking for PyCharm.. there may be a different way to achieve? – PRATAP Dec 20 '21 at 05:11
  • it's very old, but maybe read this about chromium – Andra Dec 27 '21 at 18:11
  • Today I tried it again, but it does not work in PyCharm and not in vscode. But it works in Chrome and on the terminal. Nevertheless I need a solution which works in PyCharm and vscode. – guettli May 18 '22 at 20:35
1

If you don't mind a GUI application, input-remapper has always worked well for me with various input devices and is also available on APT.

It runs as a daemon in the background and reinjects your inputs using evdev, so there's probably a more elegant solution out there, but could be useful as a last resort or if you want to change input mappings often.

ccbirb
  • 613
  • Thank you very much! input-remapper is great. I have been looking for a tool like this for years. See my article "ten flying fingers": https://github.com/guettli/ten-flying-fingers – guettli May 24 '22 at 07:14