xinput/flags/
keystroke.rs1use bytemuck::{Pod, Zeroable};
2use winapi::um::xinput::*;
3
4
5
6#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
9#[derive(Pod, Zeroable)]
10#[repr(transparent)] pub struct KeystrokeFlags(u16);
11use KeystrokeFlags as Keystroke;
12
13flags! { Keystroke => u16; None, KeyDown, KeyUp, Repeat }
14
15#[allow(non_upper_case_globals)] impl KeystrokeFlags {
16 pub const None : Keystroke = Keystroke(0);
18
19 pub const KeyDown : Keystroke = Keystroke(XINPUT_KEYSTROKE_KEYDOWN);
21
22 pub const KeyUp : Keystroke = Keystroke(XINPUT_KEYSTROKE_KEYUP);
24
25 pub const Repeat : Keystroke = Keystroke(XINPUT_KEYSTROKE_REPEAT);
27}
28
29#[allow(non_upper_case_globals)] impl crate::Keystroke {
30 pub const None : Keystroke = Keystroke(0);
32
33 pub const KeyDown : Keystroke = Keystroke(XINPUT_KEYSTROKE_KEYDOWN);
35
36 pub const KeyUp : Keystroke = Keystroke(XINPUT_KEYSTROKE_KEYUP);
38
39 pub const Repeat : Keystroke = Keystroke(XINPUT_KEYSTROKE_REPEAT);
41}
42
43