Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suppress additional scancodes #22

Open
kolAflash opened this issue Jun 15, 2020 · 1 comment
Open

suppress additional scancodes #22

kolAflash opened this issue Jun 15, 2020 · 1 comment

Comments

@kolAflash
Copy link

Originally posted here: #4 (comment)
 

@pronobis @philipl
This is very much what I need!
So I'd really like to see the changes from @pronobis merged.
#4

I quickly hacked a way to handle N:N mappings:
https://github.com/pronobis/evdevremapkeys

 

Just one thing is left for me:
I need to handle keys which emit a unique scancode, plus additional scancodes which overlap with other keys.

I took some time to extend the changes made by @pronobis to fit my needs.
Feel free to have a look at it and give me feedback:
https://github.com/kolAflash/evdevremapkeys/commits/master
 

Background:

I got some strange keys on my HP EliteBook 735 G6 notebook. They emit multiple keycodes at the same time (less than 10 milliseconds):

LEFTCTRL + LEFTALT + F13
LEFTCTRL + LEFTALT + F14
LEFTCTRL + LEFTMETA + F15
LEFTCTRL + LEFTALT + F16

 

I remapped those keys to HOME, END, PAGEUP and PAGEDOWN.

    (KEY_LEFTALT, KEY_LEFTCTRL, KEY_F13):
      - KEY_HOME
    (KEY_LEFTALT, KEY_LEFTCTRL, KEY_F14):
      - KEY_END
    (KEY_LEFTALT, KEY_LEFTMETA, KEY_F15):
      - KEY_PAGEUP
    (KEY_LEFTALT, KEY_LEFTCTRL, KEY_F16):
      - KEY_PAGEDOWN

This works perfect, except I actually want to press LEFTCTRL + HOME.
Sadly there's seems to be no indicator if the "real" LEFTCTRL has been pressed or not.

 


 

P.S.
Only take the following into account if you want all details.
It's mostly confusing and shouldn't be helpful to consider.

The third keycode is actually an unknown keycode. But I use /etc/udev/hwdb.d/90-custom-keyboard.hwdb to remap it to a known key.

evdev:atkbd:dmi:bvn*:bvr*:bd*:svn*:pn*:pvr*
 KEYBOARD_KEY_64=f13
 KEYBOARD_KEY_65=f16
 KEYBOARD_KEY_66=f15
 KEYBOARD_KEY_6d=f14

Side note: Find some related stuff here.
https://h30434.www3.hp.com/t5/Business-Notebooks/remap-special-keys-with-Linux-presentation-start-call-end/td-p/7610721
https://h30434.www3.hp.com/t5/Business-Notebooks/left-CTRL-key-gets-logically-virtually-stuck-sometimes-Alt/m-p/7639737#M159561

@DanielJoyce
Copy link
Contributor

This is gonna be kinda messy because whenever it sees LEFTCTRL pressed, it will have to delay emitting it until sees if the next code matches, this will delay emitting the LEFTCTRL until it knows known of the others have been pressed. That could be a long time. You'd need to add a timeout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants