Mercurial > sdl-ios-xcode
annotate src/video/directfb/SDL_DirectFB_events.c @ 2735:204be4fc2726
Final merge of Google Summer of Code 2008 work...
Port SDL 1.3 to the Nintendo DS
by Darren Alton, mentored by Sam Lantinga
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Wed, 27 Aug 2008 15:10:03 +0000 |
parents | e82a0e3e9b0e |
children | 140a7edcf2bd |
rev | line source |
---|---|
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
1 /* |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
2 SDL - Simple DirectMedia Layer |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
3 Copyright (C) 1997-2006 Sam Lantinga |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
4 |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
5 This library is free software; you can redistribute it and/or |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
6 modify it under the terms of the GNU Lesser General Public |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
7 License as published by the Free Software Foundation; either |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
8 version 2.1 of the License, or (at your option) any later version. |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
9 |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
10 This library is distributed in the hope that it will be useful, |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
13 Lesser General Public License for more details. |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
14 |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
15 You should have received a copy of the GNU Lesser General Public |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
16 License along with this library; if not, write to the Free Software |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
18 |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
19 Sam Lantinga |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
20 slouken@libsdl.org |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
21 */ |
1402
d910939febfa
Use consistent identifiers for the various platforms we support.
Sam Lantinga <slouken@libsdl.org>
parents:
1379
diff
changeset
|
22 #include "SDL_config.h" |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
23 |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
24 /* Handle the event stream, converting DirectFB input events into SDL events */ |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
25 |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
26 #include <directfb.h> |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
27 |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1338
diff
changeset
|
28 #include "../SDL_sysvideo.h" |
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1338
diff
changeset
|
29 #include "../../events/SDL_sysevents.h" |
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1338
diff
changeset
|
30 #include "../../events/SDL_events_c.h" |
2721
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
31 #include "../../events/SDL_keyboard_c.h" |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
32 #include "../../events/scancodes_linux.h" |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
33 #include "SDL_DirectFB_events.h" |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
34 |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
35 /* The translation tables from a DirectFB keycode to a SDL keysym */ |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
36 static SDLKey keymap[256]; |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
37 |
2721
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
38 static SDL_keysym *DirectFB_TranslateKey(_THIS, DFBWindowEvent * evt, |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1775
diff
changeset
|
39 SDL_keysym * keysym); |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
40 |
2721
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
41 static void DirectFB_InitOSKeymap(_THIS); |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
42 static int DirectFB_TranslateButton(DFBInputDeviceButtonIdentifier button); |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
43 |
2721
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
44 static void |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
45 DirectFB_SetContext(_THIS, SDL_WindowID id) |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
46 { |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
47 #if (DIRECTFB_MAJOR_VERSION >= 1) |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
48 /* FIXME: does not work on 1.0/1.2 with radeon driver |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
49 * the approach did work with the matrox driver |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
50 * Perhaps make this depending on env var, e.g. SDLDIRECTFB_SWITCHCONTEXT_SUPPORTED |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
51 */ |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
52 |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
53 if (getenv("SDLDIRECTFB_SWITCHCONTEXT_SUPPORTED") != NULL) { |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
54 SDL_DFB_DEVICEDATA(_this); |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
55 SDL_Window *window = SDL_GetWindowFromID(id); |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
56 SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window); |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
57 DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
58 if (dispdata->vidID >= 0 && dispdata->vidIDinuse) { |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
59 IDirectFBDisplayLayer *lay = NULL; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
60 devdata->dfb->GetDisplayLayer(devdata->dfb, dispdata->vidID, |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
61 &lay); |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
62 if (lay) |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
63 lay->SwitchContext(lay, DFB_TRUE); |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
64 } |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
65 } |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
66 #endif |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
67 |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
68 } |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
69 |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1775
diff
changeset
|
70 void |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
71 DirectFB_PumpEventsWindow(_THIS) |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
72 { |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
73 SDL_DFB_DEVICEDATA(_this); |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
74 DFB_WindowData *p; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
75 DFBWindowEvent evt; |
2721
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
76 char text[5]; |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
77 |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
78 for (p = devdata->firstwin; p != NULL; p = p->next) { |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
79 while (p->eventbuffer->GetEvent(p->eventbuffer, |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
80 DFB_EVENT(&evt)) == DFB_OK) { |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
81 SDL_keysym keysym; |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
82 |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
83 if (evt.clazz = DFEC_WINDOW) { |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
84 switch (evt.type) { |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
85 case DWET_BUTTONDOWN: |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
86 SDL_SendMouseButton(devdata->mouse, SDL_PRESSED, |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
87 DirectFB_TranslateButton(evt.button)); |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
88 break; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
89 case DWET_BUTTONUP: |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
90 SDL_SendMouseButton(devdata->mouse, SDL_RELEASED, |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
91 DirectFB_TranslateButton(evt.button)); |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
92 break; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
93 case DWET_MOTION: |
2259
1e690901ecd7
Date: Fri, 17 Aug 2007 01:12:31 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2226
diff
changeset
|
94 SDL_SendMouseMotion(devdata->mouse, 0, evt.cx, evt.cy); |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
95 break; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
96 case DWET_KEYDOWN: |
2721
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
97 DirectFB_TranslateKey(_this, &evt, &keysym); |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
98 SDL_SendKeyboardKey(devdata->keyboard, SDL_PRESSED, |
2721
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
99 keysym.scancode); |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
100 if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) { |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
101 SDL_memcpy(text, &keysym.unicode, 4); |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
102 text[4] = 0; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
103 if (*text) { |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
104 SDL_SendKeyboardText(devdata->keyboard, text); |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
105 } |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
106 } |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
107 break; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
108 case DWET_KEYUP: |
2721
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
109 DirectFB_TranslateKey(_this, &evt, &keysym); |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
110 SDL_SendKeyboardKey(devdata->keyboard, SDL_RELEASED, |
2721
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
111 keysym.scancode); |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
112 break; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
113 case DWET_POSITION_SIZE: |
2259
1e690901ecd7
Date: Fri, 17 Aug 2007 01:12:31 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2226
diff
changeset
|
114 SDL_SendWindowEvent(p->id, SDL_WINDOWEVENT_MOVED, evt.x, |
1e690901ecd7
Date: Fri, 17 Aug 2007 01:12:31 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2226
diff
changeset
|
115 evt.y); |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
116 SDL_SendWindowEvent(p->id, SDL_WINDOWEVENT_RESIZED, evt.w, |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
117 evt.h); |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
118 break; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
119 case DWET_POSITION: |
2259
1e690901ecd7
Date: Fri, 17 Aug 2007 01:12:31 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2226
diff
changeset
|
120 SDL_SendWindowEvent(p->id, SDL_WINDOWEVENT_MOVED, evt.x, |
1e690901ecd7
Date: Fri, 17 Aug 2007 01:12:31 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2226
diff
changeset
|
121 evt.y); |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
122 break; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
123 case DWET_SIZE: |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
124 SDL_SendWindowEvent(p->id, SDL_WINDOWEVENT_RESIZED, evt.w, |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
125 evt.h); |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
126 break; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
127 case DWET_CLOSE: |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
128 SDL_SendWindowEvent(p->id, SDL_WINDOWEVENT_CLOSE, 0, 0); |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
129 break; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
130 case DWET_GOTFOCUS: |
2721
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
131 DirectFB_SetContext(_this, p->id); |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
132 SDL_SetKeyboardFocus(devdata->keyboard, p->id); |
2721
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
133 SDL_SendWindowEvent(p->id, SDL_WINDOWEVENT_FOCUS_GAINED, |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
134 0, 0); |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
135 break; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
136 case DWET_LOSTFOCUS: |
2721
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
137 SDL_SendWindowEvent(p->id, SDL_WINDOWEVENT_FOCUS_LOST, 0, |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
138 0); |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
139 SDL_SetKeyboardFocus(devdata->keyboard, 0); |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
140 break; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
141 case DWET_ENTER: |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
142 //SDL_DirectFB_ReshowCursor(_this, 0); |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
143 SDL_SetMouseFocus(devdata->mouse, p->id); |
2721
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
144 SDL_SendWindowEvent(p->id, SDL_WINDOWEVENT_ENTER, 0, 0); |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
145 break; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
146 case DWET_LEAVE: |
2721
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
147 SDL_SendWindowEvent(p->id, SDL_WINDOWEVENT_LEAVE, 0, 0); |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
148 SDL_SetMouseFocus(devdata->mouse, 0); |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
149 //SDL_DirectFB_ReshowCursor(_this, 1); |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
150 break; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
151 default: |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
152 ; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
153 } |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
154 } |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
155 } |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
156 } |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
157 } |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
158 |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1775
diff
changeset
|
159 void |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1775
diff
changeset
|
160 DirectFB_InitOSKeymap(_THIS) |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
161 { |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1775
diff
changeset
|
162 int i; |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1775
diff
changeset
|
163 |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1775
diff
changeset
|
164 /* Initialize the DirectFB key translation table */ |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1775
diff
changeset
|
165 for (i = 0; i < SDL_arraysize(keymap); ++i) |
2721
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
166 keymap[i] = SDL_SCANCODE_UNKNOWN; |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1775
diff
changeset
|
167 |
2721
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
168 keymap[DIKI_A - DIKI_UNKNOWN] = SDL_SCANCODE_A; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
169 keymap[DIKI_B - DIKI_UNKNOWN] = SDL_SCANCODE_B; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
170 keymap[DIKI_C - DIKI_UNKNOWN] = SDL_SCANCODE_C; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
171 keymap[DIKI_D - DIKI_UNKNOWN] = SDL_SCANCODE_D; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
172 keymap[DIKI_E - DIKI_UNKNOWN] = SDL_SCANCODE_E; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
173 keymap[DIKI_F - DIKI_UNKNOWN] = SDL_SCANCODE_F; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
174 keymap[DIKI_G - DIKI_UNKNOWN] = SDL_SCANCODE_G; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
175 keymap[DIKI_H - DIKI_UNKNOWN] = SDL_SCANCODE_H; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
176 keymap[DIKI_I - DIKI_UNKNOWN] = SDL_SCANCODE_I; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
177 keymap[DIKI_J - DIKI_UNKNOWN] = SDL_SCANCODE_J; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
178 keymap[DIKI_K - DIKI_UNKNOWN] = SDL_SCANCODE_K; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
179 keymap[DIKI_L - DIKI_UNKNOWN] = SDL_SCANCODE_L; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
180 keymap[DIKI_M - DIKI_UNKNOWN] = SDL_SCANCODE_M; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
181 keymap[DIKI_N - DIKI_UNKNOWN] = SDL_SCANCODE_N; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
182 keymap[DIKI_O - DIKI_UNKNOWN] = SDL_SCANCODE_O; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
183 keymap[DIKI_P - DIKI_UNKNOWN] = SDL_SCANCODE_P; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
184 keymap[DIKI_Q - DIKI_UNKNOWN] = SDL_SCANCODE_Q; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
185 keymap[DIKI_R - DIKI_UNKNOWN] = SDL_SCANCODE_R; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
186 keymap[DIKI_S - DIKI_UNKNOWN] = SDL_SCANCODE_S; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
187 keymap[DIKI_T - DIKI_UNKNOWN] = SDL_SCANCODE_T; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
188 keymap[DIKI_U - DIKI_UNKNOWN] = SDL_SCANCODE_U; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
189 keymap[DIKI_V - DIKI_UNKNOWN] = SDL_SCANCODE_V; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
190 keymap[DIKI_W - DIKI_UNKNOWN] = SDL_SCANCODE_W; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
191 keymap[DIKI_X - DIKI_UNKNOWN] = SDL_SCANCODE_X; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
192 keymap[DIKI_Y - DIKI_UNKNOWN] = SDL_SCANCODE_Y; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
193 keymap[DIKI_Z - DIKI_UNKNOWN] = SDL_SCANCODE_Z; |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
194 |
2721
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
195 keymap[DIKI_0 - DIKI_UNKNOWN] = SDL_SCANCODE_0; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
196 keymap[DIKI_1 - DIKI_UNKNOWN] = SDL_SCANCODE_1; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
197 keymap[DIKI_2 - DIKI_UNKNOWN] = SDL_SCANCODE_2; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
198 keymap[DIKI_3 - DIKI_UNKNOWN] = SDL_SCANCODE_3; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
199 keymap[DIKI_4 - DIKI_UNKNOWN] = SDL_SCANCODE_4; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
200 keymap[DIKI_5 - DIKI_UNKNOWN] = SDL_SCANCODE_5; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
201 keymap[DIKI_6 - DIKI_UNKNOWN] = SDL_SCANCODE_6; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
202 keymap[DIKI_7 - DIKI_UNKNOWN] = SDL_SCANCODE_7; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
203 keymap[DIKI_8 - DIKI_UNKNOWN] = SDL_SCANCODE_8; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
204 keymap[DIKI_9 - DIKI_UNKNOWN] = SDL_SCANCODE_9; |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1775
diff
changeset
|
205 |
2721
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
206 keymap[DIKI_F1 - DIKI_UNKNOWN] = SDL_SCANCODE_F1; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
207 keymap[DIKI_F2 - DIKI_UNKNOWN] = SDL_SCANCODE_F2; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
208 keymap[DIKI_F3 - DIKI_UNKNOWN] = SDL_SCANCODE_F3; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
209 keymap[DIKI_F4 - DIKI_UNKNOWN] = SDL_SCANCODE_F4; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
210 keymap[DIKI_F5 - DIKI_UNKNOWN] = SDL_SCANCODE_F5; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
211 keymap[DIKI_F6 - DIKI_UNKNOWN] = SDL_SCANCODE_F6; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
212 keymap[DIKI_F7 - DIKI_UNKNOWN] = SDL_SCANCODE_F7; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
213 keymap[DIKI_F8 - DIKI_UNKNOWN] = SDL_SCANCODE_F8; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
214 keymap[DIKI_F9 - DIKI_UNKNOWN] = SDL_SCANCODE_F9; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
215 keymap[DIKI_F10 - DIKI_UNKNOWN] = SDL_SCANCODE_F10; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
216 keymap[DIKI_F11 - DIKI_UNKNOWN] = SDL_SCANCODE_F11; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
217 keymap[DIKI_F12 - DIKI_UNKNOWN] = SDL_SCANCODE_F12; |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1775
diff
changeset
|
218 |
2721
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
219 keymap[DIKI_ESCAPE - DIKI_UNKNOWN] = SDL_SCANCODE_ESCAPE; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
220 keymap[DIKI_LEFT - DIKI_UNKNOWN] = SDL_SCANCODE_LEFT; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
221 keymap[DIKI_RIGHT - DIKI_UNKNOWN] = SDL_SCANCODE_RIGHT; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
222 keymap[DIKI_UP - DIKI_UNKNOWN] = SDL_SCANCODE_UP; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
223 keymap[DIKI_DOWN - DIKI_UNKNOWN] = SDL_SCANCODE_DOWN; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
224 keymap[DIKI_CONTROL_L - DIKI_UNKNOWN] = SDL_SCANCODE_LCTRL; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
225 keymap[DIKI_CONTROL_R - DIKI_UNKNOWN] = SDL_SCANCODE_RCTRL; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
226 keymap[DIKI_SHIFT_L - DIKI_UNKNOWN] = SDL_SCANCODE_LSHIFT; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
227 keymap[DIKI_SHIFT_R - DIKI_UNKNOWN] = SDL_SCANCODE_RSHIFT; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
228 keymap[DIKI_ALT_L - DIKI_UNKNOWN] = SDL_SCANCODE_LALT; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
229 keymap[DIKI_ALT_R - DIKI_UNKNOWN] = SDL_SCANCODE_RALT; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
230 keymap[DIKI_META_L - DIKI_UNKNOWN] = SDL_SCANCODE_LGUI; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
231 keymap[DIKI_META_R - DIKI_UNKNOWN] = SDL_SCANCODE_RGUI; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
232 keymap[DIKI_SUPER_L - DIKI_UNKNOWN] = SDL_SCANCODE_APPLICATION; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
233 keymap[DIKI_SUPER_R - DIKI_UNKNOWN] = SDL_SCANCODE_APPLICATION; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
234 //FIXME:Do we read hyper keys ? |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
235 //keymap[DIKI_HYPER_L - DIKI_UNKNOWN] = SDL_SCANCODE_APPLICATION; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
236 //keymap[DIKI_HYPER_R - DIKI_UNKNOWN] = SDL_SCANCODE_APPLICATION; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
237 keymap[DIKI_TAB - DIKI_UNKNOWN] = SDL_SCANCODE_TAB; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
238 keymap[DIKI_ENTER - DIKI_UNKNOWN] = SDL_SCANCODE_RETURN; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
239 keymap[DIKI_SPACE - DIKI_UNKNOWN] = SDL_SCANCODE_SPACE; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
240 keymap[DIKI_BACKSPACE - DIKI_UNKNOWN] = SDL_SCANCODE_BACKSPACE; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
241 keymap[DIKI_INSERT - DIKI_UNKNOWN] = SDL_SCANCODE_INSERT; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
242 keymap[DIKI_DELETE - DIKI_UNKNOWN] = SDL_SCANCODE_DELETE; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
243 keymap[DIKI_HOME - DIKI_UNKNOWN] = SDL_SCANCODE_HOME; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
244 keymap[DIKI_END - DIKI_UNKNOWN] = SDL_SCANCODE_END; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
245 keymap[DIKI_PAGE_UP - DIKI_UNKNOWN] = SDL_SCANCODE_PAGEUP; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
246 keymap[DIKI_PAGE_DOWN - DIKI_UNKNOWN] = SDL_SCANCODE_PAGEDOWN; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
247 keymap[DIKI_CAPS_LOCK - DIKI_UNKNOWN] = SDL_SCANCODE_CAPSLOCK; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
248 keymap[DIKI_NUM_LOCK - DIKI_UNKNOWN] = SDL_SCANCODE_NUMLOCKCLEAR; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
249 keymap[DIKI_SCROLL_LOCK - DIKI_UNKNOWN] = SDL_SCANCODE_SCROLLLOCK; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
250 keymap[DIKI_PRINT - DIKI_UNKNOWN] = SDL_SCANCODE_PRINTSCREEN; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
251 keymap[DIKI_PAUSE - DIKI_UNKNOWN] = SDL_SCANCODE_PAUSE; |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
252 |
2721
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
253 keymap[DIKI_KP_EQUAL - DIKI_UNKNOWN] = SDL_SCANCODE_KP_EQUALS; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
254 keymap[DIKI_KP_DECIMAL - DIKI_UNKNOWN] = SDL_SCANCODE_KP_PERIOD; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
255 keymap[DIKI_KP_0 - DIKI_UNKNOWN] = SDL_SCANCODE_KP_0; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
256 keymap[DIKI_KP_1 - DIKI_UNKNOWN] = SDL_SCANCODE_KP_1; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
257 keymap[DIKI_KP_2 - DIKI_UNKNOWN] = SDL_SCANCODE_KP_2; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
258 keymap[DIKI_KP_3 - DIKI_UNKNOWN] = SDL_SCANCODE_KP_3; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
259 keymap[DIKI_KP_4 - DIKI_UNKNOWN] = SDL_SCANCODE_KP_4; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
260 keymap[DIKI_KP_5 - DIKI_UNKNOWN] = SDL_SCANCODE_KP_5; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
261 keymap[DIKI_KP_6 - DIKI_UNKNOWN] = SDL_SCANCODE_KP_6; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
262 keymap[DIKI_KP_7 - DIKI_UNKNOWN] = SDL_SCANCODE_KP_7; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
263 keymap[DIKI_KP_8 - DIKI_UNKNOWN] = SDL_SCANCODE_KP_8; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
264 keymap[DIKI_KP_9 - DIKI_UNKNOWN] = SDL_SCANCODE_KP_9; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
265 keymap[DIKI_KP_DIV - DIKI_UNKNOWN] = SDL_SCANCODE_KP_DIVIDE; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
266 keymap[DIKI_KP_MULT - DIKI_UNKNOWN] = SDL_SCANCODE_KP_MULTIPLY; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
267 keymap[DIKI_KP_MINUS - DIKI_UNKNOWN] = SDL_SCANCODE_KP_MINUS; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
268 keymap[DIKI_KP_PLUS - DIKI_UNKNOWN] = SDL_SCANCODE_KP_PLUS; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
269 keymap[DIKI_KP_ENTER - DIKI_UNKNOWN] = SDL_SCANCODE_KP_ENTER; |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
270 |
2721
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
271 keymap[DIKI_QUOTE_LEFT - DIKI_UNKNOWN] = SDL_SCANCODE_GRAVE; /* TLDE */ |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
272 keymap[DIKI_MINUS_SIGN - DIKI_UNKNOWN] = SDL_SCANCODE_MINUS; /* AE11 */ |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
273 keymap[DIKI_EQUALS_SIGN - DIKI_UNKNOWN] = SDL_SCANCODE_EQUALS; /* AE12 */ |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
274 keymap[DIKI_BRACKET_LEFT - DIKI_UNKNOWN] = SDL_SCANCODE_RIGHTBRACKET; /* AD11 */ |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
275 keymap[DIKI_BRACKET_RIGHT - DIKI_UNKNOWN] = SDL_SCANCODE_LEFTBRACKET; /* AD12 */ |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
276 keymap[DIKI_BACKSLASH - DIKI_UNKNOWN] = SDL_SCANCODE_BACKSLASH; /* BKSL */ |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
277 keymap[DIKI_SEMICOLON - DIKI_UNKNOWN] = SDL_SCANCODE_SEMICOLON; /* AC10 */ |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
278 keymap[DIKI_QUOTE_RIGHT - DIKI_UNKNOWN] = SDL_SCANCODE_APOSTROPHE; /* AC11 */ |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
279 keymap[DIKI_COMMA - DIKI_UNKNOWN] = SDL_SCANCODE_COMMA; /* AB08 */ |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
280 keymap[DIKI_PERIOD - DIKI_UNKNOWN] = SDL_SCANCODE_PERIOD; /* AB09 */ |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
281 keymap[DIKI_SLASH - DIKI_UNKNOWN] = SDL_SCANCODE_SLASH; /* AB10 */ |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
282 keymap[DIKI_LESS_SIGN - DIKI_UNKNOWN] = SDL_SCANCODE_NONUSBACKSLASH; /* 103rd */ |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
283 |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
284 } |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
285 |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1775
diff
changeset
|
286 static SDL_keysym * |
2721
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
287 DirectFB_TranslateKey(_THIS, DFBWindowEvent * evt, SDL_keysym * keysym) |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
288 { |
2721
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
289 SDL_DFB_DEVICEDATA(_this); |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
290 |
2721
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
291 if (evt->key_code >= 0 |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
292 && evt->key_code < SDL_arraysize(linux_scancode_table)) |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
293 keysym->scancode = linux_scancode_table[evt->key_code]; // key_id; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
294 else |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
295 keysym->scancode = SDL_SCANCODE_UNKNOWN; |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
296 |
2721
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
297 if (keysym->scancode == SDL_SCANCODE_UNKNOWN || devdata->kbdgeneric) { |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
298 if (evt->key_id - DIKI_UNKNOWN < SDL_arraysize(keymap)) |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
299 keysym->scancode = keymap[evt->key_id - DIKI_UNKNOWN]; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
300 else |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
301 keysym->scancode = SDL_SCANCODE_UNKNOWN; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
302 } |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
303 |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1775
diff
changeset
|
304 keysym->unicode = |
2721
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
305 (DFB_KEY_TYPE(evt->key_symbol) == DIKT_UNICODE) ? evt->key_symbol : 0; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
306 if (keysym->unicode == 0 |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
307 && (evt->key_symbol > 0 && evt->key_symbol < 255)) |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
308 keysym->unicode = evt->key_symbol; |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
309 |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1775
diff
changeset
|
310 return keysym; |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
311 } |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
312 |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1775
diff
changeset
|
313 static int |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
314 DirectFB_TranslateButton(DFBInputDeviceButtonIdentifier button) |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
315 { |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
316 switch (button) { |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
317 case DIBI_LEFT: |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1775
diff
changeset
|
318 return 1; |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
319 case DIBI_MIDDLE: |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1775
diff
changeset
|
320 return 2; |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
321 case DIBI_RIGHT: |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1775
diff
changeset
|
322 return 3; |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
323 default: |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1775
diff
changeset
|
324 return 0; |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
325 } |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
326 } |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1775
diff
changeset
|
327 |
2721
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
328 static DFBEnumerationResult |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
329 input_device_cb(DFBInputDeviceID device_id, DFBInputDeviceDescription desc, |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
330 void *callbackdata) |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
331 { |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
332 DFB_DeviceData *devdata = callbackdata; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
333 SDL_Keyboard keyboard; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
334 SDL_scancode scancode; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
335 SDLKey keymap[SDL_NUM_SCANCODES]; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
336 |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
337 if ((desc.caps & DIDTF_KEYBOARD) && device_id == DIDID_KEYBOARD) { |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
338 SDL_zero(keyboard); |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
339 devdata->keyboard = SDL_AddKeyboard(&keyboard, -1); |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
340 if (!strncmp("X11", desc.name, 3)) |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
341 devdata->kbdgeneric = 1; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
342 |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
343 SDL_GetDefaultKeymap(keymap); |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
344 SDL_SetKeymap(devdata->keyboard, 0, keymap, SDL_NUM_SCANCODES); |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
345 } |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
346 return DFB_OK; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
347 } |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
348 |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
349 void |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
350 DirectFB_InitKeyboard(_THIS) |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
351 { |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
352 SDL_DFB_DEVICEDATA(_this); |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
353 int ret; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
354 |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
355 DirectFB_InitOSKeymap(_this); |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
356 |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
357 devdata->kbdgeneric = 0; |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
358 |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
359 SDL_DFB_CHECK(devdata->dfb-> |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
360 EnumInputDevices(devdata->dfb, input_device_cb, devdata)); |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
361 } |
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
362 |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
363 #if 0 |
2721
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
364 /* FIXME: Remove once determined this is not needed in fullscreen mode */ |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
365 void |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
366 DirectFB_PumpEvents(_THIS) |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
367 { |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
368 SDL_DFB_DEVICEDATA(_this); |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
369 DFBInputEvent evt; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
370 static last_x = 0, last_y = 0; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
371 |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
372 while (devdata->eventbuffer->GetEvent(devdata->eventbuffer, |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
373 DFB_EVENT(&evt)) == DFB_OK) { |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
374 SDL_keysym keysym; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
375 DFBInputDeviceModifierMask mod; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
376 |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
377 if (evt.clazz = DFEC_INPUT) { |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
378 if (evt.flags & DIEF_MODIFIERS) |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
379 mod = evt.modifiers; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
380 else |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
381 mod = 0; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
382 |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
383 switch (evt.type) { |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
384 case DIET_BUTTONPRESS: |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
385 posted += SDL_PrivateMouseButton(SDL_PRESSED, |
2735
204be4fc2726
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2721
diff
changeset
|
386 DirectFB_TranslateButton |
204be4fc2726
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2721
diff
changeset
|
387 (evt.button), 0, 0); |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
388 break; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
389 case DIET_BUTTONRELEASE: |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
390 posted += SDL_PrivateMouseButton(SDL_RELEASED, |
2735
204be4fc2726
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2721
diff
changeset
|
391 DirectFB_TranslateButton |
204be4fc2726
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2721
diff
changeset
|
392 (evt.button), 0, 0); |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
393 break; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
394 case DIET_KEYPRESS: |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
395 posted += SDL_PrivateKeyboard(SDL_PRESSED, |
2735
204be4fc2726
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2721
diff
changeset
|
396 DirectFB_TranslateKey |
204be4fc2726
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2721
diff
changeset
|
397 (evt.key_id, evt.key_symbol, |
204be4fc2726
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2721
diff
changeset
|
398 mod, &keysym)); |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
399 break; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
400 case DIET_KEYRELEASE: |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
401 posted += SDL_PrivateKeyboard(SDL_RELEASED, |
2735
204be4fc2726
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2721
diff
changeset
|
402 DirectFB_TranslateKey |
204be4fc2726
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2721
diff
changeset
|
403 (evt.key_id, evt.key_symbol, |
204be4fc2726
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2721
diff
changeset
|
404 mod, &keysym)); |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
405 break; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
406 case DIET_AXISMOTION: |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
407 if (evt.flags & DIEF_AXISREL) { |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
408 if (evt.axis == DIAI_X) |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
409 posted += |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
410 SDL_PrivateMouseMotion(0, 1, evt.axisrel, 0); |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
411 else if (evt.axis == DIAI_Y) |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
412 posted += |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
413 SDL_PrivateMouseMotion(0, 1, 0, evt.axisrel); |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
414 } else if (evt.flags & DIEF_AXISABS) { |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
415 if (evt.axis == DIAI_X) |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
416 last_x = evt.axisabs; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
417 else if (evt.axis == DIAI_Y) |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
418 last_y = evt.axisabs; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
419 posted += SDL_PrivateMouseMotion(0, 0, last_x, last_y); |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
420 } |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
421 break; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
422 default: |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
423 ; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
424 } |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
425 } |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
426 } |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
427 } |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
428 #endif |