lighthouse_protocol/input/key_modifiers.rs
1use serde::{Deserialize, Serialize};
2
3/// A keyboard event.
4#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)]
5#[serde(rename_all = "camelCase")]
6pub struct KeyModifiers {
7 /// Whether the alt key is held.
8 pub alt: bool,
9 /// Whether the ctrl key is held.
10 pub ctrl: bool,
11 /// Whether the meta key is held.
12 pub meta: bool,
13 /// Whether the shiftKey key is held.
14 pub shift: bool,
15}
16
17impl Default for KeyModifiers {
18 fn default() -> Self {
19 Self {
20 alt: false,
21 ctrl: false,
22 meta: false,
23 shift: false,
24 }
25 }
26}