pub trait HasKeyboardData: ModifiersInteraction + Any {
// Required methods
fn key(&self) -> Key;
fn code(&self) -> Code;
fn location(&self) -> Location;
fn is_auto_repeating(&self) -> bool;
fn is_composing(&self) -> bool;
fn as_any(&self) -> &(dyn Any + 'static);
}
Required Methods§
sourcefn key(&self) -> Key
fn key(&self) -> Key
The value of the key pressed by the user, taking into consideration the state of modifier keys such as Shift as well as the keyboard locale and layout.
sourcefn code(&self) -> Code
fn code(&self) -> Code
A physical key on the keyboard (as opposed to the character generated by pressing the key). In other words, this property returns a value that isn’t altered by keyboard layout or the state of the modifier keys.
sourcefn is_auto_repeating(&self) -> bool
fn is_auto_repeating(&self) -> bool
true
iff the key is being held down such that it is automatically repeating.
sourcefn is_composing(&self) -> bool
fn is_composing(&self) -> bool
Indicates whether the key is fired within a composition session.