Closed benj5378 closed 3 weeks ago
@benj5378 Hello, thank you for creating an issue. A related problem was discussed (not solved yet) here https://github.com/asus-linux-drivers/asus-numberpad-driver/issues/187.
Also, why don't we just sent KEY_SLASH?
Because now is sent currently found associated key(s) to each character. What you mention was implemented previously and is not immune to changes in keymap (custom changes or switching between multiple keyboard character layouts e.g. EN -> FR -> CZ)
Could you please confirm it does not work even immediately when the laptop finishes booting? E.g. login page? Do you use multiple keyboard character layouts that print mentioned characters using and not using a modifier?
@ldrahnik thanks for quick response.
After a lot of debugging, I found something interesting
Doesn't work:
Event: time 1730034126.510311, -------------- SYN_REPORT ------------
Event: time 1730034128.638561, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 1
Event: time 1730034128.638561, -------------- SYN_REPORT ------------
Event: time 1730034128.811548, type 1 (EV_KEY), code 8 (KEY_7), value 1
Event: time 1730034128.811548, -------------- SYN_REPORT ------------
Event: time 1730034128.863731, type 1 (EV_KEY), code 8 (KEY_7), value 0
Event: time 1730034128.863731, -------------- SYN_REPORT ------------
Event: time 1730034128.966722, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 0
Does work
Event: time 1730038557.635306, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 1
Event: time 1730038557.635306, -------------- SYN_REPORT ------------
Event: time 1730038557.635332, type 1 (EV_KEY), code 8 (KEY_7), value 1
Event: time 1730038557.635332, -------------- SYN_REPORT ------------
Event: time 1730038557.635347, type 1 (EV_KEY), code 8 (KEY_7), value 0
Event: time 1730038557.635347, -------------- SYN_REPORT ------------
Event: time 1730038557.635362, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 0
Event: time 1730038557.635362, -------------- SYN_REPORT ------------
Event: time 1730038557.635376, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 1
Event: time 1730038557.635376, -------------- SYN_REPORT ------------
Could you please confirm it does not work even immediately when the laptop finishes booting? E.g. login page?
Might not be relevant due to above founds.
Do you use multiple keyboard character layouts that print mentioned characters using and not using a modifier?
I don't think so? I only have one layout set
I fixed the issue, it's related to timing. I'll submit a PR shortly
@ldrahnik, here is some really interesting, that indicates that in some parts of the OS, the shift key actually detected and considered. Let me show my findings using https://github.com/eyelash/tutorials/blob/master/libinput.c
Using normal keyboard:
Pressing 7
gives the key 7 was pressed
Pressing 7 + Shift
gives the key & was pressed
(the &
is just due to unset layout in code)
Okay, so we know if the shift key is considered, libinput will yield &
.
Now let's try with the numberpad.py driver:
Pressing /
that sends 7 + Shift
gives the key & was pressed
So this means, that the events are sent correctly. And libinput correctly receives 7 + Shift
at once even we no delay. So it's somewhere else in the OS, that the translation doesn't happen without a delay???
Even though it's libinput that forwards keys to Wayland. How is it possible for libinput see the keys as a combination, but when they reach Wayland client, they are not a combination anymore??
@benj5378 Each Wayland client can have different keymap so key may be translated to wrong one. Only this idea I have (was mentioned in related issue too).
so key may be translated to wrong one
@ldrahnik, well, it can't be that it is translated to wrong one - because we know it's translated correctly with delay.
We just know, that it is translated as expected, when reaching libinput. And that once it is forwarded to Wayland Client, it isn't translated at all.
@benj5378 Could you strach here minimal example ( working & not working sending key combination) in python which I could run on wayland as well? Btw what Is your Wayland compositor? What about try another one?
Describe the bug
On my BX425JA using up5401 layout, pressing keys sent by modifiers don't work.
For instance pressing...
/
results in7
*
results in'
=
results in0
This is because
/
is sent as[KEY_LEFTSHIFT:42, KEY_7:8]
which does correspond to/
on my keyboard layout - however, for some reason, the modifier key isn't received. (Also, why don't we just sentKEY_SLASH
?Expected behavior
/
results in/
*
results in*
=
results in=
Relevant log output
Desktop