Mercurial > sdl-ios-xcode
comparison src/video/cocoa/SDL_cocoakeys.h @ 1959:25d6537feea4
Implemented Cocoa key event handling.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 30 Jul 2006 05:18:33 +0000 |
parents | |
children | f419000e7596 |
comparison
equal
deleted
inserted
replaced
1958:5fc6fb0fb605 | 1959:25d6537feea4 |
---|---|
1 /* | |
2 SDL - Simple DirectMedia Layer | |
3 Copyright (C) 1997-2006 Sam Lantinga | |
4 | |
5 This library is free software; you can redistribute it and/or | |
6 modify it under the terms of the GNU Lesser General Public | |
7 License as published by the Free Software Foundation; either | |
8 version 2.1 of the License, or (at your option) any later version. | |
9 | |
10 This library is distributed in the hope that it will be useful, | |
11 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 Lesser General Public License for more details. | |
14 | |
15 You should have received a copy of the GNU Lesser General Public | |
16 License along with this library; if not, write to the Free Software | |
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
18 | |
19 Sam Lantinga | |
20 slouken@libsdl.org | |
21 */ | |
22 #include "SDL_config.h" | |
23 | |
24 /* These are the Macintosh key scancode constants -- from Inside Macintosh */ | |
25 | |
26 #define KEY_ESCAPE 0x35 | |
27 #define KEY_F1 0x7A | |
28 #define KEY_F2 0x78 | |
29 #define KEY_F3 0x63 | |
30 #define KEY_F4 0x76 | |
31 #define KEY_F5 0x60 | |
32 #define KEY_F6 0x61 | |
33 #define KEY_F7 0x62 | |
34 #define KEY_F8 0x64 | |
35 #define KEY_F9 0x65 | |
36 #define KEY_F10 0x6D | |
37 #define KEY_F11 0x67 | |
38 #define KEY_F12 0x6F | |
39 #define KEY_PRINT 0x69 | |
40 #define KEY_SCROLLOCK 0x6B | |
41 #define KEY_PAUSE 0x71 | |
42 #define KEY_POWER 0x7F | |
43 #define KEY_BACKQUOTE 0x32 | |
44 #define KEY_1 0x12 | |
45 #define KEY_2 0x13 | |
46 #define KEY_3 0x14 | |
47 #define KEY_4 0x15 | |
48 #define KEY_5 0x17 | |
49 #define KEY_6 0x16 | |
50 #define KEY_7 0x1A | |
51 #define KEY_8 0x1C | |
52 #define KEY_9 0x19 | |
53 #define KEY_0 0x1D | |
54 #define KEY_MINUS 0x1B | |
55 #define KEY_EQUALS 0x18 | |
56 #define KEY_BACKSPACE 0x33 | |
57 #define KEY_INSERT 0x72 | |
58 #define KEY_HOME 0x73 | |
59 #define KEY_PAGEUP 0x74 | |
60 #define KEY_NUMLOCK 0x47 | |
61 #define KEY_KP_EQUALS 0x51 | |
62 #define KEY_KP_DIVIDE 0x4B | |
63 #define KEY_KP_MULTIPLY 0x43 | |
64 #define KEY_TAB 0x30 | |
65 #define KEY_q 0x0C | |
66 #define KEY_w 0x0D | |
67 #define KEY_e 0x0E | |
68 #define KEY_r 0x0F | |
69 #define KEY_t 0x11 | |
70 #define KEY_y 0x10 | |
71 #define KEY_u 0x20 | |
72 #define KEY_i 0x22 | |
73 #define KEY_o 0x1F | |
74 #define KEY_p 0x23 | |
75 #define KEY_LEFTBRACKET 0x21 | |
76 #define KEY_RIGHTBRACKET 0x1E | |
77 #define KEY_BACKSLASH 0x2A | |
78 #define KEY_DELETE 0x75 | |
79 #define KEY_END 0x77 | |
80 #define KEY_PAGEDOWN 0x79 | |
81 #define KEY_KP7 0x59 | |
82 #define KEY_KP8 0x5B | |
83 #define KEY_KP9 0x5C | |
84 #define KEY_KP_MINUS 0x4E | |
85 #define KEY_CAPSLOCK 0x39 | |
86 #define KEY_a 0x00 | |
87 #define KEY_s 0x01 | |
88 #define KEY_d 0x02 | |
89 #define KEY_f 0x03 | |
90 #define KEY_g 0x05 | |
91 #define KEY_h 0x04 | |
92 #define KEY_j 0x26 | |
93 #define KEY_k 0x28 | |
94 #define KEY_l 0x25 | |
95 #define KEY_SEMICOLON 0x29 | |
96 #define KEY_QUOTE 0x27 | |
97 #define KEY_RETURN 0x24 | |
98 #define KEY_KP4 0x56 | |
99 #define KEY_KP5 0x57 | |
100 #define KEY_KP6 0x58 | |
101 #define KEY_KP_PLUS 0x45 | |
102 #define KEY_LSHIFT 0x38 | |
103 #define KEY_z 0x06 | |
104 #define KEY_x 0x07 | |
105 #define KEY_c 0x08 | |
106 #define KEY_v 0x09 | |
107 #define KEY_b 0x0B | |
108 #define KEY_n 0x2D | |
109 #define KEY_m 0x2E | |
110 #define KEY_COMMA 0x2B | |
111 #define KEY_PERIOD 0x2F | |
112 #define KEY_SLASH 0x2C | |
113 #if 1 /* Panther now defines right side keys */ | |
114 #define KEY_RSHIFT 0x3C | |
115 #endif | |
116 #define KEY_UP 0x7E | |
117 #define KEY_KP1 0x53 | |
118 #define KEY_KP2 0x54 | |
119 #define KEY_KP3 0x55 | |
120 #define KEY_KP_ENTER 0x4C | |
121 #define KEY_LCTRL 0x3B | |
122 #define KEY_LALT 0x3A | |
123 #define KEY_LMETA 0x37 | |
124 #define KEY_SPACE 0x31 | |
125 #if 1 /* Panther now defines right side keys */ | |
126 #define KEY_RMETA 0x36 | |
127 #define KEY_RALT 0x3D | |
128 #define KEY_RCTRL 0x3E | |
129 #endif | |
130 #define KEY_LEFT 0x7B | |
131 #define KEY_DOWN 0x7D | |
132 #define KEY_RIGHT 0x7C | |
133 #define KEY_KP0 0x52 | |
134 #define KEY_KP_PERIOD 0x41 | |
135 | |
136 /* Wierd, these keys are on my iBook under Mac OS X */ | |
137 #define KEY_IBOOK_ENTER 0x34 | |
138 #define KEY_IBOOK_LEFT 0x3B | |
139 #define KEY_IBOOK_RIGHT 0x3C | |
140 #define KEY_IBOOK_DOWN 0x3D | |
141 #define KEY_IBOOK_UP 0x3E |