CSFML

- Main Page
- Related Pages
- Classes
- Files

- File List
- File Members

Keyboard.h
1
2//
3// SFML - Simple and Fast Multimedia Library
4// Copyright (C) 2007-2023 Laurent Gomila (laurent@sfml-dev.org)
5//
6// This software is provided 'as-is', without any express or implied warranty.
7// In no event will the authors be held liable for any damages arising from the use of this software.
8//
9// Permission is granted to anyone to use this software for any purpose,
10// including commercial applications, and to alter it and redistribute it freely,
11// subject to the following restrictions:
12//
13// 1. The origin of this software must not be misrepresented;
14// you must not claim that you wrote the original software.
15// If you use this software in a product, an acknowledgment
16// in the product documentation would be appreciated but is not required.
17//
18// 2. Altered source versions must be plainly marked as such,
19// and must not be misrepresented as being the original software.
20//
21// 3. This notice may not be removed or altered from any source distribution.
22//
24
25#ifndef SFML_KEYBOARD_H
26#define SFML_KEYBOARD_H
27
29// Headers
31#include <SFML/Window/Export.h>
32
33
42 typedef enum
43{
44 sfKeyUnknown = -1,
45 sfKeyA,
46 sfKeyB,
47 sfKeyC,
48 sfKeyD,
49 sfKeyE,
50 sfKeyF,
51 sfKeyG,
52 sfKeyH,
53 sfKeyI,
54 sfKeyJ,
55 sfKeyK,
56 sfKeyL,
57 sfKeyM,
58 sfKeyN,
59 sfKeyO,
60 sfKeyP,
61 sfKeyQ,
62 sfKeyR,
63 sfKeyS,
64 sfKeyT,
65 sfKeyU,
66 sfKeyV,
67 sfKeyW,
68 sfKeyX,
69 sfKeyY,
70 sfKeyZ,
71 sfKeyNum0,
72 sfKeyNum1,
73 sfKeyNum2,
74 sfKeyNum3,
75 sfKeyNum4,
76 sfKeyNum5,
77 sfKeyNum6,
78 sfKeyNum7,
79 sfKeyNum8,
80 sfKeyNum9,
81 sfKeyEscape,
82 sfKeyLControl,
83 sfKeyLShift,
84 sfKeyLAlt,
85 sfKeyLSystem,
86 sfKeyRControl,
87 sfKeyRShift,
88 sfKeyRAlt,
89 sfKeyRSystem,
90 sfKeyMenu,
91 sfKeyLBracket,
92 sfKeyRBracket,
93 sfKeySemicolon,
94 sfKeyComma,
95 sfKeyPeriod,
96 sfKeyApostrophe,
97 sfKeySlash,
98 sfKeyBackslash,
99 sfKeyGrave,
100 sfKeyEqual,
101 sfKeyHyphen,
102 sfKeySpace,
103 sfKeyEnter,
104 sfKeyBackspace,
105 sfKeyTab,
106 sfKeyPageUp,
107 sfKeyPageDown,
108 sfKeyEnd,
109 sfKeyHome,
110 sfKeyInsert,
111 sfKeyDelete,
112 sfKeyAdd,
113 sfKeySubtract,
114 sfKeyMultiply,
115 sfKeyDivide,
116 sfKeyLeft,
117 sfKeyRight,
118 sfKeyUp,
119 sfKeyDown,
120 sfKeyNumpad0,
121 sfKeyNumpad1,
122 sfKeyNumpad2,
123 sfKeyNumpad3,
124 sfKeyNumpad4,
125 sfKeyNumpad5,
126 sfKeyNumpad6,
127 sfKeyNumpad7,
128 sfKeyNumpad8,
129 sfKeyNumpad9,
130 sfKeyF1,
131 sfKeyF2,
132 sfKeyF3,
133 sfKeyF4,
134 sfKeyF5,
135 sfKeyF6,
136 sfKeyF7,
137 sfKeyF8,
138 sfKeyF9,
139 sfKeyF10,
140 sfKeyF11,
141 sfKeyF12,
142 sfKeyF13,
143 sfKeyF14,
144 sfKeyF15,
145 sfKeyPause,
146
147 sfKeyCount,
148
149 // Deprecated values:
150
151 sfKeyTilde = sfKeyGrave,
152 sfKeyDash = sfKeyHyphen,
153 sfKeyBack = sfKeyBackspace,
154 sfKeyBackSlash = sfKeyBackslash,
155 sfKeySemiColon = sfKeySemicolon,
156 sfKeyReturn = sfKeyEnter,
157 sfKeyQuote = sfKeyApostrophe
158} sfKeyCode;
159
160
169 typedef enum
170{
171 sfScanUnknown = -1,
172 sfScanA = 0,
173 sfScanB,
174 sfScanC,
175 sfScanD,
176 sfScanE,
177 sfScanF,
178 sfScanG,
179 sfScanH,
180 sfScanI,
181 sfScanJ,
182 sfScanK,
183 sfScanL,
184 sfScanM,
185 sfScanN,
186 sfScanO,
187 sfScanP,
188 sfScanQ,
189 sfScanR,
190 sfScanS,
191 sfScanT,
192 sfScanU,
193 sfScanV,
194 sfScanW,
195 sfScanX,
196 sfScanY,
197 sfScanZ,
198 sfScanNum1,
199 sfScanNum2,
200 sfScanNum3,
201 sfScanNum4,
202 sfScanNum5,
203 sfScanNum6,
204 sfScanNum7,
205 sfScanNum8,
206 sfScanNum9,
207 sfScanNum0,
208 sfScanEnter,
209 sfScanEscape,
210 sfScanBackspace,
211 sfScanTab,
212 sfScanSpace,
213 sfScanHyphen,
214 sfScanEqual,
215 sfScanLBracket,
216 sfScanRBracket,
217 // For US keyboards mapped to key 29 (Microsoft Keyboard Scan Code Specification)
218 // For Non-US keyboards mapped to key 42 (Microsoft Keyboard Scan Code Specification)
219 // Typical language mappings: Belg:£µ` FrCa:<>} Dan:*' Dutch:`´ Fren:µ* Ger:'# Ital:§ù LatAm:[}` Nor:*@ Span:ç} Swed:*' Swiss:$£} UK:~# Brazil:}]
220 sfScanBackslash,
221 sfScanSemicolon,
222 sfScanApostrophe,
223 sfScanGrave,
224 sfScanComma,
225 sfScanPeriod,
226 sfScanSlash,
227 sfScanF1,
228 sfScanF2,
229 sfScanF3,
230 sfScanF4,
231 sfScanF5,
232 sfScanF6,
233 sfScanF7,
234 sfScanF8,
235 sfScanF9,
236 sfScanF10,
237 sfScanF11,
238 sfScanF12,
239 sfScanF13,
240 sfScanF14,
241 sfScanF15,
242 sfScanF16,
243 sfScanF17,
244 sfScanF18,
245 sfScanF19,
246 sfScanF20,
247 sfScanF21,
248 sfScanF22,
249 sfScanF23,
250 sfScanF24,
251 sfScanCapsLock,
252 sfScanPrintScreen,
253 sfScanScrollLock,
254 sfScanPause,
255 sfScanInsert,
256 sfScanHome,
257 sfScanPageUp,
258 sfScanDelete,
259 sfScanEnd,
260 sfScanPageDown,
261 sfScanRight,
262 sfScanLeft,
263 sfScanDown,
264 sfScanUp,
265 sfScanNumLock,
266 sfScanNumpadDivide,
267 sfScanNumpadMultiply,
268 sfScanNumpadMinus,
269 sfScanNumpadPlus,
270 sfScanNumpadEqual,
271 sfScanNumpadEnter,
272 sfScanNumpadDecimal,
273 sfScanNumpad1,
274 sfScanNumpad2,
275 sfScanNumpad3,
276 sfScanNumpad4,
277 sfScanNumpad5,
278 sfScanNumpad6,
279 sfScanNumpad7,
280 sfScanNumpad8,
281 sfScanNumpad9,
282 sfScanNumpad0,
283 // For US keyboards doesn't exist
284 // For Non-US keyboards mapped to key 45 (Microsoft Keyboard Scan Code Specification)
285 // Typical language mappings: Belg:<> FrCa:«°» Dan:<> Dutch:]|[ Fren:<> Ger:<|> Ital:<> LatAm:<> Nor:<> Span:<> Swed:<|> Swiss:<> UK:\| Brazil: \|.
286 sfScanNonUsBackslash,
287 sfScanApplication,
288 sfScanExecute,
289 sfScanModeChange,
290 sfScanHelp,
291 sfScanMenu,
292 sfScanSelect,
293 sfScanRedo,
294 sfScanUndo,
295 sfScanCut,
296 sfScanCopy,
297 sfScanPaste,
298 sfScanVolumeMute,
299 sfScanVolumeUp,
300 sfScanVolumeDown,
301 sfScanMediaPlayPause,
302 sfScanMediaStop,
303 sfScanMediaNextTrack,
304 sfScanMediaPreviousTrack,
305 sfScanLControl,
306 sfScanLShift,
307 sfScanLAlt,
308 sfScanLSystem,
309 sfScanRControl,
310 sfScanRShift,
311 sfScanRAlt,
312 sfScanRSystem,
313 sfScanBack,
314 sfScanForward,
315 sfScanRefresh,
316 sfScanStop,
317 sfScanSearch,
318 sfScanFavorites,
319 sfScanHomePage,
320 sfScanLaunchApplication1,
321 sfScanLaunchApplication2,
322 sfScanLaunchMail,
323 sfScanLaunchMediaSelect,
324
325 sfScancodeCount
326} sfScancode;
327
328
339CSFML_WINDOW_API sfBool sfKeyboard_isKeyPressed(sfKeyCode key);
340
351CSFML_WINDOW_API sfBool sfKeyboard_isScancodePressed(sfScancode code);
352
366CSFML_WINDOW_API sfKeyCode sfKeyboard_localize(sfScancode code);
367
381CSFML_WINDOW_API sfScancode sfKeyboard_delocalize(sfKeyCode key);
382
407CSFML_WINDOW_API const char* sfKeyboard_getDescription(sfScancode code);
408
421CSFML_WINDOW_API void sfKeyboard_setVirtualKeyboardVisible(sfBool visible);
422
423#endif // SFML_KEYBOARD_H