aboutsummaryrefslogtreecommitdiffstats
path: root/src/win32/event.rs
blob: 83d775d7fa0e45905cbfd8abf1b8733ae81b0e40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
use events;
use super::ffi;

pub fn vkeycode_to_element(code: ffi::WPARAM) -> Option<events::Element> {
    Some(match code {
        //ffi::VK_LBUTTON => events::Lbutton,
        //ffi::VK_RBUTTON => events::Rbutton,
        //ffi::VK_CANCEL => events::Cancel,
        //ffi::VK_MBUTTON => events::Mbutton,
        //ffi::VK_XBUTTON1 => events::Xbutton1,
        //ffi::VK_XBUTTON2 => events::Xbutton2,
        ffi::VK_BACK => events::Back,
        ffi::VK_TAB => events::Tab,
        //ffi::VK_CLEAR => events::Clear,
        ffi::VK_RETURN => events::Return,
        //ffi::VK_SHIFT => events::Shift,
        //ffi::VK_CONTROL => events::Control,
        //ffi::VK_MENU => events::Menu,
        ffi::VK_PAUSE => events::Pause,
        ffi::VK_CAPITAL => events::Capital,
        ffi::VK_KANA => events::Kana,
        //ffi::VK_HANGUEL => events::Hanguel,
        //ffi::VK_HANGUL => events::Hangul,
        //ffi::VK_JUNJA => events::Junja,
        //ffi::VK_FINAL => events::Final,
        //ffi::VK_HANJA => events::Hanja,
        ffi::VK_KANJI => events::Kanji,
        ffi::VK_ESCAPE => events::Escape,
        ffi::VK_CONVERT => events::Convert,
        //ffi::VK_NONCONVERT => events::Nonconvert,
        //ffi::VK_ACCEPT => events::Accept,
        //ffi::VK_MODECHANGE => events::Modechange,
        ffi::VK_SPACE => events::Space,
        ffi::VK_PRIOR => events::Prior,
        ffi::VK_NEXT => events::Next,
        ffi::VK_END => events::End,
        ffi::VK_HOME => events::Home,
        ffi::VK_LEFT => events::Left,
        ffi::VK_UP => events::Up,
        ffi::VK_RIGHT => events::Right,
        ffi::VK_DOWN => events::Down,
        //ffi::VK_SELECT => events::Select,
        //ffi::VK_PRINT => events::Print,
        //ffi::VK_EXECUTE => events::Execute,
        ffi::VK_SNAPSHOT => events::Snapshot,
        ffi::VK_INSERT => events::Insert,
        ffi::VK_DELETE => events::Delete,
        //ffi::VK_HELP => events::Help,
        0x30 => events::Key0,
        0x31 => events::Key1,
        0x32 => events::Key2,
        0x33 => events::Key3,
        0x34 => events::Key4,
        0x35 => events::Key5,
        0x36 => events::Key6,
        0x37 => events::Key7,
        0x38 => events::Key8,
        0x39 => events::Key9,
        0x41 => events::A,
        0x42 => events::B,
        0x43 => events::C,
        0x44 => events::D,
        0x45 => events::E,
        0x46 => events::F,
        0x47 => events::G,
        0x48 => events::H,
        0x49 => events::I,
        0x4A => events::J,
        0x4B => events::K,
        0x4C => events::L,
        0x4D => events::M,
        0x4E => events::N,
        0x4F => events::O,
        0x50 => events::P,
        0x51 => events::Q,
        0x52 => events::R,
        0x53 => events::S,
        0x54 => events::T,
        0x55 => events::U,
        0x56 => events::V,
        0x57 => events::W,
        0x58 => events::X,
        0x59 => events::Y,
        0x5A => events::Z,
        //ffi::VK_LWIN => events::Lwin,
        //ffi::VK_RWIN => events::Rwin,
        ffi::VK_APPS => events::Apps,
        ffi::VK_SLEEP => events::Sleep,
        ffi::VK_NUMPAD0 => events::Numpad0,
        ffi::VK_NUMPAD1 => events::Numpad1,
        ffi::VK_NUMPAD2 => events::Numpad2,
        ffi::VK_NUMPAD3 => events::Numpad3,
        ffi::VK_NUMPAD4 => events::Numpad4,
        ffi::VK_NUMPAD5 => events::Numpad5,
        ffi::VK_NUMPAD6 => events::Numpad6,
        ffi::VK_NUMPAD7 => events::Numpad7,
        ffi::VK_NUMPAD8 => events::Numpad8,
        ffi::VK_NUMPAD9 => events::Numpad9,
        ffi::VK_MULTIPLY => events::Multiply,
        ffi::VK_ADD => events::Add,
        //ffi::VK_SEPARATOR => events::Separator,
        ffi::VK_SUBTRACT => events::Subtract,
        ffi::VK_DECIMAL => events::Decimal,
        ffi::VK_DIVIDE => events::Divide,
        ffi::VK_F1 => events::F1,
        ffi::VK_F2 => events::F2,
        ffi::VK_F3 => events::F3,
        ffi::VK_F4 => events::F4,
        ffi::VK_F5 => events::F5,
        ffi::VK_F6 => events::F6,
        ffi::VK_F7 => events::F7,
        ffi::VK_F8 => events::F8,
        ffi::VK_F9 => events::F9,
        ffi::VK_F10 => events::F10,
        ffi::VK_F11 => events::F11,
        ffi::VK_F12 => events::F12,
        ffi::VK_F13 => events::F13,
        ffi::VK_F14 => events::F14,
        ffi::VK_F15 => events::F15,
        /*ffi::VK_F16 => events::F16,
        ffi::VK_F17 => events::F17,
        ffi::VK_F18 => events::F18,
        ffi::VK_F19 => events::F19,
        ffi::VK_F20 => events::F20,
        ffi::VK_F21 => events::F21,
        ffi::VK_F22 => events::F22,
        ffi::VK_F23 => events::F23,
        ffi::VK_F24 => events::F24,*/
        ffi::VK_NUMLOCK => events::Numlock,
        ffi::VK_SCROLL => events::Scroll,
        /*ffi::VK_LSHIFT => events::Lshift,
        ffi::VK_RSHIFT => events::Rshift,
        ffi::VK_LCONTROL => events::Lcontrol,
        ffi::VK_RCONTROL => events::Rcontrol,
        ffi::VK_LMENU => events::Lmenu,
        ffi::VK_RMENU => events::Rmenu,
        ffi::VK_BROWSER_BACK => events::Browser_back,
        ffi::VK_BROWSER_FORWARD => events::Browser_forward,
        ffi::VK_BROWSER_REFRESH => events::Browser_refresh,
        ffi::VK_BROWSER_STOP => events::Browser_stop,
        ffi::VK_BROWSER_SEARCH => events::Browser_search,
        ffi::VK_BROWSER_FAVORITES => events::Browser_favorites,
        ffi::VK_BROWSER_HOME => events::Browser_home,
        ffi::VK_VOLUME_MUTE => events::Volume_mute,
        ffi::VK_VOLUME_DOWN => events::Volume_down,
        ffi::VK_VOLUME_UP => events::Volume_up,
        ffi::VK_MEDIA_NEXT_TRACK => events::Media_next_track,
        ffi::VK_MEDIA_PREV_TRACK => events::Media_prev_track,
        ffi::VK_MEDIA_STOP => events::Media_stop,
        ffi::VK_MEDIA_PLAY_PAUSE => events::Media_play_pause,
        ffi::VK_LAUNCH_MAIL => events::Launch_mail,
        ffi::VK_LAUNCH_MEDIA_SELECT => events::Launch_media_select,
        ffi::VK_LAUNCH_APP1 => events::Launch_app1,
        ffi::VK_LAUNCH_APP2 => events::Launch_app2,
        ffi::VK_OEM_1 => events::Oem_1,
        ffi::VK_OEM_PLUS => events::Oem_plus,
        ffi::VK_OEM_COMMA => events::Oem_comma,
        ffi::VK_OEM_MINUS => events::Oem_minus,
        ffi::VK_OEM_PERIOD => events::Oem_period,
        ffi::VK_OEM_2 => events::Oem_2,
        ffi::VK_OEM_3 => events::Oem_3,
        ffi::VK_OEM_4 => events::Oem_4,
        ffi::VK_OEM_5 => events::Oem_5,
        ffi::VK_OEM_6 => events::Oem_6,
        ffi::VK_OEM_7 => events::Oem_7,
        ffi::VK_OEM_8 => events::Oem_8,
        ffi::VK_OEM_102 => events::Oem_102,
        ffi::VK_PROCESSKEY => events::Processkey,
        ffi::VK_PACKET => events::Packet,
        ffi::VK_ATTN => events::Attn,
        ffi::VK_CRSEL => events::Crsel,
        ffi::VK_EXSEL => events::Exsel,
        ffi::VK_EREOF => events::Ereof,
        ffi::VK_PLAY => events::Play,
        ffi::VK_ZOOM => events::Zoom,
        ffi::VK_NONAME => events::Noname,
        ffi::VK_PA1 => events::Pa1,
        ffi::VK_OEM_CLEAR => events::Oem_clear,*/
        _ => return None
    })
}