arsa  2.7
SDL_keycode.h
Go to the documentation of this file.
1 /*
2  Simple DirectMedia Layer
3  Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
4 
5  This software is provided 'as-is', without any express or implied
6  warranty. In no event will the authors be held liable for any damages
7  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
11  freely, subject to the following restrictions:
12 
13  1. The origin of this software must not be misrepresented; you must not
14  claim that you wrote the original software. If you use this software
15  in a product, an acknowledgment in the product documentation would be
16  appreciated but is not required.
17  2. Altered source versions must be plainly marked as such, and must not be
18  misrepresented as being the original software.
19  3. This notice may not be removed or altered from any source distribution.
20 */
21 
28 #ifndef SDL_keycode_h_
29 #define SDL_keycode_h_
30 
31 #include "SDL_stdinc.h"
32 #include "SDL_scancode.h"
33 
46 
47 #define SDLK_SCANCODE_MASK (1<<30)
48 #define SDL_SCANCODE_TO_KEYCODE(X) (X | SDLK_SCANCODE_MASK)
49 
50 typedef enum
51 {
53 
54  SDLK_RETURN = '\r',
55  SDLK_ESCAPE = '\033',
57  SDLK_TAB = '\t',
58  SDLK_SPACE = ' ',
59  SDLK_EXCLAIM = '!',
61  SDLK_HASH = '#',
62  SDLK_PERCENT = '%',
63  SDLK_DOLLAR = '$',
65  SDLK_QUOTE = '\'',
69  SDLK_PLUS = '+',
70  SDLK_COMMA = ',',
71  SDLK_MINUS = '-',
72  SDLK_PERIOD = '.',
73  SDLK_SLASH = '/',
74  SDLK_0 = '0',
75  SDLK_1 = '1',
76  SDLK_2 = '2',
77  SDLK_3 = '3',
78  SDLK_4 = '4',
79  SDLK_5 = '5',
80  SDLK_6 = '6',
81  SDLK_7 = '7',
82  SDLK_8 = '8',
83  SDLK_9 = '9',
84  SDLK_COLON = ':',
86  SDLK_LESS = '<',
87  SDLK_EQUALS = '=',
88  SDLK_GREATER = '>',
90  SDLK_AT = '@',
91  /*
92  Skip uppercase letters
93  */
97  SDLK_CARET = '^',
100  SDLK_a = 'a',
101  SDLK_b = 'b',
102  SDLK_c = 'c',
103  SDLK_d = 'd',
104  SDLK_e = 'e',
105  SDLK_f = 'f',
106  SDLK_g = 'g',
107  SDLK_h = 'h',
108  SDLK_i = 'i',
109  SDLK_j = 'j',
110  SDLK_k = 'k',
111  SDLK_l = 'l',
112  SDLK_m = 'm',
113  SDLK_n = 'n',
114  SDLK_o = 'o',
115  SDLK_p = 'p',
116  SDLK_q = 'q',
117  SDLK_r = 'r',
118  SDLK_s = 's',
119  SDLK_t = 't',
120  SDLK_u = 'u',
121  SDLK_v = 'v',
122  SDLK_w = 'w',
123  SDLK_x = 'x',
124  SDLK_y = 'y',
125  SDLK_z = 'z',
126 
128 
141 
148  SDLK_DELETE = '\177',
155 
173 
206 
219 
275 
284 
286 
304 
317 
320 } SDL_KeyCode;
321 
325 typedef enum
326 {
327  KMOD_NONE = 0x0000,
328  KMOD_LSHIFT = 0x0001,
329  KMOD_RSHIFT = 0x0002,
330  KMOD_LCTRL = 0x0040,
331  KMOD_RCTRL = 0x0080,
332  KMOD_LALT = 0x0100,
333  KMOD_RALT = 0x0200,
334  KMOD_LGUI = 0x0400,
335  KMOD_RGUI = 0x0800,
336  KMOD_NUM = 0x1000,
337  KMOD_CAPS = 0x2000,
338  KMOD_MODE = 0x4000,
339  KMOD_RESERVED = 0x8000
340 } SDL_Keymod;
341 
342 #define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL)
343 #define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT)
344 #define KMOD_ALT (KMOD_LALT|KMOD_RALT)
345 #define KMOD_GUI (KMOD_LGUI|KMOD_RGUI)
346 
347 #endif /* SDL_keycode_h_ */
348 
349 /* vi: set ts=4 sw=4 expandtab: */
SDL_KeyCode
Definition: SDL_keycode.h:50
Sint32 SDL_Keycode
The SDL virtual key representation.
Definition: SDL_keycode.h:45
#define SDL_SCANCODE_TO_KEYCODE(X)
Definition: SDL_keycode.h:48
int32_t Sint32
Definition: SDL_stdinc.h:197
SDL_Keymod
Enumeration of valid key mods (possibly OR'd together).
Definition: SDL_keycode.h:325