Improve keyboard event debug formatting
This commit is contained in:
1 parent
8f8a614a5c
commit
a46ff93600
1 file changed
+13
-1
@@ -427,7 +427,7 @@ pub mod on {
|
|||||||
|
|
||||||
pub type KeyboardEvent = UiEvent<KeyboardData>;
|
pub type KeyboardEvent = UiEvent<KeyboardData>;
|
||||||
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
|
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Clone)]
|
||||||
pub struct KeyboardData {
|
pub struct KeyboardData {
|
||||||
#[deprecated(
|
#[deprecated(
|
||||||
since = "0.3.0",
|
since = "0.3.0",
|
||||||
@@ -553,6 +553,18 @@ pub mod on {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Debug for KeyboardData {
|
||||||
|
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||||
|
f.debug_struct("KeyboardData")
|
||||||
|
.field("key", &self.key())
|
||||||
|
.field("code", &self.code())
|
||||||
|
.field("modifiers", &self.modifiers())
|
||||||
|
.field("location", &self.location())
|
||||||
|
.field("is_auto_repeating", &self.is_auto_repeating())
|
||||||
|
.finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub type FocusEvent = UiEvent<FocusData>;
|
pub type FocusEvent = UiEvent<FocusData>;
|
||||||
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
|
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
|||||||
Reference in new issue
Block a user