dioxus_lib::prelude

Trait HasKeyboardData

source
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§

source

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.

source

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.

source

fn location(&self) -> Location

The location of the key on the keyboard or other input device.

source

fn is_auto_repeating(&self) -> bool

true iff the key is being held down such that it is automatically repeating.

source

fn is_composing(&self) -> bool

Indicates whether the key is fired within a composition session.

source

fn as_any(&self) -> &(dyn Any + 'static)

return self as Any

Implementors§