input_pipeline > Keymap handler

The handler source code is in keymap_handler.rs.

The task of the keymap handler is to use the [keymap settings][ks] supplied by the text settings handler to apply the appropriate keymap. This allows rudimentary international text entry based on key events, which is require by some consumers, such as those that implement web text APIs (e.g. Chromium).

The handler selects a keymap to apply, and decorates the KeyboardEvent with key_meaning, corresponding to the code point based on the currently active keymap.

The key_meaning is distributed to consumers by way of fuchsia.ui.input3/KeyEvent.key_meaning. The consumers are expected to:

  1. Apply the key effect based on KeyEvent.key_meaning if one is set.
  2. Else, apply the US QWERTY keymap to [KeyEvent.key] if KeyEvent.key_meaning is not set.

While in theory only (1) is ever needed, (2) must be specified and supported because of the modularity of the input pipeline. It is unlikely, but conceivable, that a product would configure the input pipeline to not have any keymap switching support.