You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Keydown event emits twice for printable char with one physical keypress #20726
while on chromium / ff emits single keydown event:
Behavior is related to #20630, currently each physical keypress creates two WindowEvent::KeyEvent for printable key, one without actual char and one subsequent with actual char. (window::handle_received_character).
This makes fixes around some keyboard event makes quite complex including previous PR #20327. (or #20630) - for example it is not easily create keypress event against U+000D for enter instead of \r which appends actual carriage return char in input field, etcs.
Peeking logics roughly, looks like it may possible
simply forward row winit kbdEvent without creating subsequent event for keychar
docuement owns the responsibility to map keycode to actual keychar, manage keypress event after emitting single keydown event
But can't say for sure around historical decisions for current codebases. I'm interested to try some changes if this is sound / feasible considerations.
It would help to have a "Glutin Key To Servo Key" module as described in #20331 - at least to isolate the translation mechanism and properly define what we want in Servo.
Interesting. I'll followup how does #20331 proceeds and trying to figure out what's needed more. What I thought in here was slightly opposite, let document owns responsibility to create domkey from raw keyboardinput event, but that was speculative guess without any actual experiment.
I'm bit unsure handling IME would resolve this issue (at least on win32, based on rough experiences) but still having proper IME support definitely related with these kind issues in any way. I realized it may need upstream winit side support, trying to make upstream changes first.
Activity
kwonoj commentedon May 2, 2018
Related upstream issue: rust-windowing/winit#34
paulrouget commentedon May 3, 2018
It would help to have a "Glutin Key To Servo Key" module as described in #20331 - at least to isolate the translation mechanism and properly define what we want in Servo.
kwonoj commentedon May 3, 2018
Interesting. I'll followup how does #20331 proceeds and trying to figure out what's needed more. What I thought in here was slightly opposite, let document owns responsibility to create domkey from raw keyboardinput event, but that was speculative guess without any actual experiment.
paulrouget commentedon May 3, 2018
And like I said in #20727, having proper IME support would help solve these kind of issues.
kwonoj commentedon May 8, 2018
I'm bit unsure handling IME would resolve this issue (at least on win32, based on rough experiences) but still having proper IME support definitely related with these kind issues in any way. I realized it may need upstream winit side support, trying to make upstream changes first.
atouchet commentedon Apr 18, 2020
I tried retesting this with https://w3c.github.io/uievents/tools/key-event-viewer.html and now only get one keydown event.
Is this fixed now?
jdm commentedon Apr 20, 2020
Looks like it!