pub fn get_key_label(ctx: &Context, physical_key: Key) -> Option<KeyLabel>
Expand description

Returns the label for the specified key in the current keyboard layout.

For example, passing Key::Q to this function will return different results depending on the active layout:

  • QWERTY: Some(KeyLabel::Q)
  • AZERTY: Some(KeyLabel::A)
  • Dvorak: Some(KeyLabel::Quote)

If the key cannot be mapped to the current keyboard layout, this function will return None.

To convert in the opposite direction (KeyLabel to Key), use get_key_with_label.