Struct dioxus_html::events::KeyboardData
source · pub struct KeyboardData {
pub char_code: u32,
pub key: String,
pub key_code: KeyCode,
pub alt_key: bool,
pub ctrl_key: bool,
pub meta_key: bool,
pub shift_key: bool,
pub location: usize,
pub repeat: bool,
pub which: usize,
/* private fields */
}
Fields§
§char_code: u32
key: String
Identify which “key” was entered.
key_code: KeyCode
Get the key code as an enum Variant.
alt_key: bool
Indicate if the alt
modifier key was pressed during this keyboard event
ctrl_key: bool
Indicate if the ctrl
modifier key was pressed during this keyboard event
meta_key: bool
Indicate if the meta
modifier key was pressed during this keyboard event
shift_key: bool
Indicate if the shift
modifier key was pressed during this keyboard event
location: usize
repeat: bool
which: usize
Implementations§
source§impl KeyboardData
impl KeyboardData
pub fn new( key: Key, code: Code, location: Location, is_auto_repeating: bool, modifiers: Modifiers ) -> Self
sourcepub fn key(&self) -> Key
pub 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.
sourcepub fn code(&self) -> Code
pub 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.
sourcepub fn modifiers(&self) -> Modifiers
pub fn modifiers(&self) -> Modifiers
The set of modifier keys which were pressed when the event occurred
sourcepub fn location(&self) -> Location
pub fn location(&self) -> Location
The location of the key on the keyboard or other input device.
sourcepub fn is_auto_repeating(&self) -> bool
pub fn is_auto_repeating(&self) -> bool
true
iff the key is being held down such that it is automatically repeating.
Trait Implementations§
source§impl Clone for KeyboardData
impl Clone for KeyboardData
source§fn clone(&self) -> KeyboardData
fn clone(&self) -> KeyboardData
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for KeyboardData
impl Debug for KeyboardData
source§impl<'de> Deserialize<'de> for KeyboardData
impl<'de> Deserialize<'de> for KeyboardData
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl From<&Event> for KeyboardData
impl From<&Event> for KeyboardData
source§impl From<&KeyboardEvent> for KeyboardData
impl From<&KeyboardEvent> for KeyboardData
source§fn from(e: &KeyboardEvent) -> Self
fn from(e: &KeyboardEvent) -> Self
source§impl From<Event> for KeyboardData
impl From<Event> for KeyboardData
source§impl PartialEq<KeyboardData> for KeyboardData
impl PartialEq<KeyboardData> for KeyboardData
source§fn eq(&self, other: &KeyboardData) -> bool
fn eq(&self, other: &KeyboardData) -> bool
self
and other
values to be equal, and is used
by ==
.