annotate src/video/x11/SDL_x11keyboard.c @ 2811:7af2419ad5b0

Fixed the list of supported YUV formats
author Sam Lantinga <slouken@libsdl.org>
date Sun, 30 Nov 2008 23:42:33 +0000
parents 4ac07ae446d3
children 620a91b6d263
rev   line source
1950
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1 /*
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
2 SDL - Simple DirectMedia Layer
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
3 Copyright (C) 1997-2006 Sam Lantinga
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
4
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
5 This library is free software; you can redistribute it and/or
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
6 modify it under the terms of the GNU Lesser General Public
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
7 License as published by the Free Software Foundation; either
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
8 version 2.1 of the License, or (at your option) any later version.
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
9
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
10 This library is distributed in the hope that it will be useful,
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
13 Lesser General Public License for more details.
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
14
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
15 You should have received a copy of the GNU Lesser General Public
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
16 License along with this library; if not, write to the Free Software
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
18
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
19 Sam Lantinga
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
20 slouken@libsdl.org
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
21 */
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
22 #include "SDL_config.h"
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
23
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
24 #include "SDL_x11video.h"
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
25
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
26 #include "../../events/SDL_keyboard_c.h"
2305
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
27 #include "../../events/scancodes_darwin.h"
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
28 #include "../../events/scancodes_xfree86.h"
1950
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
29
2295
dbc6d1893869 Checking in Christian Walther's patch for x11 keyboard input. Minor code tweaks by Bob.
Bob Pendleton <bob@pendleton.com>
parents: 1950
diff changeset
30 #include <X11/keysym.h>
dbc6d1893869 Checking in Christian Walther's patch for x11 keyboard input. Minor code tweaks by Bob.
Bob Pendleton <bob@pendleton.com>
parents: 1950
diff changeset
31
dbc6d1893869 Checking in Christian Walther's patch for x11 keyboard input. Minor code tweaks by Bob.
Bob Pendleton <bob@pendleton.com>
parents: 1950
diff changeset
32 #include "imKStoUCS.h"
dbc6d1893869 Checking in Christian Walther's patch for x11 keyboard input. Minor code tweaks by Bob.
Bob Pendleton <bob@pendleton.com>
parents: 1950
diff changeset
33
2305
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
34 static KeySym XKeySymTable[SDL_NUM_SCANCODES] = {
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
35 0, 0, 0, 0,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
36 XK_a,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
37 XK_b,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
38 XK_c,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
39 XK_d,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
40 XK_e,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
41 XK_f,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
42 XK_g,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
43 XK_h,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
44 XK_i,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
45 XK_j,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
46 XK_k,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
47 XK_l,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
48 XK_m,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
49 XK_n,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
50 XK_o,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
51 XK_p,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
52 XK_q,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
53 XK_r,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
54 XK_s,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
55 XK_t,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
56 XK_u,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
57 XK_v,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
58 XK_w,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
59 XK_x,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
60 XK_y,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
61 XK_z,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
62 XK_1,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
63 XK_2,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
64 XK_3,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
65 XK_4,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
66 XK_5,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
67 XK_6,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
68 XK_7,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
69 XK_8,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
70 XK_9,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
71 XK_0,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
72 XK_Return,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
73 XK_Escape,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
74 XK_BackSpace,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
75 XK_Tab,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
76 XK_space,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
77 XK_minus,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
78 XK_equal,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
79 XK_bracketleft,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
80 XK_bracketright,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
81 XK_backslash,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
82 0, /* SDL_SCANCODE_NONUSHASH ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
83 XK_semicolon,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
84 XK_apostrophe,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
85 XK_grave,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
86 XK_comma,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
87 XK_period,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
88 XK_slash,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
89 XK_Caps_Lock,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
90 XK_F1,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
91 XK_F2,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
92 XK_F3,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
93 XK_F4,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
94 XK_F5,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
95 XK_F6,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
96 XK_F7,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
97 XK_F8,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
98 XK_F9,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
99 XK_F10,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
100 XK_F11,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
101 XK_F12,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
102 XK_Print,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
103 XK_Scroll_Lock,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
104 XK_Pause,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
105 XK_Insert,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
106 XK_Home,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
107 XK_Prior,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
108 XK_Delete,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
109 XK_End,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
110 XK_Next,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
111 XK_Right,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
112 XK_Left,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
113 XK_Down,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
114 XK_Up,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
115 XK_Num_Lock,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
116 XK_KP_Divide,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
117 XK_KP_Multiply,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
118 XK_KP_Subtract,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
119 XK_KP_Add,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
120 XK_KP_Enter,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
121 XK_KP_1,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
122 XK_KP_2,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
123 XK_KP_3,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
124 XK_KP_4,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
125 XK_KP_5,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
126 XK_KP_6,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
127 XK_KP_7,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
128 XK_KP_8,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
129 XK_KP_9,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
130 XK_KP_0,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
131 XK_KP_Decimal,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
132 0, /* SDL_SCANCODE_NONUSBACKSLASH ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
133 XK_Hyper_R,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
134 0, /* SDL_SCANCODE_POWER ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
135 XK_KP_Equal,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
136 XK_F13,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
137 XK_F14,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
138 XK_F15,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
139 XK_F16,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
140 XK_F17,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
141 XK_F18,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
142 XK_F19,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
143 XK_F20,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
144 XK_F21,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
145 XK_F22,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
146 XK_F23,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
147 XK_F24,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
148 XK_Execute,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
149 XK_Help,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
150 XK_Menu,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
151 XK_Select,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
152 XK_Cancel,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
153 XK_Redo,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
154 XK_Undo,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
155 0, /* SDL_SCANCODE_CUT ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
156 0, /* SDL_SCANCODE_COPY ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
157 0, /* SDL_SCANCODE_PASTE ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
158 XK_Find,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
159 0, /* SDL_SCANCODE_MUTE ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
160 0, /* SDL_SCANCODE_VOLUMEUP ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
161 0, /* SDL_SCANCODE_VOLUMEDOWN ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
162 0, 0, 0,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
163 XK_KP_Separator,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
164 0, /* SDL_SCANCODE_KP_EQUALSAS400 ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
165 0, /* SDL_SCANCODE_INTERNATIONAL1 ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
166 0, /* SDL_SCANCODE_INTERNATIONAL2 ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
167 0, /* SDL_SCANCODE_INTERNATIONAL3 ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
168 0, /* SDL_SCANCODE_INTERNATIONAL4 ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
169 0, /* SDL_SCANCODE_INTERNATIONAL5 ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
170 0, /* SDL_SCANCODE_INTERNATIONAL6 ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
171 0, /* SDL_SCANCODE_INTERNATIONAL7 ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
172 0, /* SDL_SCANCODE_INTERNATIONAL8 ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
173 0, /* SDL_SCANCODE_INTERNATIONAL9 ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
174 0, /* SDL_SCANCODE_LANG1 ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
175 0, /* SDL_SCANCODE_LANG2 ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
176 0, /* SDL_SCANCODE_LANG3 ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
177 0, /* SDL_SCANCODE_LANG4 ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
178 0, /* SDL_SCANCODE_LANG5 ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
179 0, /* SDL_SCANCODE_LANG6 ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
180 0, /* SDL_SCANCODE_LANG7 ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
181 0, /* SDL_SCANCODE_LANG8 ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
182 0, /* SDL_SCANCODE_LANG9 ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
183 0, /* SDL_SCANCODE_ALTERASE ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
184 XK_Sys_Req,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
185 0, /* SDL_SCANCODE_CANCEL ? - XK_Cancel was used above... */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
186 0, /* SDL_SCANCODE_CLEAR ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
187 0, /* SDL_SCANCODE_PRIOR ? - XK_Prior was used above... */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
188 0, /* SDL_SCANCODE_RETURN2 ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
189 0, /* SDL_SCANCODE_SEPARATOR ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
190 0, /* SDL_SCANCODE_OUT ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
191 0, /* SDL_SCANCODE_OPER ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
192 0, /* SDL_SCANCODE_CLEARAGAIN ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
193 0, /* SDL_SCANCODE_CRSEL ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
194 0, /* SDL_SCANCODE_EXSEL ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
195 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
196 0, /* SDL_SCANCODE_KP_00 ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
197 0, /* SDL_SCANCODE_KP_000 ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
198 0, /* SDL_SCANCODE_THOUSANDSSEPARATOR ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
199 0, /* SDL_SCANCODE_DECIMALSEPARATOR ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
200 0, /* SDL_SCANCODE_CURRENCYUNIT ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
201 0, /* SDL_SCANCODE_CURRENCYSUBUNIT ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
202 0, /* SDL_SCANCODE_KP_LEFTPAREN ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
203 0, /* SDL_SCANCODE_KP_RIGHTPAREN ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
204 0, /* SDL_SCANCODE_KP_LEFTBRACE ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
205 0, /* SDL_SCANCODE_KP_RIGHTBRACE ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
206 0, /* SDL_SCANCODE_KP_TAB ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
207 0, /* SDL_SCANCODE_KP_BACKSPACE ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
208 0, /* SDL_SCANCODE_KP_A ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
209 0, /* SDL_SCANCODE_KP_B ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
210 0, /* SDL_SCANCODE_KP_C ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
211 0, /* SDL_SCANCODE_KP_D ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
212 0, /* SDL_SCANCODE_KP_E ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
213 0, /* SDL_SCANCODE_KP_F ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
214 0, /* SDL_SCANCODE_KP_XOR ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
215 0, /* SDL_SCANCODE_KP_POWER ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
216 0, /* SDL_SCANCODE_KP_PERCENT ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
217 0, /* SDL_SCANCODE_KP_LESS ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
218 0, /* SDL_SCANCODE_KP_GREATER ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
219 0, /* SDL_SCANCODE_KP_AMPERSAND ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
220 0, /* SDL_SCANCODE_KP_DBLAMPERSAND ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
221 0, /* SDL_SCANCODE_KP_VERTICALBAR ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
222 0, /* SDL_SCANCODE_KP_DBLVERTICALBAR ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
223 0, /* SDL_SCANCODE_KP_COLON ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
224 0, /* SDL_SCANCODE_KP_HASH ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
225 0, /* SDL_SCANCODE_KP_SPACE ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
226 0, /* SDL_SCANCODE_KP_AT ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
227 0, /* SDL_SCANCODE_KP_EXCLAM ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
228 0, /* SDL_SCANCODE_KP_MEMSTORE ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
229 0, /* SDL_SCANCODE_KP_MEMRECALL ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
230 0, /* SDL_SCANCODE_KP_MEMCLEAR ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
231 0, /* SDL_SCANCODE_KP_MEMADD ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
232 0, /* SDL_SCANCODE_KP_MEMSUBTRACT ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
233 0, /* SDL_SCANCODE_KP_MEMMULTIPLY ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
234 0, /* SDL_SCANCODE_KP_MEMDIVIDE ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
235 0, /* SDL_SCANCODE_KP_PLUSMINUS ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
236 0, /* SDL_SCANCODE_KP_CLEAR ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
237 0, /* SDL_SCANCODE_KP_CLEARENTRY ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
238 0, /* SDL_SCANCODE_KP_BINARY ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
239 0, /* SDL_SCANCODE_KP_OCTAL ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
240 0, /* SDL_SCANCODE_KP_DECIMAL ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
241 0, /* SDL_SCANCODE_KP_HEXADECIMAL ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
242 0, 0,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
243 XK_Control_L,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
244 XK_Shift_L,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
245 XK_Alt_L,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
246 XK_Meta_L,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
247 XK_Control_R,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
248 XK_Shift_R,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
249 XK_Alt_R,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
250 XK_Meta_R,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
251 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
252 XK_Mode_switch /*XK_ISO_Level3_Shift */ ,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
253 0, /* SDL_SCANCODE_AUDIONEXT ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
254 0, /* SDL_SCANCODE_AUDIOPREV ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
255 0, /* SDL_SCANCODE_AUDIOSTOP ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
256 0, /* SDL_SCANCODE_AUDIOPLAY ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
257 0, /* SDL_SCANCODE_AUDIOMUTE ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
258 0, /* SDL_SCANCODE_MEDIASELECT ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
259 0, /* SDL_SCANCODE_WWW ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
260 0, /* SDL_SCANCODE_MAIL ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
261 0, /* SDL_SCANCODE_CALCULATOR ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
262 0, /* SDL_SCANCODE_COMPUTER ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
263 0, /* SDL_SCANCODE_AC_SEARCH ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
264 0, /* SDL_SCANCODE_AC_HOME ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
265 0, /* SDL_SCANCODE_AC_BACK ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
266 0, /* SDL_SCANCODE_AC_FORWARD ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
267 0, /* SDL_SCANCODE_AC_STOP ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
268 0, /* SDL_SCANCODE_AC_REFRESH ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
269 0, /* SDL_SCANCODE_AC_BOOKMARKS ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
270 0, /* SDL_SCANCODE_BRIGHTNESSDOWN ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
271 0, /* SDL_SCANCODE_BRIGHTNESSUP ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
272 0, /* SDL_SCANCODE_DISPLAYSWITCH ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
273 0, /* SDL_SCANCODE_KBDILLUMTOGGLE ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
274 0, /* SDL_SCANCODE_KBDILLUMDOWN ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
275 0, /* SDL_SCANCODE_KBDILLUMUP ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
276 0, /* SDL_SCANCODE_EJECT ? */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
277 0, /* SDL_SCANCODE_SLEEP ? */
2295
dbc6d1893869 Checking in Christian Walther's patch for x11 keyboard input. Minor code tweaks by Bob.
Bob Pendleton <bob@pendleton.com>
parents: 1950
diff changeset
278 };
dbc6d1893869 Checking in Christian Walther's patch for x11 keyboard input. Minor code tweaks by Bob.
Bob Pendleton <bob@pendleton.com>
parents: 1950
diff changeset
279
2308
514f7c1651fc Untested Win32 keyboard scancode code.
Sam Lantinga <slouken@libsdl.org>
parents: 2306
diff changeset
280 /* *INDENT-OFF* */
2295
dbc6d1893869 Checking in Christian Walther's patch for x11 keyboard input. Minor code tweaks by Bob.
Bob Pendleton <bob@pendleton.com>
parents: 1950
diff changeset
281 static struct
dbc6d1893869 Checking in Christian Walther's patch for x11 keyboard input. Minor code tweaks by Bob.
Bob Pendleton <bob@pendleton.com>
parents: 1950
diff changeset
282 {
2305
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
283 SDL_scancode *table;
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
284 int table_size;
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
285 } scancode_set[] = {
2308
514f7c1651fc Untested Win32 keyboard scancode code.
Sam Lantinga <slouken@libsdl.org>
parents: 2306
diff changeset
286 { darwin_scancode_table, SDL_arraysize(darwin_scancode_table) },
514f7c1651fc Untested Win32 keyboard scancode code.
Sam Lantinga <slouken@libsdl.org>
parents: 2306
diff changeset
287 { xfree86_scancode_table, SDL_arraysize(xfree86_scancode_table) },
514f7c1651fc Untested Win32 keyboard scancode code.
Sam Lantinga <slouken@libsdl.org>
parents: 2306
diff changeset
288 };
514f7c1651fc Untested Win32 keyboard scancode code.
Sam Lantinga <slouken@libsdl.org>
parents: 2306
diff changeset
289 /* *INDENT-OFF* */
2295
dbc6d1893869 Checking in Christian Walther's patch for x11 keyboard input. Minor code tweaks by Bob.
Bob Pendleton <bob@pendleton.com>
parents: 1950
diff changeset
290
dbc6d1893869 Checking in Christian Walther's patch for x11 keyboard input. Minor code tweaks by Bob.
Bob Pendleton <bob@pendleton.com>
parents: 1950
diff changeset
291 int
1950
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
292 X11_InitKeyboard(_THIS)
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
293 {
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
294 SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
295 SDL_Keyboard keyboard;
2305
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
296 int i, j;
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
297 int min_keycode, max_keycode;
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
298 SDL_scancode fingerprint_scancodes[] = {
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
299 SDL_SCANCODE_HOME,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
300 SDL_SCANCODE_PAGEUP,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
301 SDL_SCANCODE_PAGEDOWN
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
302 };
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
303 int fingerprint[3];
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
304 SDL_bool fingerprint_detected;
2295
dbc6d1893869 Checking in Christian Walther's patch for x11 keyboard input. Minor code tweaks by Bob.
Bob Pendleton <bob@pendleton.com>
parents: 1950
diff changeset
305
2299
a7cbc25071b6 Enabled key board auto repeat in X11_InitKeyboard.c. Had to add a couple of new Xlib symbols.
Bob Pendleton <bob@pendleton.com>
parents: 2298
diff changeset
306 XAutoRepeatOn(data->display);
a7cbc25071b6 Enabled key board auto repeat in X11_InitKeyboard.c. Had to add a couple of new Xlib symbols.
Bob Pendleton <bob@pendleton.com>
parents: 2298
diff changeset
307
2305
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
308 /* Try to determine which scancodes are being used based on fingerprint */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
309 fingerprint_detected = SDL_FALSE;
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
310 XDisplayKeycodes(data->display, &min_keycode, &max_keycode);
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
311 for (i = 0; i < SDL_arraysize(fingerprint_scancodes); ++i) {
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
312 fingerprint[i] =
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
313 XKeysymToKeycode(data->display,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
314 XKeySymTable[fingerprint_scancodes[i]]) -
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
315 min_keycode;
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
316 }
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
317 for (i = 0; i < SDL_arraysize(scancode_set); ++i) {
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
318 /* Make sure the scancode set isn't too big */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
319 if ((max_keycode - min_keycode + 1) <= scancode_set[i].table_size) {
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
320 continue;
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
321 }
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
322 for (j = 0; j < SDL_arraysize(fingerprint); ++j) {
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
323 if (fingerprint[j] < 0
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
324 || fingerprint[j] >= scancode_set[i].table_size) {
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
325 break;
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
326 }
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
327 if (scancode_set[i].table[fingerprint[j]] !=
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
328 fingerprint_scancodes[j]) {
2295
dbc6d1893869 Checking in Christian Walther's patch for x11 keyboard input. Minor code tweaks by Bob.
Bob Pendleton <bob@pendleton.com>
parents: 1950
diff changeset
329 break;
dbc6d1893869 Checking in Christian Walther's patch for x11 keyboard input. Minor code tweaks by Bob.
Bob Pendleton <bob@pendleton.com>
parents: 1950
diff changeset
330 }
dbc6d1893869 Checking in Christian Walther's patch for x11 keyboard input. Minor code tweaks by Bob.
Bob Pendleton <bob@pendleton.com>
parents: 1950
diff changeset
331 }
2305
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
332 if (j == SDL_arraysize(fingerprint)) {
2323
4ac07ae446d3 Fixed many valgrind errors. But, I broke testdyngl.
Bob Pendleton <bob@pendleton.com>
parents: 2308
diff changeset
333 /* printf("Using scancode set %d\n", i); */
2305
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
334 SDL_memcpy(&data->key_layout[min_keycode], scancode_set[i].table,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
335 sizeof(SDL_scancode) * scancode_set[i].table_size);
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
336 fingerprint_detected = SDL_TRUE;
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
337 break;
2295
dbc6d1893869 Checking in Christian Walther's patch for x11 keyboard input. Minor code tweaks by Bob.
Bob Pendleton <bob@pendleton.com>
parents: 1950
diff changeset
338 }
dbc6d1893869 Checking in Christian Walther's patch for x11 keyboard input. Minor code tweaks by Bob.
Bob Pendleton <bob@pendleton.com>
parents: 1950
diff changeset
339 }
dbc6d1893869 Checking in Christian Walther's patch for x11 keyboard input. Minor code tweaks by Bob.
Bob Pendleton <bob@pendleton.com>
parents: 1950
diff changeset
340
2305
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
341 if (!fingerprint_detected) {
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
342 printf
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
343 ("Keyboard layout unknown, please send the following to the SDL mailing list (sdl@libsdl.org):\n");
2295
dbc6d1893869 Checking in Christian Walther's patch for x11 keyboard input. Minor code tweaks by Bob.
Bob Pendleton <bob@pendleton.com>
parents: 1950
diff changeset
344
2305
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
345 /* Determine key_layout - only works on US QWERTY layout */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
346 for (i = min_keycode; i <= max_keycode; ++i) {
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
347 KeySym sym;
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
348 sym = XKeycodeToKeysym(data->display, i, 0);
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
349 if (sym) {
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
350 printf("code = %d, sym = 0x%X (%s) ", i - min_keycode, sym,
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
351 XKeysymToString(sym));
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
352 for (j = 0; j < SDL_arraysize(XKeySymTable); ++j) {
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
353 if (XKeySymTable[j] == sym) {
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
354 data->key_layout[i] = (SDL_scancode) j;
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
355 break;
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
356 }
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
357 }
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
358 if (j == SDL_arraysize(XKeySymTable)) {
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
359 printf("scancode not found\n");
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
360 } else {
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
361 printf("scancode = %d (%s)\n", j, SDL_GetScancodeName(j));
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
362 }
2295
dbc6d1893869 Checking in Christian Walther's patch for x11 keyboard input. Minor code tweaks by Bob.
Bob Pendleton <bob@pendleton.com>
parents: 1950
diff changeset
363 }
dbc6d1893869 Checking in Christian Walther's patch for x11 keyboard input. Minor code tweaks by Bob.
Bob Pendleton <bob@pendleton.com>
parents: 1950
diff changeset
364 }
dbc6d1893869 Checking in Christian Walther's patch for x11 keyboard input. Minor code tweaks by Bob.
Bob Pendleton <bob@pendleton.com>
parents: 1950
diff changeset
365 }
2305
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
366
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
367 SDL_zero(keyboard);
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
368 data->keyboard = SDL_AddKeyboard(&keyboard, -1);
2306
1a8bab15a45d Fixed compile errors
Sam Lantinga <slouken@libsdl.org>
parents: 2305
diff changeset
369 X11_UpdateKeymap(_this);
2305
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
370
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
371 SDL_SetScancodeName(SDL_SCANCODE_APPLICATION, "Menu");
2295
dbc6d1893869 Checking in Christian Walther's patch for x11 keyboard input. Minor code tweaks by Bob.
Bob Pendleton <bob@pendleton.com>
parents: 1950
diff changeset
372
dbc6d1893869 Checking in Christian Walther's patch for x11 keyboard input. Minor code tweaks by Bob.
Bob Pendleton <bob@pendleton.com>
parents: 1950
diff changeset
373 return 0;
dbc6d1893869 Checking in Christian Walther's patch for x11 keyboard input. Minor code tweaks by Bob.
Bob Pendleton <bob@pendleton.com>
parents: 1950
diff changeset
374 }
dbc6d1893869 Checking in Christian Walther's patch for x11 keyboard input. Minor code tweaks by Bob.
Bob Pendleton <bob@pendleton.com>
parents: 1950
diff changeset
375
2305
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
376 void
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
377 X11_UpdateKeymap(_THIS)
2295
dbc6d1893869 Checking in Christian Walther's patch for x11 keyboard input. Minor code tweaks by Bob.
Bob Pendleton <bob@pendleton.com>
parents: 1950
diff changeset
378 {
dbc6d1893869 Checking in Christian Walther's patch for x11 keyboard input. Minor code tweaks by Bob.
Bob Pendleton <bob@pendleton.com>
parents: 1950
diff changeset
379 SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
2305
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
380 int i;
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
381 SDL_scancode scancode;
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
382 SDLKey keymap[SDL_NUM_SCANCODES];
2295
dbc6d1893869 Checking in Christian Walther's patch for x11 keyboard input. Minor code tweaks by Bob.
Bob Pendleton <bob@pendleton.com>
parents: 1950
diff changeset
383
2305
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
384 SDL_GetDefaultKeymap(keymap);
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
385
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
386 for (i = 0; i < SDL_arraysize(data->key_layout); i++) {
2295
dbc6d1893869 Checking in Christian Walther's patch for x11 keyboard input. Minor code tweaks by Bob.
Bob Pendleton <bob@pendleton.com>
parents: 1950
diff changeset
387
2305
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
388 /* Make sure this scancode is a valid character scancode */
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
389 scancode = data->key_layout[i];
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
390 if (scancode == SDL_SCANCODE_UNKNOWN ||
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
391 (keymap[scancode] & SDLK_SCANCODE_MASK)) {
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
392 continue;
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
393 }
2295
dbc6d1893869 Checking in Christian Walther's patch for x11 keyboard input. Minor code tweaks by Bob.
Bob Pendleton <bob@pendleton.com>
parents: 1950
diff changeset
394
2305
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
395 keymap[scancode] =
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
396 (SDLKey) X11_KeySymToUcs4(XKeycodeToKeysym(data->display, i, 0));
2295
dbc6d1893869 Checking in Christian Walther's patch for x11 keyboard input. Minor code tweaks by Bob.
Bob Pendleton <bob@pendleton.com>
parents: 1950
diff changeset
397 }
2305
fbe8ff44c519 First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents: 2299
diff changeset
398 SDL_SetKeymap(data->keyboard, 0, keymap, SDL_NUM_SCANCODES);
1950
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
399 }
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
400
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
401 void
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
402 X11_QuitKeyboard(_THIS)
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
403 {
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
404 SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
405
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
406 SDL_DelKeyboard(data->keyboard);
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
407 }
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
408
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
409 /* vi: set ts=4 sw=4 expandtab: */