vertigo/dom/events/key_down_event.rs
1/// Structure passed as a parameter to callback on on_key_down event.
2#[derive(Clone, Debug)]
3pub struct KeyDownEvent {
4 pub key: String,
5 pub code: String,
6 pub alt_key: bool,
7 pub ctrl_key: bool,
8 pub shift_key: bool,
9 pub meta_key: bool,
10}
11
12impl std::fmt::Display for KeyDownEvent {
13 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14 write!(f, "KeyDownEvent={}", self.key)
15 }
16}