pub trait KeyEventExtModifierSupplement {
    // Required methods
    fn text_with_all_modifiers(&self) -> Option<&str>;
    fn key_without_modifiers(&self) -> Key;
}
Available on windows_platform or macos_platform or x11_platform or wayland_platform or orbital_platform only.
Expand description

Additional methods for the KeyEvent which cannot be implemented on all platforms.

Required Methods§

source

fn text_with_all_modifiers(&self) -> Option<&str>

Identical to KeyEvent::text but this is affected by Ctrl.

For example, pressing Ctrl+a produces Some("\x01").

source

fn key_without_modifiers(&self) -> Key

This value ignores all modifiers including, but not limited to Shift, Caps Lock, and Ctrl. In most cases this means that the unicode character in the resulting string is lowercase.

This is useful for key-bindings / shortcut key combinations.

In case logical_key reports Dead, this will still report the key as Character according to the current keyboard layout. This value cannot be Dead.

Implementors§