Available on crate feature
keyboard-types only.Expand description
Conversions from XComponent key events to keyboard_types values,
including US-layout character computation.
OpenHarmony currently has no keyboard-layout API and the assumption seems to be US keyboard layout. Until there is an official OH API for keyboard layout, the best we can do is provide tracking and conversion for US layout here (Note: This will move to an abstraction crate in the future)
Structs§
- KeyEvent
Converter - Stateful translator from XComponent key events to
keyboard_types::KeyboardEvent. - Modifier
State - Modifier and lock state as reported by the platform alongside a key event.
- Unknown
KeyState
Functions§
- location
locationvalue for a key code.NumLockitself isStandard, per the UI Events specification.- named_
key - Logical key value for key codes that never produce a character.
- us_char
- Character produced by a physical key on the US layout, following the
platform’s own
KeyCodeToUnicodelogic: letters use the shifted character when Shift XOR CapsLock, other keys when Shift.Nonewhen the key produces no character.