0

I am trying to remap my caps lock key to a new key combination like ctrl+b for using tmux. I spent hours googling but all explanations are just cryptic or only cover remapping a key to only a single other key and not a key combination like ctrl+b.

I found this other post here but once again the author asks how to remap to a key combination but only gets told how to remap to a single key. I am getting really desperate here.

Could anyone please tell me how to solve this? The man pages and all other posts in this forum or anything I found through Google was useless to me. I would be really grateful for your help.

P.S.: Please do NOT post an answer telling me how to only remap a single key!!!

2

1 Answer 1

0

Alright so I finally found a solution. I first disabled the caps lock key in gnome tweaks and then installed AutoKey.

My script for pressing CTRL-y looks like this:

from pynput.keyboard import Key, Controller

keyboard = Controller()

keyboard.press(Key.ctrl_l)
keyboard.press('y')
keyboard.release('y')
keyboard.release(Key.ctrl_l)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .