Mercurial > sdl-ios-xcode
annotate src/video/x11/SDL_x11keyboard.c @ 2884:9dde605c7540
Date: Fri, 19 Dec 2008 20:17:35 +0100
From: Couriersud
Subject: Re: Aw: Experience using SDL1.3 in sdlmame/Proposal for api additions
> For consistency you'd probably want:
> SDL_SetRenderDrawColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a);
> SDL_SetRenderDrawBlendMode(SDL_BlendMode blendMode);
> SDL_RenderLine(int x1, int y1, int x2, int y2);
> SDL_RenderFill(SDL_Rect *rect);
>
> You probably also want to add API functions query the current state.
>
I have implemented the above api for the opengl, x11, directfb and
software renderers. I have also renamed *TEXTUREBLENDMODE* constants to
BLENDMODE*. The unix build compiles. The windows renderer still needs to
be updated, but I have no windows development machine at hand. Have a
look at the x11 renderer for a sample.
Vector games now run at 90% both on opengl and directfb in comparison to
sdlmame's own opengl renderer. The same applies to raster games.
The diff also includes
a) Changed XDrawRect to XFillRect in x11 renderer
b) A number of changes to fix blending and modulation issues in the
directfb renderer.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 20 Dec 2008 12:00:00 +0000 |
parents | 99210400e8b9 |
children | 7b031c55aebc |
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 |
2859 | 3 Copyright (C) 1997-2009 Sam Lantinga |
1950
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) }, |
2825
620a91b6d263
Date: Tue, 02 Dec 2008 23:38:26 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2323
diff
changeset
|
288 { xfree86_scancode_table2, SDL_arraysize(xfree86_scancode_table2) }, |
2308
514f7c1651fc
Untested Win32 keyboard scancode code.
Sam Lantinga <slouken@libsdl.org>
parents:
2306
diff
changeset
|
289 }; |
514f7c1651fc
Untested Win32 keyboard scancode code.
Sam Lantinga <slouken@libsdl.org>
parents:
2306
diff
changeset
|
290 /* *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
|
291 |
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
|
292 int |
1950
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
293 X11_InitKeyboard(_THIS) |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
294 { |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
295 SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
296 SDL_Keyboard keyboard; |
2305
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
297 int i, j; |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
298 int min_keycode, max_keycode; |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
299 SDL_scancode fingerprint_scancodes[] = { |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
300 SDL_SCANCODE_HOME, |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
301 SDL_SCANCODE_PAGEUP, |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
302 SDL_SCANCODE_PAGEDOWN |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
303 }; |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
304 int fingerprint[3]; |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
305 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
|
306 |
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
|
307 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
|
308 |
2305
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
309 /* 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
|
310 fingerprint_detected = SDL_FALSE; |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
311 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
|
312 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
|
313 fingerprint[i] = |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
314 XKeysymToKeycode(data->display, |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
315 XKeySymTable[fingerprint_scancodes[i]]) - |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
316 min_keycode; |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
317 } |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
318 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
|
319 /* 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
|
320 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
|
321 continue; |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
322 } |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
323 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
|
324 if (fingerprint[j] < 0 |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
325 || 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
|
326 break; |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
327 } |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
328 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
|
329 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
|
330 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
|
331 } |
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
|
332 } |
2305
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
333 if (j == SDL_arraysize(fingerprint)) { |
2323
4ac07ae446d3
Fixed many valgrind errors. But, I broke testdyngl.
Bob Pendleton <bob@pendleton.com>
parents:
2308
diff
changeset
|
334 /* 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
|
335 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
|
336 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
|
337 fingerprint_detected = SDL_TRUE; |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
338 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
|
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 } |
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
|
341 |
2305
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
342 if (!fingerprint_detected) { |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
343 printf |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
344 ("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
|
345 |
2305
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
346 /* 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
|
347 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
|
348 KeySym sym; |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
349 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
|
350 if (sym) { |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
351 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
|
352 XKeysymToString(sym)); |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
353 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
|
354 if (XKeySymTable[j] == sym) { |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
355 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
|
356 break; |
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 } |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
359 if (j == SDL_arraysize(XKeySymTable)) { |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
360 printf("scancode not found\n"); |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
361 } else { |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
362 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
|
363 } |
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
|
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 } |
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
|
366 } |
2305
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
367 |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
368 SDL_zero(keyboard); |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
369 data->keyboard = SDL_AddKeyboard(&keyboard, -1); |
2306 | 370 X11_UpdateKeymap(_this); |
2305
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
371 |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
372 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
|
373 |
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 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
|
375 } |
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
|
376 |
2305
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
377 void |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
378 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
|
379 { |
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
|
380 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
|
381 int i; |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
382 SDL_scancode scancode; |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
383 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
|
384 |
2305
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
385 SDL_GetDefaultKeymap(keymap); |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
386 |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
387 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
|
388 |
2305
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
389 /* 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
|
390 scancode = data->key_layout[i]; |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
391 if (scancode == SDL_SCANCODE_UNKNOWN || |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
392 (keymap[scancode] & SDLK_SCANCODE_MASK)) { |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
393 continue; |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
394 } |
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
|
395 |
2305
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
396 keymap[scancode] = |
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
397 (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
|
398 } |
2305
fbe8ff44c519
First pass of new SDL scancode concept for X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2299
diff
changeset
|
399 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
|
400 } |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
401 |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
402 void |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
403 X11_QuitKeyboard(_THIS) |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
404 { |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
405 SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
406 |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
407 SDL_DelKeyboard(data->keyboard); |
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 |
a344e42bce3b
Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
410 /* vi: set ts=4 sw=4 expandtab: */ |