floem_winit/platform/modifier_supplement.rs
1#![cfg(any(windows_platform, macos_platform, x11_platform, wayland_platform))]
2
3use crate::keyboard::Key;
4
5/// Additional methods for the `KeyEvent` which cannot be implemented on all
6/// platforms.
7pub trait KeyEventExtModifierSupplement {
8 /// Identical to `KeyEvent::text` but this is affected by <kbd>Ctrl</kbd>.
9 ///
10 /// For example, pressing <kbd>Ctrl</kbd>+<kbd>a</kbd> produces `Some("\x01")`.
11 fn text_with_all_modifiers(&self) -> Option<&str>;
12
13 /// This value ignores all modifiers including,
14 /// but not limited to <kbd>Shift</kbd>, <kbd>Caps Lock</kbd>,
15 /// and <kbd>Ctrl</kbd>. In most cases this means that the
16 /// unicode character in the resulting string is lowercase.
17 ///
18 /// This is useful for key-bindings / shortcut key combinations.
19 ///
20 /// In case `logical_key` reports `Dead`, this will still report the
21 /// key as `Character` according to the current keyboard layout. This value
22 /// cannot be `Dead`.
23 fn key_without_modifiers(&self) -> Key;
24}