ezEngine  Milestone 7
Declarations.h
1 #pragma once
2 
4 #include <Core/Basics.h>
5 
9 struct EZ_CORE_DLL ezKeyState
10 {
11  enum Enum
12  {
13  Up,
16  Down
17  };
18 
20  static ezKeyState::Enum GetNewKeyState(ezKeyState::Enum PrevState, bool bKeyDown);
21 };
22 
30 {
31  typedef ezUInt16 StorageType;
32 
33  enum Enum
34  {
35  None = 0,
36 
49 
50 
51  // Some predefined sets of flags for the most common use cases
55  IsMouseAxisPosition = ValueRangeZeroToOne | FullAxis | NeverTimeScale,
58  IsDoubleClick = ValueBinaryZeroOrOne | Pressable | NeverTimeScale,
62 
63  Default = None
64  };
65 
66  struct Bits
67  {
68  StorageType ReportsRelativeValues : 1;
69  StorageType ValueBinaryZeroOrOne : 1;
70  StorageType ValueRangeZeroToOne : 1;
71  StorageType ValueRangeZeroToInf : 1;
72  StorageType Pressable : 1;
73  StorageType Holdable : 1;
74  StorageType HalfAxis : 1;
75  StorageType FullAxis : 1;
76  StorageType RequiresDeadZone : 1;
77  StorageType ValuesAreNonContinuous : 1;
78  StorageType ActivationDependsOnOthers : 1;
79  };
80 };
81 
83 
84 #define ezInputSlot_None ""
85 
86 #define ezInputSlot_TouchPoint0 "touchpoint_0"
87 #define ezInputSlot_TouchPoint0_PositionX "touchpoint_0_position_x"
88 #define ezInputSlot_TouchPoint0_PositionY "touchpoint_0_position_y"
89 
90 #define ezInputSlot_TouchPoint1 "touchpoint_1"
91 #define ezInputSlot_TouchPoint1_PositionX "touchpoint_1_position_x"
92 #define ezInputSlot_TouchPoint1_PositionY "touchpoint_1_position_y"
93 
94 #define ezInputSlot_TouchPoint2 "touchpoint_2"
95 #define ezInputSlot_TouchPoint2_PositionX "touchpoint_2_position_x"
96 #define ezInputSlot_TouchPoint2_PositionY "touchpoint_2_position_y"
97 
98 #define ezInputSlot_TouchPoint3 "touchpoint_3"
99 #define ezInputSlot_TouchPoint3_PositionX "touchpoint_3_position_x"
100 #define ezInputSlot_TouchPoint3_PositionY "touchpoint_3_position_y"
101 
102 #define ezInputSlot_TouchPoint4 "touchpoint_4"
103 #define ezInputSlot_TouchPoint4_PositionX "touchpoint_4_position_x"
104 #define ezInputSlot_TouchPoint4_PositionY "touchpoint_4_position_y"
105 
106 #define ezInputSlot_TouchPoint5 "touchpoint_5"
107 #define ezInputSlot_TouchPoint5_PositionX "touchpoint_5_position_x"
108 #define ezInputSlot_TouchPoint5_PositionY "touchpoint_5_position_y"
109 
110 #define ezInputSlot_TouchPoint6 "touchpoint_6"
111 #define ezInputSlot_TouchPoint6_PositionX "touchpoint_6_position_x"
112 #define ezInputSlot_TouchPoint6_PositionY "touchpoint_6_position_y"
113 
114 #define ezInputSlot_TouchPoint7 "touchpoint_7"
115 #define ezInputSlot_TouchPoint7_PositionX "touchpoint_7_position_x"
116 #define ezInputSlot_TouchPoint7_PositionY "touchpoint_7_position_y"
117 
118 #define ezInputSlot_TouchPoint8 "touchpoint_8"
119 #define ezInputSlot_TouchPoint8_PositionX "touchpoint_8_position_x"
120 #define ezInputSlot_TouchPoint8_PositionY "touchpoint_8_position_y"
121 
122 #define ezInputSlot_TouchPoint9 "touchpoint_9"
123 #define ezInputSlot_TouchPoint9_PositionX "touchpoint_9_position_x"
124 #define ezInputSlot_TouchPoint9_PositionY "touchpoint_9_position_y"
125 
126 #define ezInputSlot_Controller0_ButtonA "controller0_button_a"
127 #define ezInputSlot_Controller0_ButtonB "controller0_button_b"
128 #define ezInputSlot_Controller0_ButtonX "controller0_button_x"
129 #define ezInputSlot_Controller0_ButtonY "controller0_button_y"
130 #define ezInputSlot_Controller0_ButtonStart "controller0_button_start"
131 #define ezInputSlot_Controller0_ButtonBack "controller0_button_back"
132 #define ezInputSlot_Controller0_LeftShoulder "controller0_left_shoulder"
133 #define ezInputSlot_Controller0_RightShoulder "controller0_right_shoulder"
134 #define ezInputSlot_Controller0_LeftTrigger "controller0_left_trigger"
135 #define ezInputSlot_Controller0_RightTrigger "controller0_right_trigger"
136 #define ezInputSlot_Controller0_PadUp "controller0_pad_up"
137 #define ezInputSlot_Controller0_PadDown "controller0_pad_down"
138 #define ezInputSlot_Controller0_PadLeft "controller0_pad_left"
139 #define ezInputSlot_Controller0_PadRight "controller0_pad_right"
140 #define ezInputSlot_Controller0_LeftStick "controller0_left_stick"
141 #define ezInputSlot_Controller0_RightStick "controller0_right_stick"
142 #define ezInputSlot_Controller0_LeftStick_NegX "controller0_leftstick_negx"
143 #define ezInputSlot_Controller0_LeftStick_PosX "controller0_leftstick_posx"
144 #define ezInputSlot_Controller0_LeftStick_NegY "controller0_leftstick_negy"
145 #define ezInputSlot_Controller0_LeftStick_PosY "controller0_leftstick_posy"
146 #define ezInputSlot_Controller0_RightStick_NegX "controller0_rightstick_negx"
147 #define ezInputSlot_Controller0_RightStick_PosX "controller0_rightstick_posx"
148 #define ezInputSlot_Controller0_RightStick_NegY "controller0_rightstick_negy"
149 #define ezInputSlot_Controller0_RightStick_PosY "controller0_rightstick_posy"
150 
151 #define ezInputSlot_Controller1_ButtonA "controller1_button_a"
152 #define ezInputSlot_Controller1_ButtonB "controller1_button_b"
153 #define ezInputSlot_Controller1_ButtonX "controller1_button_x"
154 #define ezInputSlot_Controller1_ButtonY "controller1_button_y"
155 #define ezInputSlot_Controller1_ButtonStart "controller1_button_start"
156 #define ezInputSlot_Controller1_ButtonBack "controller1_button_back"
157 #define ezInputSlot_Controller1_LeftShoulder "controller1_left_shoulder"
158 #define ezInputSlot_Controller1_RightShoulder "controller1_right_shoulder"
159 #define ezInputSlot_Controller1_LeftTrigger "controller1_left_trigger"
160 #define ezInputSlot_Controller1_RightTrigger "controller1_right_trigger"
161 #define ezInputSlot_Controller1_PadUp "controller1_pad_up"
162 #define ezInputSlot_Controller1_PadDown "controller1_pad_down"
163 #define ezInputSlot_Controller1_PadLeft "controller1_pad_left"
164 #define ezInputSlot_Controller1_PadRight "controller1_pad_right"
165 #define ezInputSlot_Controller1_LeftStick "controller1_left_stick"
166 #define ezInputSlot_Controller1_RightStick "controller1_right_stick"
167 #define ezInputSlot_Controller1_LeftStick_NegX "controller1_leftstick_negx"
168 #define ezInputSlot_Controller1_LeftStick_PosX "controller1_leftstick_posx"
169 #define ezInputSlot_Controller1_LeftStick_NegY "controller1_leftstick_negy"
170 #define ezInputSlot_Controller1_LeftStick_PosY "controller1_leftstick_posy"
171 #define ezInputSlot_Controller1_RightStick_NegX "controller1_rightstick_negx"
172 #define ezInputSlot_Controller1_RightStick_PosX "controller1_rightstick_posx"
173 #define ezInputSlot_Controller1_RightStick_NegY "controller1_rightstick_negy"
174 #define ezInputSlot_Controller1_RightStick_PosY "controller1_rightstick_posy"
175 
176 #define ezInputSlot_Controller2_ButtonA "controller2_button_a"
177 #define ezInputSlot_Controller2_ButtonB "controller2_button_b"
178 #define ezInputSlot_Controller2_ButtonX "controller2_button_x"
179 #define ezInputSlot_Controller2_ButtonY "controller2_button_y"
180 #define ezInputSlot_Controller2_ButtonStart "controller2_button_start"
181 #define ezInputSlot_Controller2_ButtonBack "controller2_button_back"
182 #define ezInputSlot_Controller2_LeftShoulder "controller2_left_shoulder"
183 #define ezInputSlot_Controller2_RightShoulder "controller2_right_shoulder"
184 #define ezInputSlot_Controller2_LeftTrigger "controller2_left_trigger"
185 #define ezInputSlot_Controller2_RightTrigger "controller2_right_trigger"
186 #define ezInputSlot_Controller2_PadUp "controller2_pad_up"
187 #define ezInputSlot_Controller2_PadDown "controller2_pad_down"
188 #define ezInputSlot_Controller2_PadLeft "controller2_pad_left"
189 #define ezInputSlot_Controller2_PadRight "controller2_pad_right"
190 #define ezInputSlot_Controller2_LeftStick "controller2_left_stick"
191 #define ezInputSlot_Controller2_RightStick "controller2_right_stick"
192 #define ezInputSlot_Controller2_LeftStick_NegX "controller2_leftstick_negx"
193 #define ezInputSlot_Controller2_LeftStick_PosX "controller2_leftstick_posx"
194 #define ezInputSlot_Controller2_LeftStick_NegY "controller2_leftstick_negy"
195 #define ezInputSlot_Controller2_LeftStick_PosY "controller2_leftstick_posy"
196 #define ezInputSlot_Controller2_RightStick_NegX "controller2_rightstick_negx"
197 #define ezInputSlot_Controller2_RightStick_PosX "controller2_rightstick_posx"
198 #define ezInputSlot_Controller2_RightStick_NegY "controller2_rightstick_negy"
199 #define ezInputSlot_Controller2_RightStick_PosY "controller2_rightstick_posy"
200 
201 #define ezInputSlot_Controller3_ButtonA "controller3_button_a"
202 #define ezInputSlot_Controller3_ButtonB "controller3_button_b"
203 #define ezInputSlot_Controller3_ButtonX "controller3_button_x"
204 #define ezInputSlot_Controller3_ButtonY "controller3_button_y"
205 #define ezInputSlot_Controller3_ButtonStart "controller3_button_start"
206 #define ezInputSlot_Controller3_ButtonBack "controller3_button_back"
207 #define ezInputSlot_Controller3_LeftShoulder "controller3_left_shoulder"
208 #define ezInputSlot_Controller3_RightShoulder "controller3_right_shoulder"
209 #define ezInputSlot_Controller3_LeftTrigger "controller3_left_trigger"
210 #define ezInputSlot_Controller3_RightTrigger "controller3_right_trigger"
211 #define ezInputSlot_Controller3_PadUp "controller3_pad_up"
212 #define ezInputSlot_Controller3_PadDown "controller3_pad_down"
213 #define ezInputSlot_Controller3_PadLeft "controller3_pad_left"
214 #define ezInputSlot_Controller3_PadRight "controller3_pad_right"
215 #define ezInputSlot_Controller3_LeftStick "controller3_left_stick"
216 #define ezInputSlot_Controller3_RightStick "controller3_right_stick"
217 #define ezInputSlot_Controller3_LeftStick_NegX "controller3_leftstick_negx"
218 #define ezInputSlot_Controller3_LeftStick_PosX "controller3_leftstick_posx"
219 #define ezInputSlot_Controller3_LeftStick_NegY "controller3_leftstick_negy"
220 #define ezInputSlot_Controller3_LeftStick_PosY "controller3_leftstick_posy"
221 #define ezInputSlot_Controller3_RightStick_NegX "controller3_rightstick_negx"
222 #define ezInputSlot_Controller3_RightStick_PosX "controller3_rightstick_posx"
223 #define ezInputSlot_Controller3_RightStick_NegY "controller3_rightstick_negy"
224 #define ezInputSlot_Controller3_RightStick_PosY "controller3_rightstick_posy"
225 
226 
227 
228 #define ezInputSlot_KeyLeft "keyboard_left"
229 #define ezInputSlot_KeyRight "keyboard_right"
230 #define ezInputSlot_KeyUp "keyboard_up"
231 #define ezInputSlot_KeyDown "keyboard_down"
232 #define ezInputSlot_KeyEscape "keyboard_escape"
233 #define ezInputSlot_KeySpace "keyboard_space"
234 #define ezInputSlot_KeyBackspace "keyboard_backspace"
235 #define ezInputSlot_KeyReturn "keyboard_return"
236 #define ezInputSlot_KeyTab "keyboard_tab"
237 #define ezInputSlot_KeyLeftShift "keyboard_left_shift"
238 #define ezInputSlot_KeyRightShift "keyboard_right_shift"
239 #define ezInputSlot_KeyLeftCtrl "keyboard_left_ctrl"
240 #define ezInputSlot_KeyRightCtrl "keyboard_right_ctrl"
241 #define ezInputSlot_KeyLeftAlt "keyboard_left_alt"
242 #define ezInputSlot_KeyRightAlt "keyboard_right_alt"
243 #define ezInputSlot_KeyLeftWin "keyboard_left_win"
244 #define ezInputSlot_KeyRightWin "keyboard_right_win"
245 #define ezInputSlot_KeyBracketOpen "keyboard_bracket_open"
246 #define ezInputSlot_KeyBracketClose "keyboard_bracket_close"
247 #define ezInputSlot_KeySemicolon "keyboard_semicolon"
248 #define ezInputSlot_KeyApostrophe "keyboard_apostrophe"
249 #define ezInputSlot_KeySlash "keyboard_slash"
250 #define ezInputSlot_KeyEquals "keyboard_equals"
251 #define ezInputSlot_KeyTilde "keyboard_tilde"
252 #define ezInputSlot_KeyHyphen "keyboard_hyphen"
253 #define ezInputSlot_KeyComma "keyboard_comma"
254 #define ezInputSlot_KeyPeriod "keyboard_period"
255 #define ezInputSlot_KeyBackslash "keyboard_backslash"
256 #define ezInputSlot_KeyPipe "keyboard_pipe"
257 #define ezInputSlot_Key1 "keyboard_1"
258 #define ezInputSlot_Key2 "keyboard_2"
259 #define ezInputSlot_Key3 "keyboard_3"
260 #define ezInputSlot_Key4 "keyboard_4"
261 #define ezInputSlot_Key5 "keyboard_5"
262 #define ezInputSlot_Key6 "keyboard_6"
263 #define ezInputSlot_Key7 "keyboard_7"
264 #define ezInputSlot_Key8 "keyboard_8"
265 #define ezInputSlot_Key9 "keyboard_9"
266 #define ezInputSlot_Key0 "keyboard_0"
267 #define ezInputSlot_KeyNumpad1 "keyboard_numpad_1"
268 #define ezInputSlot_KeyNumpad2 "keyboard_numpad_2"
269 #define ezInputSlot_KeyNumpad3 "keyboard_numpad_3"
270 #define ezInputSlot_KeyNumpad4 "keyboard_numpad_4"
271 #define ezInputSlot_KeyNumpad5 "keyboard_numpad_5"
272 #define ezInputSlot_KeyNumpad6 "keyboard_numpad_6"
273 #define ezInputSlot_KeyNumpad7 "keyboard_numpad_7"
274 #define ezInputSlot_KeyNumpad8 "keyboard_numpad_8"
275 #define ezInputSlot_KeyNumpad9 "keyboard_numpad_9"
276 #define ezInputSlot_KeyNumpad0 "keyboard_numpad_0"
277 #define ezInputSlot_KeyA "keyboard_a"
278 #define ezInputSlot_KeyB "keyboard_b"
279 #define ezInputSlot_KeyC "keyboard_c"
280 #define ezInputSlot_KeyD "keyboard_d"
281 #define ezInputSlot_KeyE "keyboard_e"
282 #define ezInputSlot_KeyF "keyboard_f"
283 #define ezInputSlot_KeyG "keyboard_g"
284 #define ezInputSlot_KeyH "keyboard_h"
285 #define ezInputSlot_KeyI "keyboard_i"
286 #define ezInputSlot_KeyJ "keyboard_j"
287 #define ezInputSlot_KeyK "keyboard_k"
288 #define ezInputSlot_KeyL "keyboard_l"
289 #define ezInputSlot_KeyM "keyboard_m"
290 #define ezInputSlot_KeyN "keyboard_n"
291 #define ezInputSlot_KeyO "keyboard_o"
292 #define ezInputSlot_KeyP "keyboard_p"
293 #define ezInputSlot_KeyQ "keyboard_q"
294 #define ezInputSlot_KeyR "keyboard_r"
295 #define ezInputSlot_KeyS "keyboard_s"
296 #define ezInputSlot_KeyT "keyboard_t"
297 #define ezInputSlot_KeyU "keyboard_u"
298 #define ezInputSlot_KeyV "keyboard_v"
299 #define ezInputSlot_KeyW "keyboard_w"
300 #define ezInputSlot_KeyX "keyboard_x"
301 #define ezInputSlot_KeyY "keyboard_y"
302 #define ezInputSlot_KeyZ "keyboard_z"
303 #define ezInputSlot_KeyF1 "keyboard_f1"
304 #define ezInputSlot_KeyF2 "keyboard_f2"
305 #define ezInputSlot_KeyF3 "keyboard_f3"
306 #define ezInputSlot_KeyF4 "keyboard_f4"
307 #define ezInputSlot_KeyF5 "keyboard_f5"
308 #define ezInputSlot_KeyF6 "keyboard_f6"
309 #define ezInputSlot_KeyF7 "keyboard_f7"
310 #define ezInputSlot_KeyF8 "keyboard_f8"
311 #define ezInputSlot_KeyF9 "keyboard_f9"
312 #define ezInputSlot_KeyF10 "keyboard_f10"
313 #define ezInputSlot_KeyF11 "keyboard_f11"
314 #define ezInputSlot_KeyF12 "keyboard_f12"
315 #define ezInputSlot_KeyHome "keyboard_home"
316 #define ezInputSlot_KeyEnd "keyboard_end"
317 #define ezInputSlot_KeyDelete "keyboard_delete"
318 #define ezInputSlot_KeyInsert "keyboard_insert"
319 #define ezInputSlot_KeyPageUp "keyboard_page_up"
320 #define ezInputSlot_KeyPageDown "keyboard_page_down"
321 #define ezInputSlot_KeyNumLock "keyboard_numlock"
322 #define ezInputSlot_KeyNumpadPlus "keyboard_numpad_plus"
323 #define ezInputSlot_KeyNumpadMinus "keyboard_numpad_minus"
324 #define ezInputSlot_KeyNumpadStar "keyboard_numpad_star"
325 #define ezInputSlot_KeyNumpadSlash "keyboard_numpad_slash"
326 #define ezInputSlot_KeyNumpadPeriod "keyboard_numpad_period"
327 #define ezInputSlot_KeyNumpadEnter "keyboard_numpad_enter"
328 #define ezInputSlot_KeyCapsLock "keyboard_capslock"
329 #define ezInputSlot_KeyPrint "keyboard_print"
330 #define ezInputSlot_KeyScroll "keyboard_scroll"
331 #define ezInputSlot_KeyPause "keyboard_pause"
332 #define ezInputSlot_KeyApps "keyboard_apps"
333 #define ezInputSlot_KeyPrevTrack "keyboard_prev_track"
334 #define ezInputSlot_KeyNextTrack "keyboard_next_track"
335 #define ezInputSlot_KeyPlayPause "keyboard_play_pause"
336 #define ezInputSlot_KeyStop "keyboard_stop"
337 #define ezInputSlot_KeyVolumeUp "keyboard_volume_up"
338 #define ezInputSlot_KeyVolumeDown "keyboard_volume_down"
339 #define ezInputSlot_KeyMute "keyboard_mute"
340 
341 #define ezInputSlot_MouseWheelUp "mouse_wheel_up"
342 #define ezInputSlot_MouseWheelDown "mouse_wheel_down"
343 #define ezInputSlot_MouseMoveNegX "mouse_move_negx"
344 #define ezInputSlot_MouseMovePosX "mouse_move_posx"
345 #define ezInputSlot_MouseMoveNegY "mouse_move_negy"
346 #define ezInputSlot_MouseMovePosY "mouse_move_posy"
347 #define ezInputSlot_MouseButton0 "mouse_button_0"
348 #define ezInputSlot_MouseButton1 "mouse_button_1"
349 #define ezInputSlot_MouseButton2 "mouse_button_2"
350 #define ezInputSlot_MouseButton3 "mouse_button_3"
351 #define ezInputSlot_MouseButton4 "mouse_button_4"
352 #define ezInputSlot_MouseDblClick0 "mouse_button_0_doubleclick"
353 #define ezInputSlot_MouseDblClick1 "mouse_button_1_doubleclick"
354 #define ezInputSlot_MouseDblClick2 "mouse_button_2_doubleclick"
355 #define ezInputSlot_MousePositionX "mouse_position_x"
356 #define ezInputSlot_MousePositionY "mouse_position_y"
357