Raito 0.1
Loading...
Searching...
No Matches
KeyCodes.h
Go to the documentation of this file.
1/*
2MIT License
3
4Copyright (c) 2023 Víctor Falcón Zaro
5
6Permission is hereby granted, free of charge, to any person obtaining a copy
7of this software and associated documentation files (the "Software"), to deal
8in the Software without restriction, including without limitation the rights
9to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10copies of the Software, and to permit persons to whom the Software is
11furnished to do so, subject to the following conditions:
12
13The above copyright notice and this permission notice shall be included in all
14copies or substantial portions of the Software.
15
16THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22SOFTWARE.
23*/
24
25#pragma once
26
27namespace Raito
28{
29 typedef enum class KeyCode : uint16_t
30 {
31 // From glfw3.h
32 Space = 32,
33 Apostrophe = 39, /* ' */
34 Comma = 44, /* , */
35 Minus = 45, /* - */
36 Period = 46, /* . */
37 Slash = 47, /* / */
38
39 D0 = 48, /* 0 */
40 D1 = 49, /* 1 */
41 D2 = 50, /* 2 */
42 D3 = 51, /* 3 */
43 D4 = 52, /* 4 */
44 D5 = 53, /* 5 */
45 D6 = 54, /* 6 */
46 D7 = 55, /* 7 */
47 D8 = 56, /* 8 */
48 D9 = 57, /* 9 */
49
50 Semicolon = 59, /* ; */
51 Equal = 61, /* = */
52
53 A = 65,
54 B = 66,
55 C = 67,
56 D = 68,
57 E = 69,
58 F = 70,
59 G = 71,
60 H = 72,
61 I = 73,
62 J = 74,
63 K = 75,
64 L = 76,
65 M = 77,
66 N = 78,
67 O = 79,
68 P = 80,
69 Q = 81,
70 R = 82,
71 S = 83,
72 T = 84,
73 U = 85,
74 V = 86,
75 W = 87,
76 X = 88,
77 Y = 89,
78 Z = 90,
79
80 LeftBracket = 91, /* [ */
81 Backslash = 92, /* \ */
82 RightBracket = 93, /* ] */
83 GraveAccent = 96, /* ` */
84
85 World1 = 161, /* non-US #1 */
86 World2 = 162, /* non-US #2 */
87
88 /* Function keys */
89 Escape = 256,
90 Enter = 257,
91 Tab = 258,
92 Backspace = 259,
93 Insert = 260,
94 Delete = 261,
95 Right = 262,
96 Left = 263,
97 Down = 264,
98 Up = 265,
99 PageUp = 266,
100 PageDown = 267,
101 Home = 268,
102 End = 269,
103 CapsLock = 280,
104 ScrollLock = 281,
105 NumLock = 282,
106 PrintScreen = 283,
107 Pause = 284,
108 F1 = 290,
109 F2 = 291,
110 F3 = 292,
111 F4 = 293,
112 F5 = 294,
113 F6 = 295,
114 F7 = 296,
115 F8 = 297,
116 F9 = 298,
117 F10 = 299,
118 F11 = 300,
119 F12 = 301,
120 F13 = 302,
121 F14 = 303,
122 F15 = 304,
123 F16 = 305,
124 F17 = 306,
125 F18 = 307,
126 F19 = 308,
127 F20 = 309,
128 F21 = 310,
129 F22 = 311,
130 F23 = 312,
131 F24 = 313,
132 F25 = 314,
133
134 /* Keypad */
135 KP0 = 320,
136 KP1 = 321,
137 KP2 = 322,
138 KP3 = 323,
139 KP4 = 324,
140 KP5 = 325,
141 KP6 = 326,
142 KP7 = 327,
143 KP8 = 328,
144 KP9 = 329,
145 KPDecimal = 330,
146 KPDivide = 331,
147 KPMultiply = 332,
148 KPSubtract = 333,
149 KPAdd = 334,
150 KPEnter = 335,
151 KPEqual = 336,
152
153 LeftShift = 340,
154 LeftControl = 341,
155 LeftAlt = 342,
156 LeftSuper = 343,
157 RightShift = 344,
158 RightControl = 345,
159 RightAlt = 346,
160 RightSuper = 347,
161 Menu = 348
163
164 enum class KeyState
165 {
166 None = -1,
167 Pressed,
168 Held,
170 };
171
172 enum class CursorMode
173 {
174 Normal = 0,
175 Hidden = 1,
176 Locked = 2
177 };
178
179 typedef enum class MouseButton : uint16_t
180 {
181 Button0 = 0,
182 Button1 = 1,
183 Button2 = 2,
184 Button3 = 3,
185 Button4 = 4,
186 Button5 = 5,
187 Left = Button0,
188 Right = Button1,
191
192
193 inline std::ostream& operator<<(std::ostream& os, KeyCode keyCode)
194 {
195 os << static_cast<int32_t>(keyCode);
196 return os;
197 }
198
199 inline std::ostream& operator<<(std::ostream& os, MouseButton button)
200 {
201 os << static_cast<int32_t>(button);
202 return os;
203 }
204}
Definition AssetImport.cpp:47
MouseButton
Definition KeyCodes.h:180
std::ostream & operator<<(std::ostream &os, KeyCode keyCode)
Definition KeyCodes.h:193
CursorMode
Definition KeyCodes.h:173
enum Raito::KeyCode Key
enum Raito::MouseButton Button
KeyCode
Definition KeyCodes.h:30
KeyState
Definition KeyCodes.h:165