Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Latest commit

 

History

History
800 lines (720 loc) · 28.9 KB

SDL_DirectFB_events.c

File metadata and controls

800 lines (720 loc) · 28.9 KB
 
Feb 1, 2006
Feb 1, 2006
2
SDL - Simple DirectMedia Layer
Jan 24, 2010
Jan 24, 2010
3
Copyright (C) 1997-2010 Sam Lantinga
Feb 1, 2006
Feb 1, 2006
5
6
7
8
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
Feb 1, 2006
Feb 1, 2006
10
11
12
13
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
Feb 1, 2006
Feb 1, 2006
15
16
17
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Feb 1, 2006
Feb 1, 2006
19
20
Sam Lantinga
slouken@libsdl.org
Feb 21, 2006
Feb 21, 2006
22
#include "SDL_config.h"
23
24
25
26
27
/* Handle the event stream, converting DirectFB input events into SDL events */
#include <directfb.h>
Feb 16, 2006
Feb 16, 2006
28
29
30
#include "../SDL_sysvideo.h"
#include "../../events/SDL_sysevents.h"
#include "../../events/SDL_events_c.h"
Aug 26, 2008
Aug 26, 2008
31
32
#include "../../events/SDL_keyboard_c.h"
#include "../../events/scancodes_linux.h"
33
34
#include "SDL_DirectFB_events.h"
Jul 24, 2010
Jul 24, 2010
35
36
37
38
39
40
41
42
43
44
45
46
47
#if USE_MULTI_API
#define SDL_SendMouseMotion_ex(id, relative, x, y, p) SDL_SendMouseMotion(id, relative, x, y, p)
#define SDL_SendMouseButton_ex(id, state, button) SDL_SendMouseButton(id, state, button)
#define SDL_SendKeyboardKey_ex(id, state, scancode) SDL_SendKeyboardKey(id, state, scancode)
#define SDL_SendKeyboardText_ex(id, text) SDL_SendKeyboardText(id, text)
#else
#define SDL_SendMouseMotion_ex(id, relative, x, y, p) SDL_SendMouseMotion(relative, x, y)
#define SDL_SendMouseButton_ex(id, state, button) SDL_SendMouseButton(state, button)
#define SDL_SendKeyboardKey_ex(id, state, scancode) SDL_SendKeyboardKey(state, scancode)
#define SDL_SendKeyboardText_ex(id, text) SDL_SendKeyboardText(text)
#endif
48
/* The translation tables from a DirectFB keycode to a SDL keysym */
Dec 8, 2008
Dec 8, 2008
49
50
static SDLKey oskeymap[256];
static int sys_ids;
Aug 26, 2008
Aug 26, 2008
52
static SDL_keysym *DirectFB_TranslateKey(_THIS, DFBWindowEvent * evt,
Aug 11, 2007
Aug 11, 2007
53
SDL_keysym * keysym);
Dec 8, 2008
Dec 8, 2008
54
55
56
static SDL_keysym *DirectFB_TranslateKeyInputEvent(_THIS, int index,
DFBInputEvent * evt,
SDL_keysym * keysym);
Dec 8, 2008
Dec 8, 2008
58
static void DirectFB_InitOSKeymap(_THIS, SDLKey * keypmap, int numkeys);
Aug 11, 2007
Aug 11, 2007
59
static int DirectFB_TranslateButton(DFBInputDeviceButtonIdentifier button);
Aug 26, 2008
Aug 26, 2008
61
static void
Jan 21, 2010
Jan 21, 2010
62
DirectFB_SetContext(_THIS, SDL_Window *window)
Aug 26, 2008
Aug 26, 2008
63
{
Jan 13, 2009
Jan 13, 2009
64
#if (DFB_VERSION_ATLEAST(1,0,0))
Aug 26, 2008
Aug 26, 2008
65
66
/* FIXME: does not work on 1.0/1.2 with radeon driver
* the approach did work with the matrox driver
Aug 31, 2008
Aug 31, 2008
67
* This has simply no effect.
Aug 26, 2008
Aug 26, 2008
68
69
*/
Jan 21, 2010
Jan 21, 2010
70
SDL_VideoDisplay *display = window->display;
Aug 31, 2008
Aug 31, 2008
71
72
73
74
DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata;
int ret;
if (dispdata->vidIDinuse)
Jan 11, 2009
Jan 11, 2009
75
76
SDL_DFB_CHECKERR(dispdata->vidlayer->SwitchContext(dispdata->vidlayer,
DFB_TRUE));
Aug 31, 2008
Aug 31, 2008
77
78
79
error:
return;
Aug 26, 2008
Aug 26, 2008
80
81
82
83
#endif
}
Dec 8, 2008
Dec 8, 2008
84
static void
Jan 21, 2010
Jan 21, 2010
85
FocusAllMice(_THIS, SDL_Window *window)
Dec 8, 2008
Dec 8, 2008
86
{
Jul 24, 2010
Jul 24, 2010
87
#if USE_MULTI_API
Dec 8, 2008
Dec 8, 2008
88
89
90
91
92
SDL_DFB_DEVICEDATA(_this);
int index;
for (index = 0; index < devdata->num_mice; index++)
SDL_SetMouseFocus(devdata->mouse_id[index], id);
Jul 24, 2010
Jul 24, 2010
93
94
95
#else
SDL_SetMouseFocus(window);
#endif
Dec 8, 2008
Dec 8, 2008
96
97
98
99
}
static void
Jan 21, 2010
Jan 21, 2010
100
FocusAllKeyboards(_THIS, SDL_Window *window)
Dec 8, 2008
Dec 8, 2008
101
{
Jul 24, 2010
Jul 24, 2010
102
#if USE_MULTI_API
Dec 8, 2008
Dec 8, 2008
103
104
105
106
107
SDL_DFB_DEVICEDATA(_this);
int index;
for (index = 0; index < devdata->num_keyboard; index++)
SDL_SetKeyboardFocus(index, id);
Jul 24, 2010
Jul 24, 2010
108
109
110
#else
SDL_SetKeyboardFocus(window);
#endif
Dec 8, 2008
Dec 8, 2008
111
112
113
114
115
}
static void
MotionAllMice(_THIS, int x, int y)
{
Jul 24, 2010
Jul 24, 2010
116
#if USE_MULTI_API
Dec 8, 2008
Dec 8, 2008
117
118
119
120
121
122
123
124
125
SDL_DFB_DEVICEDATA(_this);
int index;
for (index = 0; index < devdata->num_mice; index++) {
SDL_Mouse *mouse = SDL_GetMouse(index);
mouse->x = mouse->last_x = x;
mouse->y = mouse->last_y = y;
//SDL_SendMouseMotion(devdata->mouse_id[index], 0, x, y, 0);
}
Jul 24, 2010
Jul 24, 2010
126
#endif
Dec 8, 2008
Dec 8, 2008
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
}
static int
KbdIndex(_THIS, int id)
{
SDL_DFB_DEVICEDATA(_this);
int index;
for (index = 0; index < devdata->num_keyboard; index++) {
if (devdata->keyboard[index].id == id)
return index;
}
return -1;
}
Jan 11, 2009
Jan 11, 2009
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
static int
ClientXY(DFB_WindowData * p, int *x, int *y)
{
int cx, cy;
cx = *x;
cy = *y;
cx -= p->client.x;
cy -= p->client.y;
if (cx < 0 || cy < 0)
return 0;
if (cx >= p->client.w || cy >= p->client.h)
return 0;
*x = cx;
*y = cy;
return 1;
}
static void
ProcessWindowEvent(_THIS, DFB_WindowData * p, Uint32 flags,
DFBWindowEvent * evt)
{
SDL_DFB_DEVICEDATA(_this);
SDL_keysym keysym;
char text[5];
if (evt->clazz == DFEC_WINDOW) {
switch (evt->type) {
case DWET_BUTTONDOWN:
if (ClientXY(p, &evt->x, &evt->y)) {
if (!devdata->use_linux_input) {
Jul 24, 2010
Jul 24, 2010
175
SDL_SendMouseMotion_ex(devdata->mouse_id[0], 0, evt->x,
Jan 11, 2009
Jan 11, 2009
176
evt->y, 0);
Jul 24, 2010
Jul 24, 2010
177
SDL_SendMouseButton_ex(devdata->mouse_id[0],
Jan 11, 2009
Jan 11, 2009
178
179
180
181
182
183
184
185
186
187
188
SDL_PRESSED,
DirectFB_TranslateButton
(evt->button));
} else {
MotionAllMice(_this, evt->x, evt->y);
}
}
break;
case DWET_BUTTONUP:
if (ClientXY(p, &evt->x, &evt->y)) {
if (!devdata->use_linux_input) {
Jul 24, 2010
Jul 24, 2010
189
SDL_SendMouseMotion_ex(devdata->mouse_id[0], 0, evt->x,
Jan 11, 2009
Jan 11, 2009
190
evt->y, 0);
Jul 24, 2010
Jul 24, 2010
191
SDL_SendMouseButton_ex(devdata->mouse_id[0],
Jan 11, 2009
Jan 11, 2009
192
193
194
195
196
197
198
199
200
201
SDL_RELEASED,
DirectFB_TranslateButton
(evt->button));
} else {
MotionAllMice(_this, evt->x, evt->y);
}
}
break;
case DWET_MOTION:
if (ClientXY(p, &evt->x, &evt->y)) {
Jul 24, 2010
Jul 24, 2010
202
SDL_Window *window = p->sdl_window;
Jan 11, 2009
Jan 11, 2009
203
204
if (!devdata->use_linux_input) {
if (!(flags & SDL_WINDOW_INPUT_GRABBED))
Jul 24, 2010
Jul 24, 2010
205
SDL_SendMouseMotion_ex(devdata->mouse_id[0], 0,
Jan 11, 2009
Jan 11, 2009
206
207
208
209
210
211
212
213
214
215
216
217
evt->x, evt->y, 0);
} else {
/* relative movements are not exact!
* This code should limit the number of events sent.
* However it kills MAME axis recognition ... */
static int cnt = 0;
if (1 && ++cnt > 20) {
MotionAllMice(_this, evt->x, evt->y);
cnt = 0;
}
}
if (!(window->flags & SDL_WINDOW_MOUSE_FOCUS))
Jan 21, 2010
Jan 21, 2010
218
SDL_SendWindowEvent(p->window, SDL_WINDOWEVENT_ENTER, 0,
Jan 14, 2009
Jan 14, 2009
219
0);
Jan 11, 2009
Jan 11, 2009
220
221
222
223
224
}
break;
case DWET_KEYDOWN:
if (!devdata->use_linux_input) {
DirectFB_TranslateKey(_this, evt, &keysym);
Jul 24, 2010
Jul 24, 2010
225
SDL_SendKeyboardKey_ex(0, SDL_PRESSED, keysym.scancode);
Jan 11, 2009
Jan 11, 2009
226
227
228
229
if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) {
SDL_memcpy(text, &keysym.unicode, 4);
text[4] = 0;
if (*text) {
Jul 24, 2010
Jul 24, 2010
230
SDL_SendKeyboardText_ex(0, text);
Jan 11, 2009
Jan 11, 2009
231
232
233
234
235
236
237
}
}
}
break;
case DWET_KEYUP:
if (!devdata->use_linux_input) {
DirectFB_TranslateKey(_this, evt, &keysym);
Jul 24, 2010
Jul 24, 2010
238
SDL_SendKeyboardKey_ex(0, SDL_RELEASED, keysym.scancode);
Jan 11, 2009
Jan 11, 2009
239
240
241
242
}
break;
case DWET_POSITION:
if (ClientXY(p, &evt->x, &evt->y)) {
Jul 24, 2010
Jul 24, 2010
243
SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_MOVED,
Jan 11, 2009
Jan 11, 2009
244
245
246
247
248
evt->x, evt->y);
}
break;
case DWET_POSITION_SIZE:
if (ClientXY(p, &evt->x, &evt->y)) {
Jul 24, 2010
Jul 24, 2010
249
SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_MOVED,
Jan 11, 2009
Jan 11, 2009
250
251
252
253
254
255
256
257
258
evt->x, evt->y);
}
/* fall throught */
case DWET_SIZE:
// FIXME: what about < 0
evt->w -= (p->theme.right_size + p->theme.left_size);
evt->h -=
(p->theme.top_size + p->theme.bottom_size +
p->theme.caption_size);
Jul 24, 2010
Jul 24, 2010
259
SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_RESIZED,
Jan 11, 2009
Jan 11, 2009
260
261
262
evt->w, evt->h);
break;
case DWET_CLOSE:
Jul 24, 2010
Jul 24, 2010
263
SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_CLOSE, 0, 0);
Jan 11, 2009
Jan 11, 2009
264
265
break;
case DWET_GOTFOCUS:
Jul 24, 2010
Jul 24, 2010
266
267
268
DirectFB_SetContext(_this, p->sdl_window);
FocusAllKeyboards(_this, p->sdl_window);
SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_FOCUS_GAINED,
Jan 11, 2009
Jan 11, 2009
269
270
271
0, 0);
break;
case DWET_LOSTFOCUS:
Jul 24, 2010
Jul 24, 2010
272
SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_FOCUS_LOST, 0, 0);
Jan 11, 2009
Jan 11, 2009
273
274
275
276
FocusAllKeyboards(_this, 0);
break;
case DWET_ENTER:
/* SDL_DirectFB_ReshowCursor(_this, 0); */
Jul 24, 2010
Jul 24, 2010
277
FocusAllMice(_this, p->sdl_window);
Jan 11, 2009
Jan 11, 2009
278
279
280
// FIXME: when do we really enter ?
if (ClientXY(p, &evt->x, &evt->y))
MotionAllMice(_this, evt->x, evt->y);
Jul 24, 2010
Jul 24, 2010
281
SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_ENTER, 0, 0);
Jan 11, 2009
Jan 11, 2009
282
283
break;
case DWET_LEAVE:
Jul 24, 2010
Jul 24, 2010
284
SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_LEAVE, 0, 0);
Jan 11, 2009
Jan 11, 2009
285
286
287
288
289
290
291
292
293
294
295
FocusAllMice(_this, 0);
/* SDL_DirectFB_ReshowCursor(_this, 1); */
break;
default:
;
}
} else
printf("Event Clazz %d\n", evt->clazz);
}
static void
Jul 24, 2010
Jul 24, 2010
296
ProcessInputEvent(_THIS, SDL_Window *grabbed_window, DFBInputEvent * ievt)
Jan 11, 2009
Jan 11, 2009
297
298
299
300
301
302
303
304
{
SDL_DFB_DEVICEDATA(_this);
SDL_keysym keysym;
int kbd_idx;
char text[5];
if (!devdata->use_linux_input) {
if (ievt->type == DIET_AXISMOTION) {
Jul 24, 2010
Jul 24, 2010
305
if ((grabbed_window != NULL) && (ievt->flags & DIEF_AXISREL)) {
Jan 11, 2009
Jan 11, 2009
306
if (ievt->axis == DIAI_X)
Jul 24, 2010
Jul 24, 2010
307
SDL_SendMouseMotion_ex(ievt->device_id, 1,
Jan 11, 2009
Jan 11, 2009
308
309
ievt->axisrel, 0, 0);
else if (ievt->axis == DIAI_Y)
Jul 24, 2010
Jul 24, 2010
310
SDL_SendMouseMotion_ex(ievt->device_id, 1, 0,
Jan 11, 2009
Jan 11, 2009
311
312
313
314
ievt->axisrel, 0);
}
}
} else {
Jul 24, 2010
Jul 24, 2010
315
#if USE_MULTI_API
Jan 11, 2009
Jan 11, 2009
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
static int last_x, last_y;
switch (ievt->type) {
case DIET_AXISMOTION:
if (ievt->flags & DIEF_AXISABS) {
if (ievt->axis == DIAI_X)
last_x = ievt->axisabs;
else if (ievt->axis == DIAI_Y)
last_y = ievt->axisabs;
if (!(ievt->flags & DIEF_FOLLOW)) {
SDL_Mouse *mouse = SDL_GetMouse(ievt->device_id);
SDL_Window *window = SDL_GetWindowFromID(mouse->focus);
if (window) {
DFB_WindowData *windata =
(DFB_WindowData *) window->driverdata;
int x, y;
windata->window->GetPosition(windata->window, &x, &y);
Jul 24, 2010
Jul 24, 2010
334
SDL_SendMouseMotion_ex(ievt->device_id, 0,
Jan 11, 2009
Jan 11, 2009
335
336
337
338
339
last_x - (x +
windata->client.x),
last_y - (y +
windata->client.y), 0);
} else {
Jul 24, 2010
Jul 24, 2010
340
SDL_SendMouseMotion_ex(ievt->device_id, 0, last_x,
Jan 11, 2009
Jan 11, 2009
341
342
343
344
345
last_y, 0);
}
}
} else if (ievt->flags & DIEF_AXISREL) {
if (ievt->axis == DIAI_X)
Jul 24, 2010
Jul 24, 2010
346
SDL_SendMouseMotion_ex(ievt->device_id, 1,
Jan 11, 2009
Jan 11, 2009
347
348
ievt->axisrel, 0, 0);
else if (ievt->axis == DIAI_Y)
Jul 24, 2010
Jul 24, 2010
349
SDL_SendMouseMotion_ex(ievt->device_id, 1, 0,
Jan 11, 2009
Jan 11, 2009
350
351
352
353
354
355
ievt->axisrel, 0);
}
break;
case DIET_KEYPRESS:
kbd_idx = KbdIndex(_this, ievt->device_id);
DirectFB_TranslateKeyInputEvent(_this, kbd_idx, ievt, &keysym);
Jul 24, 2010
Jul 24, 2010
356
SDL_SendKeyboardKey_ex(kbd_idx, SDL_PRESSED, keysym.scancode);
Jan 11, 2009
Jan 11, 2009
357
358
359
360
if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) {
SDL_memcpy(text, &keysym.unicode, 4);
text[4] = 0;
if (*text) {
Jul 24, 2010
Jul 24, 2010
361
SDL_SendKeyboardText_ex(kbd_idx, text);
Jan 11, 2009
Jan 11, 2009
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
}
}
break;
case DIET_KEYRELEASE:
kbd_idx = KbdIndex(_this, ievt->device_id);
DirectFB_TranslateKeyInputEvent(_this, kbd_idx, ievt, &keysym);
SDL_SendKeyboardKey(kbd_idx, SDL_RELEASED, keysym.scancode);
break;
case DIET_BUTTONPRESS:
if (ievt->buttons & DIBM_LEFT)
SDL_SendMouseButton(ievt->device_id, SDL_PRESSED, 1);
if (ievt->buttons & DIBM_MIDDLE)
SDL_SendMouseButton(ievt->device_id, SDL_PRESSED, 2);
if (ievt->buttons & DIBM_RIGHT)
SDL_SendMouseButton(ievt->device_id, SDL_PRESSED, 3);
break;
case DIET_BUTTONRELEASE:
if (!(ievt->buttons & DIBM_LEFT))
SDL_SendMouseButton(ievt->device_id, SDL_RELEASED, 1);
if (!(ievt->buttons & DIBM_MIDDLE))
SDL_SendMouseButton(ievt->device_id, SDL_RELEASED, 2);
if (!(ievt->buttons & DIBM_RIGHT))
SDL_SendMouseButton(ievt->device_id, SDL_RELEASED, 3);
break;
default:
break; /* please gcc */
}
Jul 24, 2010
Jul 24, 2010
389
#endif
Jan 11, 2009
Jan 11, 2009
390
391
392
}
}
Jul 10, 2006
Jul 10, 2006
393
void
Aug 11, 2007
Aug 11, 2007
394
DirectFB_PumpEventsWindow(_THIS)
Aug 11, 2007
Aug 11, 2007
396
397
SDL_DFB_DEVICEDATA(_this);
DFB_WindowData *p;
Aug 31, 2008
Aug 31, 2008
398
DFBInputEvent ievt;
Jan 21, 2010
Jan 21, 2010
399
SDL_Window *grabbed_window;
Jan 21, 2010
Jan 21, 2010
401
grabbed_window = NULL;
Aug 31, 2008
Aug 31, 2008
402
Aug 11, 2007
Aug 11, 2007
403
for (p = devdata->firstwin; p != NULL; p = p->next) {
Dec 8, 2008
Dec 8, 2008
404
DFBWindowEvent evt;
Jul 24, 2010
Jul 24, 2010
405
SDL_Window *w = p->sdl_window;
Aug 31, 2008
Aug 31, 2008
406
407
if (w->flags & SDL_WINDOW_INPUT_GRABBED) {
Jan 21, 2010
Jan 21, 2010
408
grabbed_window = w;
Aug 31, 2008
Aug 31, 2008
409
410
}
Aug 11, 2007
Aug 11, 2007
411
412
while (p->eventbuffer->GetEvent(p->eventbuffer,
DFB_EVENT(&evt)) == DFB_OK) {
Jan 11, 2009
Jan 11, 2009
413
414
if (!DirectFB_WM_ProcessEvent(_this, w, &evt))
ProcessWindowEvent(_this, p, w->flags, &evt);
Aug 31, 2008
Aug 31, 2008
415
416
417
418
419
420
}
}
/* Now get relative events in case we need them */
while (devdata->events->GetEvent(devdata->events,
DFB_EVENT(&ievt)) == DFB_OK) {
Jan 11, 2009
Jan 11, 2009
421
ProcessInputEvent(_this, grabbed_window, &ievt);
Jul 10, 2006
Jul 10, 2006
425
void
Dec 8, 2008
Dec 8, 2008
426
DirectFB_InitOSKeymap(_THIS, SDLKey * keymap, int numkeys)
Jul 10, 2006
Jul 10, 2006
428
429
430
int i;
/* Initialize the DirectFB key translation table */
Dec 8, 2008
Dec 8, 2008
431
for (i = 0; i < numkeys; ++i)
Aug 26, 2008
Aug 26, 2008
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
keymap[i] = SDL_SCANCODE_UNKNOWN;
keymap[DIKI_A - DIKI_UNKNOWN] = SDL_SCANCODE_A;
keymap[DIKI_B - DIKI_UNKNOWN] = SDL_SCANCODE_B;
keymap[DIKI_C - DIKI_UNKNOWN] = SDL_SCANCODE_C;
keymap[DIKI_D - DIKI_UNKNOWN] = SDL_SCANCODE_D;
keymap[DIKI_E - DIKI_UNKNOWN] = SDL_SCANCODE_E;
keymap[DIKI_F - DIKI_UNKNOWN] = SDL_SCANCODE_F;
keymap[DIKI_G - DIKI_UNKNOWN] = SDL_SCANCODE_G;
keymap[DIKI_H - DIKI_UNKNOWN] = SDL_SCANCODE_H;
keymap[DIKI_I - DIKI_UNKNOWN] = SDL_SCANCODE_I;
keymap[DIKI_J - DIKI_UNKNOWN] = SDL_SCANCODE_J;
keymap[DIKI_K - DIKI_UNKNOWN] = SDL_SCANCODE_K;
keymap[DIKI_L - DIKI_UNKNOWN] = SDL_SCANCODE_L;
keymap[DIKI_M - DIKI_UNKNOWN] = SDL_SCANCODE_M;
keymap[DIKI_N - DIKI_UNKNOWN] = SDL_SCANCODE_N;
keymap[DIKI_O - DIKI_UNKNOWN] = SDL_SCANCODE_O;
keymap[DIKI_P - DIKI_UNKNOWN] = SDL_SCANCODE_P;
keymap[DIKI_Q - DIKI_UNKNOWN] = SDL_SCANCODE_Q;
keymap[DIKI_R - DIKI_UNKNOWN] = SDL_SCANCODE_R;
keymap[DIKI_S - DIKI_UNKNOWN] = SDL_SCANCODE_S;
keymap[DIKI_T - DIKI_UNKNOWN] = SDL_SCANCODE_T;
keymap[DIKI_U - DIKI_UNKNOWN] = SDL_SCANCODE_U;
keymap[DIKI_V - DIKI_UNKNOWN] = SDL_SCANCODE_V;
keymap[DIKI_W - DIKI_UNKNOWN] = SDL_SCANCODE_W;
keymap[DIKI_X - DIKI_UNKNOWN] = SDL_SCANCODE_X;
keymap[DIKI_Y - DIKI_UNKNOWN] = SDL_SCANCODE_Y;
keymap[DIKI_Z - DIKI_UNKNOWN] = SDL_SCANCODE_Z;
keymap[DIKI_0 - DIKI_UNKNOWN] = SDL_SCANCODE_0;
keymap[DIKI_1 - DIKI_UNKNOWN] = SDL_SCANCODE_1;
keymap[DIKI_2 - DIKI_UNKNOWN] = SDL_SCANCODE_2;
keymap[DIKI_3 - DIKI_UNKNOWN] = SDL_SCANCODE_3;
keymap[DIKI_4 - DIKI_UNKNOWN] = SDL_SCANCODE_4;
keymap[DIKI_5 - DIKI_UNKNOWN] = SDL_SCANCODE_5;
keymap[DIKI_6 - DIKI_UNKNOWN] = SDL_SCANCODE_6;
keymap[DIKI_7 - DIKI_UNKNOWN] = SDL_SCANCODE_7;
keymap[DIKI_8 - DIKI_UNKNOWN] = SDL_SCANCODE_8;
keymap[DIKI_9 - DIKI_UNKNOWN] = SDL_SCANCODE_9;
keymap[DIKI_F1 - DIKI_UNKNOWN] = SDL_SCANCODE_F1;
keymap[DIKI_F2 - DIKI_UNKNOWN] = SDL_SCANCODE_F2;
keymap[DIKI_F3 - DIKI_UNKNOWN] = SDL_SCANCODE_F3;
keymap[DIKI_F4 - DIKI_UNKNOWN] = SDL_SCANCODE_F4;
keymap[DIKI_F5 - DIKI_UNKNOWN] = SDL_SCANCODE_F5;
keymap[DIKI_F6 - DIKI_UNKNOWN] = SDL_SCANCODE_F6;
keymap[DIKI_F7 - DIKI_UNKNOWN] = SDL_SCANCODE_F7;
keymap[DIKI_F8 - DIKI_UNKNOWN] = SDL_SCANCODE_F8;
keymap[DIKI_F9 - DIKI_UNKNOWN] = SDL_SCANCODE_F9;
keymap[DIKI_F10 - DIKI_UNKNOWN] = SDL_SCANCODE_F10;
keymap[DIKI_F11 - DIKI_UNKNOWN] = SDL_SCANCODE_F11;
keymap[DIKI_F12 - DIKI_UNKNOWN] = SDL_SCANCODE_F12;
keymap[DIKI_ESCAPE - DIKI_UNKNOWN] = SDL_SCANCODE_ESCAPE;
keymap[DIKI_LEFT - DIKI_UNKNOWN] = SDL_SCANCODE_LEFT;
keymap[DIKI_RIGHT - DIKI_UNKNOWN] = SDL_SCANCODE_RIGHT;
keymap[DIKI_UP - DIKI_UNKNOWN] = SDL_SCANCODE_UP;
keymap[DIKI_DOWN - DIKI_UNKNOWN] = SDL_SCANCODE_DOWN;
keymap[DIKI_CONTROL_L - DIKI_UNKNOWN] = SDL_SCANCODE_LCTRL;
keymap[DIKI_CONTROL_R - DIKI_UNKNOWN] = SDL_SCANCODE_RCTRL;
keymap[DIKI_SHIFT_L - DIKI_UNKNOWN] = SDL_SCANCODE_LSHIFT;
keymap[DIKI_SHIFT_R - DIKI_UNKNOWN] = SDL_SCANCODE_RSHIFT;
keymap[DIKI_ALT_L - DIKI_UNKNOWN] = SDL_SCANCODE_LALT;
keymap[DIKI_ALT_R - DIKI_UNKNOWN] = SDL_SCANCODE_RALT;
keymap[DIKI_META_L - DIKI_UNKNOWN] = SDL_SCANCODE_LGUI;
keymap[DIKI_META_R - DIKI_UNKNOWN] = SDL_SCANCODE_RGUI;
keymap[DIKI_SUPER_L - DIKI_UNKNOWN] = SDL_SCANCODE_APPLICATION;
keymap[DIKI_SUPER_R - DIKI_UNKNOWN] = SDL_SCANCODE_APPLICATION;
Aug 31, 2008
Aug 31, 2008
500
501
502
503
/* FIXME:Do we read hyper keys ?
* keymap[DIKI_HYPER_L - DIKI_UNKNOWN] = SDL_SCANCODE_APPLICATION;
* keymap[DIKI_HYPER_R - DIKI_UNKNOWN] = SDL_SCANCODE_APPLICATION;
*/
Aug 26, 2008
Aug 26, 2008
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
keymap[DIKI_TAB - DIKI_UNKNOWN] = SDL_SCANCODE_TAB;
keymap[DIKI_ENTER - DIKI_UNKNOWN] = SDL_SCANCODE_RETURN;
keymap[DIKI_SPACE - DIKI_UNKNOWN] = SDL_SCANCODE_SPACE;
keymap[DIKI_BACKSPACE - DIKI_UNKNOWN] = SDL_SCANCODE_BACKSPACE;
keymap[DIKI_INSERT - DIKI_UNKNOWN] = SDL_SCANCODE_INSERT;
keymap[DIKI_DELETE - DIKI_UNKNOWN] = SDL_SCANCODE_DELETE;
keymap[DIKI_HOME - DIKI_UNKNOWN] = SDL_SCANCODE_HOME;
keymap[DIKI_END - DIKI_UNKNOWN] = SDL_SCANCODE_END;
keymap[DIKI_PAGE_UP - DIKI_UNKNOWN] = SDL_SCANCODE_PAGEUP;
keymap[DIKI_PAGE_DOWN - DIKI_UNKNOWN] = SDL_SCANCODE_PAGEDOWN;
keymap[DIKI_CAPS_LOCK - DIKI_UNKNOWN] = SDL_SCANCODE_CAPSLOCK;
keymap[DIKI_NUM_LOCK - DIKI_UNKNOWN] = SDL_SCANCODE_NUMLOCKCLEAR;
keymap[DIKI_SCROLL_LOCK - DIKI_UNKNOWN] = SDL_SCANCODE_SCROLLLOCK;
keymap[DIKI_PRINT - DIKI_UNKNOWN] = SDL_SCANCODE_PRINTSCREEN;
keymap[DIKI_PAUSE - DIKI_UNKNOWN] = SDL_SCANCODE_PAUSE;
keymap[DIKI_KP_EQUAL - DIKI_UNKNOWN] = SDL_SCANCODE_KP_EQUALS;
keymap[DIKI_KP_DECIMAL - DIKI_UNKNOWN] = SDL_SCANCODE_KP_PERIOD;
keymap[DIKI_KP_0 - DIKI_UNKNOWN] = SDL_SCANCODE_KP_0;
keymap[DIKI_KP_1 - DIKI_UNKNOWN] = SDL_SCANCODE_KP_1;
keymap[DIKI_KP_2 - DIKI_UNKNOWN] = SDL_SCANCODE_KP_2;
keymap[DIKI_KP_3 - DIKI_UNKNOWN] = SDL_SCANCODE_KP_3;
keymap[DIKI_KP_4 - DIKI_UNKNOWN] = SDL_SCANCODE_KP_4;
keymap[DIKI_KP_5 - DIKI_UNKNOWN] = SDL_SCANCODE_KP_5;
keymap[DIKI_KP_6 - DIKI_UNKNOWN] = SDL_SCANCODE_KP_6;
keymap[DIKI_KP_7 - DIKI_UNKNOWN] = SDL_SCANCODE_KP_7;
keymap[DIKI_KP_8 - DIKI_UNKNOWN] = SDL_SCANCODE_KP_8;
keymap[DIKI_KP_9 - DIKI_UNKNOWN] = SDL_SCANCODE_KP_9;
keymap[DIKI_KP_DIV - DIKI_UNKNOWN] = SDL_SCANCODE_KP_DIVIDE;
keymap[DIKI_KP_MULT - DIKI_UNKNOWN] = SDL_SCANCODE_KP_MULTIPLY;
keymap[DIKI_KP_MINUS - DIKI_UNKNOWN] = SDL_SCANCODE_KP_MINUS;
keymap[DIKI_KP_PLUS - DIKI_UNKNOWN] = SDL_SCANCODE_KP_PLUS;
keymap[DIKI_KP_ENTER - DIKI_UNKNOWN] = SDL_SCANCODE_KP_ENTER;
keymap[DIKI_QUOTE_LEFT - DIKI_UNKNOWN] = SDL_SCANCODE_GRAVE; /* TLDE */
keymap[DIKI_MINUS_SIGN - DIKI_UNKNOWN] = SDL_SCANCODE_MINUS; /* AE11 */
keymap[DIKI_EQUALS_SIGN - DIKI_UNKNOWN] = SDL_SCANCODE_EQUALS; /* AE12 */
keymap[DIKI_BRACKET_LEFT - DIKI_UNKNOWN] = SDL_SCANCODE_RIGHTBRACKET; /* AD11 */
keymap[DIKI_BRACKET_RIGHT - DIKI_UNKNOWN] = SDL_SCANCODE_LEFTBRACKET; /* AD12 */
keymap[DIKI_BACKSLASH - DIKI_UNKNOWN] = SDL_SCANCODE_BACKSLASH; /* BKSL */
keymap[DIKI_SEMICOLON - DIKI_UNKNOWN] = SDL_SCANCODE_SEMICOLON; /* AC10 */
keymap[DIKI_QUOTE_RIGHT - DIKI_UNKNOWN] = SDL_SCANCODE_APOSTROPHE; /* AC11 */
keymap[DIKI_COMMA - DIKI_UNKNOWN] = SDL_SCANCODE_COMMA; /* AB08 */
keymap[DIKI_PERIOD - DIKI_UNKNOWN] = SDL_SCANCODE_PERIOD; /* AB09 */
keymap[DIKI_SLASH - DIKI_UNKNOWN] = SDL_SCANCODE_SLASH; /* AB10 */
keymap[DIKI_LESS_SIGN - DIKI_UNKNOWN] = SDL_SCANCODE_NONUSBACKSLASH; /* 103rd */
Aug 11, 2007
Aug 11, 2007
551
}
Jul 10, 2006
Jul 10, 2006
553
static SDL_keysym *
Aug 26, 2008
Aug 26, 2008
554
DirectFB_TranslateKey(_THIS, DFBWindowEvent * evt, SDL_keysym * keysym)
Aug 26, 2008
Aug 26, 2008
556
SDL_DFB_DEVICEDATA(_this);
Aug 11, 2007
Aug 11, 2007
557
Jan 11, 2009
Jan 11, 2009
558
559
if (evt->key_code >= 0 &&
evt->key_code < SDL_arraysize(linux_scancode_table))
Aug 31, 2008
Aug 31, 2008
560
keysym->scancode = linux_scancode_table[evt->key_code];
Aug 26, 2008
Aug 26, 2008
561
562
else
keysym->scancode = SDL_SCANCODE_UNKNOWN;
Aug 11, 2007
Aug 11, 2007
563
Jan 11, 2009
Jan 11, 2009
564
565
if (keysym->scancode == SDL_SCANCODE_UNKNOWN ||
devdata->keyboard[0].is_generic) {
Dec 8, 2008
Dec 8, 2008
566
567
if (evt->key_id - DIKI_UNKNOWN < SDL_arraysize(oskeymap))
keysym->scancode = oskeymap[evt->key_id - DIKI_UNKNOWN];
Aug 26, 2008
Aug 26, 2008
568
569
570
else
keysym->scancode = SDL_SCANCODE_UNKNOWN;
}
Jul 10, 2006
Jul 10, 2006
571
Aug 26, 2008
Aug 26, 2008
572
573
keysym->unicode =
(DFB_KEY_TYPE(evt->key_symbol) == DIKT_UNICODE) ? evt->key_symbol : 0;
Jan 11, 2009
Jan 11, 2009
574
575
if (keysym->unicode == 0 &&
(evt->key_symbol > 0 && evt->key_symbol < 255))
Aug 26, 2008
Aug 26, 2008
576
keysym->unicode = evt->key_symbol;
Jul 10, 2006
Jul 10, 2006
577
578
return keysym;
Dec 8, 2008
Dec 8, 2008
581
582
583
584
585
586
static SDL_keysym *
DirectFB_TranslateKeyInputEvent(_THIS, int index, DFBInputEvent * evt,
SDL_keysym * keysym)
{
SDL_DFB_DEVICEDATA(_this);
Jan 11, 2009
Jan 11, 2009
587
588
if (evt->key_code >= 0 &&
evt->key_code < SDL_arraysize(linux_scancode_table))
Dec 8, 2008
Dec 8, 2008
589
590
591
592
keysym->scancode = linux_scancode_table[evt->key_code];
else
keysym->scancode = SDL_SCANCODE_UNKNOWN;
Jan 11, 2009
Jan 11, 2009
593
594
if (keysym->scancode == SDL_SCANCODE_UNKNOWN ||
devdata->keyboard[index].is_generic) {
Dec 8, 2008
Dec 8, 2008
595
596
597
598
599
600
601
602
if (evt->key_id - DIKI_UNKNOWN < SDL_arraysize(oskeymap))
keysym->scancode = oskeymap[evt->key_id - DIKI_UNKNOWN];
else
keysym->scancode = SDL_SCANCODE_UNKNOWN;
}
keysym->unicode =
(DFB_KEY_TYPE(evt->key_symbol) == DIKT_UNICODE) ? evt->key_symbol : 0;
Jan 11, 2009
Jan 11, 2009
603
604
if (keysym->unicode == 0 &&
(evt->key_symbol > 0 && evt->key_symbol < 255))
Dec 8, 2008
Dec 8, 2008
605
606
607
608
keysym->unicode = evt->key_symbol;
return keysym;
}
Jan 11, 2009
Jan 11, 2009
609
Jul 10, 2006
Jul 10, 2006
610
static int
Aug 11, 2007
Aug 11, 2007
611
DirectFB_TranslateButton(DFBInputDeviceButtonIdentifier button)
Aug 11, 2007
Aug 11, 2007
613
switch (button) {
614
case DIBI_LEFT:
Jul 10, 2006
Jul 10, 2006
615
return 1;
616
case DIBI_MIDDLE:
Jul 10, 2006
Jul 10, 2006
617
return 2;
618
case DIBI_RIGHT:
Jul 10, 2006
Jul 10, 2006
619
return 3;
Jul 10, 2006
Jul 10, 2006
621
return 0;
Jul 10, 2006
Jul 10, 2006
624
Aug 26, 2008
Aug 26, 2008
625
static DFBEnumerationResult
Jan 11, 2009
Jan 11, 2009
626
627
input_device_cb(DFBInputDeviceID device_id,
DFBInputDeviceDescription desc, void *callbackdata)
Aug 26, 2008
Aug 26, 2008
628
629
{
DFB_DeviceData *devdata = callbackdata;
Jul 24, 2010
Jul 24, 2010
630
#if USE_MULTI_API
Aug 26, 2008
Aug 26, 2008
631
SDL_Keyboard keyboard;
Jul 24, 2010
Jul 24, 2010
632
#endif
Aug 26, 2008
Aug 26, 2008
633
634
635
SDLKey keymap[SDL_NUM_SCANCODES];
if ((desc.caps & DIDTF_KEYBOARD) && device_id == DIDID_KEYBOARD) {
Jul 24, 2010
Jul 24, 2010
636
#if USE_MULTI_API
Aug 26, 2008
Aug 26, 2008
637
SDL_zero(keyboard);
Dec 8, 2008
Dec 8, 2008
638
SDL_AddKeyboard(&keyboard, 0);
Jul 24, 2010
Jul 24, 2010
639
#endif
Dec 8, 2008
Dec 8, 2008
640
641
devdata->keyboard[0].id = device_id;
devdata->keyboard[0].is_generic = 0;
Aug 26, 2008
Aug 26, 2008
642
if (!strncmp("X11", desc.name, 3))
Dec 8, 2008
Dec 8, 2008
643
devdata->keyboard[0].is_generic = 1;
Aug 26, 2008
Aug 26, 2008
644
645
SDL_GetDefaultKeymap(keymap);
Jul 24, 2010
Jul 24, 2010
646
#if USE_MULTI_API
Dec 8, 2008
Dec 8, 2008
647
SDL_SetKeymap(0, 0, keymap, SDL_NUM_SCANCODES);
Jul 24, 2010
Jul 24, 2010
648
649
650
#else
SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES);
#endif
Dec 8, 2008
Dec 8, 2008
651
652
653
devdata->num_keyboard++;
return DFENUM_CANCEL;
Aug 26, 2008
Aug 26, 2008
654
}
Dec 8, 2008
Dec 8, 2008
655
656
657
return DFENUM_OK;
}
Jul 24, 2010
Jul 24, 2010
658
#if USE_MULTI_API
Dec 8, 2008
Dec 8, 2008
659
static DFBEnumerationResult
Jan 11, 2009
Jan 11, 2009
660
661
EnumKeyboards(DFBInputDeviceID device_id,
DFBInputDeviceDescription desc, void *callbackdata)
Dec 8, 2008
Dec 8, 2008
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
{
DFB_DeviceData *devdata = callbackdata;
SDL_Keyboard keyboard;
SDLKey keymap[SDL_NUM_SCANCODES];
if (sys_ids) {
if (device_id >= 0x10)
return DFENUM_OK;
} else {
if (device_id < 0x10)
return DFENUM_OK;
}
if ((desc.caps & DIDTF_KEYBOARD)) {
SDL_zero(keyboard);
SDL_AddKeyboard(&keyboard, devdata->num_keyboard);
devdata->keyboard[devdata->num_keyboard].id = device_id;
devdata->keyboard[devdata->num_keyboard].is_generic = 0;
if (!strncmp("X11", desc.name, 3))
devdata->keyboard[devdata->num_keyboard].is_generic = 1;
SDL_GetDefaultKeymap(keymap);
SDL_SetKeymap(devdata->num_keyboard, 0, keymap, SDL_NUM_SCANCODES);
devdata->num_keyboard++;
}
return DFENUM_OK;
Aug 26, 2008
Aug 26, 2008
687
}
Jul 24, 2010
Jul 24, 2010
688
#endif
Aug 26, 2008
Aug 26, 2008
689
690
691
692
693
694
695
void
DirectFB_InitKeyboard(_THIS)
{
SDL_DFB_DEVICEDATA(_this);
int ret;
Dec 8, 2008
Dec 8, 2008
696
697
698
DirectFB_InitOSKeymap(_this, &oskeymap[0], SDL_arraysize(oskeymap));
devdata->num_keyboard = 0;
Jul 24, 2010
Jul 24, 2010
699
#if USE_MULTI_API
Jan 4, 2009
Jan 4, 2009
700
if (devdata->use_linux_input) {
Dec 8, 2008
Dec 8, 2008
701
sys_ids = 0;
Jan 10, 2009
Jan 10, 2009
702
703
SDL_DFB_CHECK(devdata->dfb->
EnumInputDevices(devdata->dfb, EnumKeyboards, devdata));
Dec 8, 2008
Dec 8, 2008
704
705
if (devdata->num_keyboard == 0) {
sys_ids = 1;
Jan 11, 2009
Jan 11, 2009
706
707
708
SDL_DFB_CHECK(devdata->dfb->EnumInputDevices(devdata->dfb,
EnumKeyboards,
devdata));
Dec 8, 2008
Dec 8, 2008
709
}
Jul 24, 2010
Jul 24, 2010
710
711
712
} else
#else
{
Jan 11, 2009
Jan 11, 2009
713
714
715
SDL_DFB_CHECK(devdata->dfb->EnumInputDevices(devdata->dfb,
input_device_cb,
devdata));
Dec 8, 2008
Dec 8, 2008
716
}
Jul 24, 2010
Jul 24, 2010
717
#endif
Aug 26, 2008
Aug 26, 2008
718
719
}
Aug 31, 2008
Aug 31, 2008
720
721
722
723
724
725
void
DirectFB_QuitKeyboard(_THIS)
{
SDL_DFB_DEVICEDATA(_this);
int ret;
Dec 8, 2008
Dec 8, 2008
726
SDL_KeyboardQuit();
Aug 31, 2008
Aug 31, 2008
727
728
729
}
Aug 11, 2007
Aug 11, 2007
730
#if 0
Aug 26, 2008
Aug 26, 2008
731
/* FIXME: Remove once determined this is not needed in fullscreen mode */
Aug 11, 2007
Aug 11, 2007
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
void
DirectFB_PumpEvents(_THIS)
{
SDL_DFB_DEVICEDATA(_this);
DFBInputEvent evt;
static last_x = 0, last_y = 0;
while (devdata->eventbuffer->GetEvent(devdata->eventbuffer,
DFB_EVENT(&evt)) == DFB_OK) {
SDL_keysym keysym;
DFBInputDeviceModifierMask mod;
if (evt.clazz = DFEC_INPUT) {
if (evt.flags & DIEF_MODIFIERS)
mod = evt.modifiers;
else
mod = 0;
switch (evt.type) {
case DIET_BUTTONPRESS:
Jan 11, 2009
Jan 11, 2009
752
753
754
755
posted +=
SDL_PrivateMouseButton(SDL_PRESSED,
DirectFB_TranslateButton
(evt.button), 0, 0);
Aug 11, 2007
Aug 11, 2007
756
757
break;
case DIET_BUTTONRELEASE:
Jan 11, 2009
Jan 11, 2009
758
759
760
761
posted +=
SDL_PrivateMouseButton(SDL_RELEASED,
DirectFB_TranslateButton
(evt.button), 0, 0);
Aug 11, 2007
Aug 11, 2007
762
763
break;
case DIET_KEYPRESS:
Jan 11, 2009
Jan 11, 2009
764
765
766
767
768
posted +=
SDL_PrivateKeyboard(SDL_PRESSED,
DirectFB_TranslateKey
(evt.key_id, evt.key_symbol,
mod, &keysym));
Aug 11, 2007
Aug 11, 2007
769
770
break;
case DIET_KEYRELEASE:
Jan 11, 2009
Jan 11, 2009
771
772
773
774
775
posted +=
SDL_PrivateKeyboard(SDL_RELEASED,
DirectFB_TranslateKey
(evt.key_id, evt.key_symbol,
mod, &keysym));
Aug 11, 2007
Aug 11, 2007
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
break;
case DIET_AXISMOTION:
if (evt.flags & DIEF_AXISREL) {
if (evt.axis == DIAI_X)
posted +=
SDL_PrivateMouseMotion(0, 1, evt.axisrel, 0);
else if (evt.axis == DIAI_Y)
posted +=
SDL_PrivateMouseMotion(0, 1, 0, evt.axisrel);
} else if (evt.flags & DIEF_AXISABS) {
if (evt.axis == DIAI_X)
last_x = evt.axisabs;
else if (evt.axis == DIAI_Y)
last_y = evt.axisabs;
posted += SDL_PrivateMouseMotion(0, 0, last_x, last_y);
}
break;
default:
;
}
}
}
}
#endif