Function keymaps::get_key_meaning

source ·
pub fn get_key_meaning(
    key: &Option<Key>,
    key_meaning: &Option<KeyMeaning>,
    lock_state: &Option<LockState>,
    modifiers: &Option<Modifiers>
) -> KeyMeaning
Expand description

Extracts key meaning in accordance with the Fuchsia key event API specification.

Key meaning is returned verbatim if defined; otherwise, the US QWERTY keymap is applied to the supplied key and the currently active modifiers and lock state.

These usually come from a fidl.fuchsia.ui.input3/KeyEvent, so you can simply pass its components in if you have one. But, a valid KeyEvent is not required, and the caller can fill each of the parameters at will.

If neither the key nor the key meaning are defined, an “unidentified” nonprintable key meaning is returned.