pyfisch / keyboard-types

Types to define keyboard related events.
Apache License 2.0
54 stars 9 forks source link

Expose pressed keys without modifiers #1

Closed pyfisch closed 5 years ago

pyfisch commented 7 years ago

To implement: https://w3c.github.io/uievents/#determine-keydown-keyup-keyCode

equalsraf commented 6 years ago

I was wondering about this same issue, the docs for the Key::Char(String) variant say

key string that corresponds to the character typed by the user, taking into account the user’s current locale setting, modifier state, and any system-level keyboard mapping overrides that are in effect.

Shouldn't Key::Char provide the unmodified key? with KeyboardEvent providing a way to get a modified string?

pyfisch commented 6 years ago

This line is copied from the specification. It should be the modified key so applications can use the character information. (Getting unmodified keys is kind of a special case because usually you either want the physical location or the character value and keyboard settings can be all weird so you should not make assumptions about the relation between the two)

pyfisch commented 5 years ago

current implementation is good enough