Improve keyboard event debug formatting

This commit is contained in:
Reinis Mazeiks committed 2022-06-29 01:09:17 +03:00
1 parent 8f8a614a5c
commit a46ff93600
1 file changed
+13 -1
+13 -1
View File
@@ -427,7 +427,7 @@ pub mod on {
pub type KeyboardEvent = UiEvent<KeyboardData>;
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Clone)]
#[derive(Clone)]
pub struct KeyboardData {
#[deprecated(
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>;
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Clone)]