evremap icon indicating copy to clipboard operation
evremap copied to clipboard

[question] how to properly re-map `fn+rightctrl` to `context_menu`?

Open yozachar opened this issue 1 year ago • 3 comments

Thank you for this tool!

Lenovo removed the context menu key :cry:. See: https://askubuntu.com/questions/234416/how-to-remap-the-context-menu-to-another-key-in-linux.

I'm trying to remap function + right control, key combination, to open right click context menu. But it does not seem to work. Here's my setup:

$ which evremap
/usr/bin/evremap

$ evremap --version          
evremap 0.1.0

$ sudo evremap list-devices | rg 'keyboard'
Name: AT Translated Set 2 keyboard

$ sudo evremap list-keys | rg 'CONTEXT'   
KEY_CONTEXT_MENU

$ sudo evremap list-keys | rg 'MENU'   
KEY_CONTEXT_MENU
KEY_MEDIA_TOP_MENU
KEY_MENU
KEY_ROOT_MENU

$ sudo evremap list-keys | rg 'FN$' 
KEY_FN

$ sudo evremap list-keys | rg 'CTRL'     
KEY_LEFTCTRL
KEY_RIGHTCTRL

and /etc/evremap.toml

device_name = "AT Translated Set 2 keyboard"

[[remap]]
input = ["KEY_FN", "KEY_RIGHTCTRL"]
output = ["KEY_CONTEXT_MENU"]

but when running the tool

$ sudo /usr/bin/evremap remap /etc/evremap.toml
 2023-11-01T22:31:01.958 WARN  evremap > Short delay: release any keys now!
 2023-11-01T22:31:04.409 INFO  evremap::remapper > Going into read loop
^C

All the other keyboard shortcuts (alt+tab, switch windows) glitch and the context menu does not appear on pressing the re-mapped key combination. How do I resolve this?

yozachar avatar Nov 01 '23 17:11 yozachar

I was able to solve this using input-remapper.

Screenshot from 2023-11-03 07-28-23 image

but I'd prefer a neater solution.

yozachar avatar Nov 03 '23 02:11 yozachar

I've faced this same problem, I chose to remap KEY_RIGHTCTRL to BTN_RIGHT like @yozachar but using evremap.

Not the cleanest solution since it requires the cursor to be over the desired window though.

luluco250 avatar Nov 09 '23 19:11 luluco250

I guess function key Fn cannot be remapped. Ref: https://superuser.com/questions/65/remap-fn-to-another-key (14 years ago).

But this configuration doesn't seem to work either:

device_name = "AT Translated Set 2 keyboard"
phys = "isa123/serio1/input0"

[[remap]]
input = ["KEY_RIGHTCTRL"]
output = ["BTN_RIGHT"]

What am I doing wrong?

yozachar avatar Nov 10 '23 01:11 yozachar