Function tetra::input::get_key_with_label[][src]

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

Returns the key that has the specified label in the current keyboard layout.

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

  • QWERTY: Some(Key::Q)
  • AZERTY: Some(Key::A)
  • Dvorak: Some(Key::X)

If the label is not present in the current keyboard layout, this function will return None.

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