pub trait PlatformKeyboardMapper {
// Required methods
fn map_key_equivalent(
&self,
keystroke: Keystroke,
use_key_equivalents: bool,
) -> KeybindingKeystroke;
fn get_key_equivalents(&self) -> Option<&HashMap<char, char>>;
}Expand description
Maps keystrokes in keybindings to the keys the platform reports.
The platform implements this to handle keyboard layouts where a binding’s key is typed
through another key. See KeyBinding::load.
Required Methods§
Sourcefn map_key_equivalent(
&self,
keystroke: Keystroke,
use_key_equivalents: bool,
) -> KeybindingKeystroke
fn map_key_equivalent( &self, keystroke: Keystroke, use_key_equivalents: bool, ) -> KeybindingKeystroke
Maps keystroke from a keybinding to the form the platform matches against.
use_key_equivalents asks for the mapping that depends on the current layout. The
implementation decides what that means. The mapping is applied to keybindings loaded with
KeyBinding::load.
Sourcefn get_key_equivalents(&self) -> Option<&HashMap<char, char>>
fn get_key_equivalents(&self) -> Option<&HashMap<char, char>>
Returns the key equivalents for the current layout, mapping each character to the one
that the layout types in its place. Returns None where the platform has no such table.
macOS returns one for the layouts it has a table for. Windows returns None.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".