Berserk
InputDefs.hpp
Go to the documentation of this file.
1 /**********************************************************************************/
2 /* This file is part of Berserk Engine project */
3 /* https://github.com/EgorOrachyov/Berserk */
4 /**********************************************************************************/
5 /* MIT License */
6 /* */
7 /* Copyright (c) 2018 - 2021 Egor Orachyov */
8 /* */
9 /* Permission is hereby granted, free of charge, to any person obtaining a copy */
10 /* of this software and associated documentation files (the "Software"), to deal */
11 /* in the Software without restriction, including without limitation the rights */
12 /* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell */
13 /* copies of the Software, and to permit persons to whom the Software is */
14 /* furnished to do so, subject to the following conditions: */
15 /* */
16 /* The above copyright notice and this permission notice shall be included in all */
17 /* copies or substantial portions of the Software. */
18 /* */
19 /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR */
20 /* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, */
21 /* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE */
22 /* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER */
23 /* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, */
24 /* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */
25 /* SOFTWARE. */
26 /**********************************************************************************/
27 
28 #ifndef BERSERK_INPUTDEFS_HPP
29 #define BERSERK_INPUTDEFS_HPP
30 
31 #include <core/Config.hpp>
32 #include <core/Typedefs.hpp>
33 #include <core/templates/Mask.hpp>
34 
36 
46 enum class InputDeviceState {
47  Connected,
49  Unknown
50 };
51 
56 enum class InputAction : uint32 {
58  Press = 0,
60  Release = 1,
62  Repeat = 2,
64  Move = 3,
66  Text = 4,
68  State = 5,
70  Unknown = 0xffffffff
71 };
72 
77 enum class InputModifier : uint32 {
78  Shift = 0,
79  Alt = 1,
80  Control = 2,
81  CapsLock = 3,
82  NumLock = 4
83 };
84 
90 
95 enum class InputMouseButton : uint32 {
96  Left = 0,
97  Right = 1,
98  Unknown = 0xffffffff
99 };
100 
105 enum class InputKeyboardKey : uint32 {
106  Space = 0,
107  Apostrophe = 1, /* ' */
108  Comma = 2, /* , */
109  Minus = 3, /* - */
110  Period = 4, /* . */
111  Slash = 5, /* / */
112  BackSlash = 6, /* \ */
113  Semicolon = 7, /* ; */
114  Equal = 8, /* = */
115  LeftBracket = 9, /* [ */
116  RightBracket = 10, /* ] */
117  Num0 = 11,
118  Num1 = 12,
119  Num2 = 13,
120  Num3 = 14,
121  Num4 = 15,
122  Num5 = 16,
123  Num6 = 17,
124  Num7 = 18,
125  Num8 = 19,
126  Num9 = 20,
127  A = 21,
128  B = 22,
129  C = 23,
130  D = 24,
131  E = 25,
132  F = 26,
133  G = 27,
134  H = 28,
135  I = 29,
136  J = 30,
137  K = 31,
138  L = 32,
139  M = 33,
140  N = 34,
141  O = 35,
142  P = 36,
143  Q = 37,
144  R = 38,
145  S = 39,
146  T = 44,
147  U = 41,
148  V = 42,
149  W = 43,
150  X = 44,
151  Y = 45,
152  Z = 46,
153  Escape = 47,
154  Enter = 48,
155  Tab = 49,
156  Backspace = 50,
157  Insert = 51,
158  Delete = 52,
159  Right = 53,
160  Left = 54,
161  Down = 55,
162  Up = 56,
163  PageUp = 57,
164  PageDown = 58,
165  Home = 59,
166  End = 60,
167  CapsLock = 61,
168  ScrollLock = 62,
169  NumLock = 63,
170  PrintScreen = 64,
171  Pause = 65,
172  LeftShift = 66,
173  LeftControl = 67,
174  LeftAlt = 68,
175  LeftSuper = 69,
176  RightShift = 70,
177  RightControl = 71,
178  RightAlt = 72,
179  RightSuper = 73,
180  Menu = 74,
181  F1 = 81,
182  F2 = 82,
183  F3 = 83,
184  F4 = 84,
185  F5 = 85,
186  F6 = 86,
187  F7 = 87,
188  F8 = 88,
189  F9 = 89,
190  F10 = 80,
191  F11 = 91,
192  F12 = 92,
193  Unknown = 0xffffffff
194 };
195 
201  Button0 = 0,
202  Button1 = 1,
203  Button2 = 2,
204  Button3 = 3,
205  Button4 = 4,
206  Button5 = 5,
207  Button6 = 6,
208  Button7 = 7,
209  Button8 = 8,
210  Button9 = 9,
211  Button10 = 10,
212  Button11 = 11,
213  Button12 = 12,
214  Button13 = 13,
215  Button14 = 14,
216  Button15 = 15,
217  Button16 = 16,
218  Button17 = 17,
219  Unknown = 0xffffffff
220 };
221 
226 enum class InputJoystickAxis : uint32 {
227  Axis0 = 0,
228  Axis1 = 1,
229  Axis2 = 2,
230  Axis3 = 3,
231  Axis4 = 4,
232  Axis5 = 5,
233  Unknown = 0xffffffff
234 };
235 
241 
242 #endif//BERSERK_INPUTDEFS_HPP
#define BRK_NS_END
Definition: Config.hpp:48
std::uint32_t uint32
Definition: Typedefs.hpp:44
Default actions, which occur for basic input device interaction.
State of the input device (used primary for joysticks)
Joystick axis id.
Joystick button name.
Keyboard device keys.
Special keys modifiers (used as bit-vector)
Input modifies mask (as a set of bits)
Mouse device buttons.
Definition: GLDevice.cpp:46