You are not logged in.
I want to map <Ctrl+hjkl> to behave as arrow keys (just like how I've set it up using the Karabiner software on macOS). At the same time, I don't want to change the combination of ctrl with other keys (for example, <Ctrl+c> should still send a terminate signal to applications). I tried using xmodmap, but I found that I couldn't map <Ctrl+hjkl> to arrow keys without affecting the ctrl combination with other keys. As a compromise, I attempted to map <Caps+hjkl> to arrow keys (since I never use the Caps key), but when I use i3wm to resize windows using the arrow keys, the <Caps+hjkl> mapping doesn't work (while the native arrow keys for resizing work fine). It seems like this compromise approach isn't effective. I just want a simple way to remap my keyboard without having to read lengthy documentation. Is there a better way to achieve this?
follow is some info in ~/.xmodmap and ~/.config/i3/config
keycode 37 = Mode_switch
keycode 43 = h H Left Left
keycode 44 = j J Down Down
keycode 45 = k K Up Up
keycode 46 = l L Right Right
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
many thanks
Last edited by ryukk (2023-08-31 09:31:55)
Offline
ctrl is not one of the iso level shifts, if you want to map eg. ctrl+h to ctrl+leftarrow you'll have to create a global shortcut that invokes eg. xdotool
Depending on your shortcut daemon, it might already be able to simulate key events.
Offline