Skip to main content

Module keyboard_types_compat

Module keyboard_types_compat 

Source
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§

KeyEventConverter
Stateful translator from XComponent key events to keyboard_types::KeyboardEvent.
ModifierState
Modifier and lock state as reported by the platform alongside a key event.
UnknownKeyState

Functions§

location
location value for a key code. NumLock itself is Standard, 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 KeyCodeToUnicode logic: letters use the shifted character when Shift XOR CapsLock, other keys when Shift. None when the key produces no character.