Mercurial > sdl-ios-xcode
annotate src/video/photon/SDL_photon_input.c @ 3690:e431b888ac6c
Fixed compilation on iPhone
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Thu, 21 Jan 2010 16:12:24 +0000 |
parents | 64ce267332c6 |
children | f7b03b6838cb |
rev | line source |
---|---|
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
1 /* |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
2 SDL - Simple DirectMedia Layer |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
3 Copyright (C) 1997-2009 Sam Lantinga |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
4 |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
5 This library is free software; you can redistribute it and/or |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
6 modify it under the terms of the GNU Lesser General Public |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
7 License as published by the Free Software Foundation; either |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
8 version 2.1 of the License, or (at your option) any later version. |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
9 |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
10 This library is distributed in the hope that it will be useful, |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
13 Lesser General Public License for more details. |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
14 |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
15 You should have received a copy of the GNU Lesser General Public |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
16 License along with this library; if not, write to the Free Software |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
18 |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
19 Sam Lantinga |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
20 slouken@libsdl.org |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
21 |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
22 QNX Photon GUI SDL driver |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
23 Copyright (C) 2009 Mike Gorchak |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
24 (mike@malva.ua, lestat@i.com.ua) |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
25 */ |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
26 |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
27 #include "SDL_photon_input.h" |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
28 |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
29 #include "SDL_config.h" |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
30 #include "SDL_events.h" |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
31 #include "../../events/SDL_mouse_c.h" |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
32 #include "../../events/SDL_keyboard_c.h" |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
33 |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
34 #include "SDL_photon_keycodes.h" |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
35 |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
36 /* Mouse related functions */ |
3139 | 37 SDL_Cursor *photon_createcursor(SDL_Surface * surface, int hot_x, int hot_y); |
38 int photon_showcursor(SDL_Cursor * cursor); | |
39 void photon_movecursor(SDL_Cursor * cursor); | |
40 void photon_freecursor(SDL_Cursor * cursor); | |
3685
64ce267332c6
Switched from SDL_WindowID and SDL_TextureID to SDL_Window* and SDL_Texture* for code simplicity and improved performance.
Sam Lantinga <slouken@libsdl.org>
parents:
3500
diff
changeset
|
41 void photon_warpmouse(SDL_Mouse * mouse, SDL_Window * window, int x, int y); |
3139 | 42 void photon_freemouse(SDL_Mouse * mouse); |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
43 |
3139 | 44 int32_t |
45 photon_addinputdevices(_THIS) | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
46 { |
3139 | 47 SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata; |
48 SDL_DisplayData *didata = NULL; | |
49 struct SDL_Mouse photon_mouse; | |
50 SDL_MouseData *mdata = NULL; | |
51 SDL_Keyboard photon_keyboard; | |
52 SDLKey keymap[SDL_NUM_SCANCODES]; | |
53 uint32_t it; | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
54 |
3139 | 55 for (it = 0; it < _this->num_displays; it++) { |
3500
4b594623401b
Work in progress on multi-display support:
Sam Lantinga <slouken@libsdl.org>
parents:
3419
diff
changeset
|
56 SDL_VideoDisplay *display = &_this->displays[it]; |
4b594623401b
Work in progress on multi-display support:
Sam Lantinga <slouken@libsdl.org>
parents:
3419
diff
changeset
|
57 |
3139 | 58 /* Clear SDL mouse structure */ |
59 SDL_memset(&photon_mouse, 0x00, sizeof(struct SDL_Mouse)); | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
60 |
3139 | 61 /* Allocate SDL_MouseData structure */ |
62 mdata = (SDL_MouseData *) SDL_calloc(1, sizeof(SDL_MouseData)); | |
63 if (mdata == NULL) { | |
64 SDL_OutOfMemory(); | |
65 return -1; | |
66 } | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
67 |
3139 | 68 /* Mark this mouse with ID 0 */ |
69 photon_mouse.id = it; | |
70 photon_mouse.driverdata = (void *) mdata; | |
71 photon_mouse.CreateCursor = photon_createcursor; | |
72 photon_mouse.ShowCursor = photon_showcursor; | |
73 photon_mouse.MoveCursor = photon_movecursor; | |
74 photon_mouse.FreeCursor = photon_freecursor; | |
75 photon_mouse.WarpMouse = photon_warpmouse; | |
76 photon_mouse.FreeMouse = photon_freemouse; | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
77 |
3139 | 78 /* Get display data */ |
3500
4b594623401b
Work in progress on multi-display support:
Sam Lantinga <slouken@libsdl.org>
parents:
3419
diff
changeset
|
79 didata = (SDL_DisplayData *) display->driverdata; |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
80 |
3139 | 81 /* Store SDL_DisplayData pointer in the mouse driver internals */ |
82 mdata->didata = didata; | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
83 |
3139 | 84 /* Register mouse cursor in SDL */ |
85 SDL_AddMouse(&photon_mouse, "Photon mouse cursor", 0, 0, 1); | |
86 } | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
87 |
3139 | 88 /* Photon maps all keyboards to one */ |
89 SDL_zero(photon_keyboard); | |
90 SDL_AddKeyboard(&photon_keyboard, -1); | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
91 |
3139 | 92 /* Add default scancode to key mapping */ |
93 SDL_GetDefaultKeymap(keymap); | |
94 SDL_SetKeymap(0, 0, keymap, SDL_NUM_SCANCODES); | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
95 |
3139 | 96 return 0; |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
97 } |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
98 |
3139 | 99 int32_t |
100 photon_delinputdevices(_THIS) | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
101 { |
3139 | 102 /* Destroy all of the mice */ |
103 SDL_MouseQuit(); | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
104 } |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
105 |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
106 /*****************************************************************************/ |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
107 /* Photon mouse related functions */ |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
108 /*****************************************************************************/ |
3139 | 109 SDL_Cursor * |
110 photon_createcursor(SDL_Surface * surface, int hot_x, int hot_y) | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
111 { |
3139 | 112 PhCursorDef_t *internal_cursor; |
113 SDL_Cursor *sdl_cursor; | |
114 uint8_t *image0 = NULL; | |
115 uint8_t *image1 = NULL; | |
116 uint32_t it; | |
117 uint32_t jt; | |
118 uint32_t shape_color; | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
119 |
3139 | 120 /* SDL converts monochrome cursor shape to 32bpp cursor shape */ |
121 /* and we must convert it back to monochrome, this routine handles */ | |
122 /* 24/32bpp surfaces only */ | |
123 if ((surface->format->BitsPerPixel != 32) | |
124 && (surface->format->BitsPerPixel != 24)) { | |
125 SDL_SetError("Photon: Cursor shape is not 24/32bpp."); | |
126 return NULL; | |
127 } | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
128 |
3139 | 129 /* Checking data parameters */ |
130 if ((surface->w == 0) || (surface->h == 0)) { | |
131 SDL_SetError("Photon: Cursor shape dimensions are zero"); | |
132 return NULL; | |
133 } | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
134 |
3139 | 135 /* Allocate memory for the internal cursor format */ |
136 internal_cursor = (PhCursorDef_t *) SDL_calloc(1, sizeof(PhCursorDef_t) + | |
137 ((((surface->w + | |
138 7) >> 3) * | |
139 surface->h) * 2) - 1); | |
140 if (internal_cursor == NULL) { | |
141 SDL_OutOfMemory(); | |
142 return NULL; | |
143 } | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
144 |
3139 | 145 /* Allocate memory for the SDL cursor */ |
146 sdl_cursor = (SDL_Cursor *) SDL_calloc(1, sizeof(SDL_Cursor)); | |
147 if (sdl_cursor == NULL) { | |
148 SDL_free(internal_cursor); | |
149 SDL_OutOfMemory(); | |
150 return NULL; | |
151 } | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
152 |
3139 | 153 /* Set driverdata as photon cursor format */ |
154 image0 = (uint8_t *) internal_cursor; | |
155 image0 += sizeof(PhCursorDef_t) - 1; | |
156 image1 = image0; | |
157 image1 += ((surface->w + 7) >> 3) * surface->h; | |
158 sdl_cursor->driverdata = (void *) internal_cursor; | |
159 internal_cursor->hdr.len = | |
160 (sizeof(PhCursorDef_t) - sizeof(PhRegionDataHdr_t)) + | |
161 ((((surface->w + 7) >> 3) * surface->h) * 2) - 1; | |
162 internal_cursor->hdr.type = Ph_RDATA_CURSOR; | |
163 internal_cursor->size1.x = surface->w; | |
164 internal_cursor->size1.y = surface->h; | |
165 internal_cursor->size2.x = surface->w; | |
166 internal_cursor->size2.y = surface->h; | |
3419 | 167 internal_cursor->offset1.x = -hot_x; |
168 internal_cursor->offset1.y = -hot_y; | |
169 internal_cursor->offset2.x = -hot_x; | |
170 internal_cursor->offset2.y = -hot_y; | |
3139 | 171 internal_cursor->bytesperline1 = ((surface->w + 7) >> 3); |
172 internal_cursor->bytesperline2 = ((surface->w + 7) >> 3); | |
173 internal_cursor->color1 = (SDL_PHOTON_MOUSE_COLOR_BLACK) & 0x00FFFFFF; | |
174 internal_cursor->color2 = (SDL_PHOTON_MOUSE_COLOR_WHITE) & 0x00FFFFFF; | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
175 |
3139 | 176 /* Convert cursor from 32 bpp */ |
177 for (jt = 0; jt < surface->h; jt++) { | |
178 for (it = 0; it < surface->w; it++) { | |
179 shape_color = | |
180 *((uint32_t *) ((uint8_t *) surface->pixels + | |
181 jt * surface->pitch + | |
182 it * surface->format->BytesPerPixel)); | |
183 switch (shape_color) { | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
184 case SDL_PHOTON_MOUSE_COLOR_BLACK: |
3139 | 185 { |
186 *(image0 + jt * (internal_cursor->bytesperline1) + | |
187 (it >> 3)) |= 0x80 >> (it % 8); | |
188 *(image1 + jt * (internal_cursor->bytesperline2) + | |
189 (it >> 3)) &= ~(0x80 >> (it % 8)); | |
190 } | |
191 break; | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
192 case SDL_PHOTON_MOUSE_COLOR_WHITE: |
3139 | 193 { |
194 *(image0 + jt * (internal_cursor->bytesperline1) + | |
195 (it >> 3)) &= ~(0x80 >> (it % 8)); | |
196 *(image1 + jt * (internal_cursor->bytesperline2) + | |
197 (it >> 3)) |= 0x80 >> (it % 8); | |
198 } | |
199 break; | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
200 case SDL_PHOTON_MOUSE_COLOR_TRANS: |
3139 | 201 { |
202 *(image0 + jt * (internal_cursor->bytesperline1) + | |
203 (it >> 3)) &= ~(0x80 >> (it % 8)); | |
204 *(image1 + jt * (internal_cursor->bytesperline2) + | |
205 (it >> 3)) &= ~(0x80 >> (it % 8)); | |
206 } | |
207 break; | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
208 default: |
3139 | 209 { |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
210 /* The same as transparent color, must not happen */ |
3139 | 211 *(image0 + jt * (internal_cursor->bytesperline1) + |
212 (it >> 3)) &= ~(0x80 >> (it % 8)); | |
213 *(image1 + jt * (internal_cursor->bytesperline2) + | |
214 (it >> 3)) &= ~(0x80 >> (it % 8)); | |
215 } | |
216 break; | |
217 } | |
218 } | |
219 } | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
220 |
3139 | 221 return sdl_cursor; |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
222 } |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
223 |
3139 | 224 int |
225 photon_showcursor(SDL_Cursor * cursor) | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
226 { |
3139 | 227 SDL_VideoDisplay *display; |
228 SDL_DisplayData *didata; | |
229 SDL_Window *window; | |
230 SDL_WindowData *wdata; | |
231 PhCursorDef_t *internal_cursor; | |
232 int32_t status; | |
233 | |
234 /* Get current window id */ | |
3685
64ce267332c6
Switched from SDL_WindowID and SDL_TextureID to SDL_Window* and SDL_Texture* for code simplicity and improved performance.
Sam Lantinga <slouken@libsdl.org>
parents:
3500
diff
changeset
|
235 window = SDL_GetFocusWindow(); |
64ce267332c6
Switched from SDL_WindowID and SDL_TextureID to SDL_Window* and SDL_Texture* for code simplicity and improved performance.
Sam Lantinga <slouken@libsdl.org>
parents:
3500
diff
changeset
|
236 if (!window) { |
3139 | 237 SDL_MouseData *mdata = NULL; |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
238 |
3139 | 239 /* If there is no current window, then someone calls this function */ |
240 /* to set global mouse settings during SDL initialization */ | |
241 if (cursor != NULL) { | |
242 /* Store cursor for future usage */ | |
243 mdata = (SDL_MouseData *) cursor->mouse->driverdata; | |
244 didata = (SDL_DisplayData *) mdata->didata; | |
245 internal_cursor = (PhCursorDef_t *) cursor->driverdata; | |
246 | |
247 if (didata->cursor_size >= | |
248 (internal_cursor->hdr.len + sizeof(PhRegionDataHdr_t))) { | |
249 SDL_memcpy(didata->cursor, internal_cursor, | |
250 internal_cursor->hdr.len + | |
251 sizeof(PhRegionDataHdr_t)); | |
252 } else { | |
253 /* Partitial cursor image */ | |
254 SDL_memcpy(didata->cursor, internal_cursor, | |
255 didata->cursor_size); | |
256 } | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
257 |
3139 | 258 didata->cursor_visible = SDL_TRUE; |
259 return 0; | |
260 } else { | |
261 /* We can't get SDL_DisplayData at this point, return fake success */ | |
262 return 0; | |
263 } | |
264 } else { | |
265 /* Sanity checks */ | |
3685
64ce267332c6
Switched from SDL_WindowID and SDL_TextureID to SDL_Window* and SDL_Texture* for code simplicity and improved performance.
Sam Lantinga <slouken@libsdl.org>
parents:
3500
diff
changeset
|
266 display = window->display; |
64ce267332c6
Switched from SDL_WindowID and SDL_TextureID to SDL_Window* and SDL_Texture* for code simplicity and improved performance.
Sam Lantinga <slouken@libsdl.org>
parents:
3500
diff
changeset
|
267 if (display != NULL) { |
64ce267332c6
Switched from SDL_WindowID and SDL_TextureID to SDL_Window* and SDL_Texture* for code simplicity and improved performance.
Sam Lantinga <slouken@libsdl.org>
parents:
3500
diff
changeset
|
268 didata = (SDL_DisplayData *) display->driverdata; |
64ce267332c6
Switched from SDL_WindowID and SDL_TextureID to SDL_Window* and SDL_Texture* for code simplicity and improved performance.
Sam Lantinga <slouken@libsdl.org>
parents:
3500
diff
changeset
|
269 if (didata != NULL) { |
64ce267332c6
Switched from SDL_WindowID and SDL_TextureID to SDL_Window* and SDL_Texture* for code simplicity and improved performance.
Sam Lantinga <slouken@libsdl.org>
parents:
3500
diff
changeset
|
270 wdata = (SDL_WindowData *) window->driverdata; |
64ce267332c6
Switched from SDL_WindowID and SDL_TextureID to SDL_Window* and SDL_Texture* for code simplicity and improved performance.
Sam Lantinga <slouken@libsdl.org>
parents:
3500
diff
changeset
|
271 if (wdata == NULL) { |
3139 | 272 return -1; |
273 } | |
274 } else { | |
275 return -1; | |
276 } | |
277 } else { | |
278 return -1; | |
279 } | |
280 } | |
281 | |
282 /* return if window widget has been destroyed already */ | |
283 if (wdata->window == NULL) { | |
284 return; | |
285 } | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
286 |
3139 | 287 /* Check if we need to set new shape or disable cursor shape */ |
288 if (cursor != NULL) { | |
289 /* Retrieve photon cursor shape */ | |
290 internal_cursor = (PhCursorDef_t *) cursor->driverdata; | |
291 if (internal_cursor == NULL) { | |
292 SDL_SetError("Photon: Internal cursor data is absent"); | |
293 return -1; | |
294 } | |
295 | |
296 /* Setup cursor type */ | |
297 status = | |
298 PtSetResource(wdata->window, Pt_ARG_CURSOR_TYPE, Ph_CURSOR_BITMAP, | |
299 0); | |
300 if (status != 0) { | |
301 SDL_SetError("Photon: Failed to set cursor type to bitmap"); | |
302 return -1; | |
303 } | |
304 | |
305 /* Setup cursor color to default */ | |
306 status = | |
307 PtSetResource(wdata->window, Pt_ARG_CURSOR_COLOR, | |
308 Ph_CURSOR_DEFAULT_COLOR, 0); | |
309 if (status != 0) { | |
310 SDL_SetError("Photon: Failed to set cursor color"); | |
311 return -1; | |
312 } | |
313 | |
314 /* Setup cursor shape */ | |
315 status = | |
316 PtSetResource(wdata->window, Pt_ARG_BITMAP_CURSOR, | |
317 internal_cursor, | |
318 internal_cursor->hdr.len + | |
319 sizeof(PhRegionDataHdr_t)); | |
320 if (status != 0) { | |
321 SDL_SetError("Photon: Failed to set cursor color"); | |
322 return -1; | |
323 } | |
324 | |
325 /* Store current cursor for future usage */ | |
326 if (didata->cursor_size >= | |
327 (internal_cursor->hdr.len + sizeof(PhRegionDataHdr_t))) { | |
328 SDL_memcpy(didata->cursor, internal_cursor, | |
329 internal_cursor->hdr.len + sizeof(PhRegionDataHdr_t)); | |
330 } else { | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
331 /* Partitial cursor image */ |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
332 SDL_memcpy(didata->cursor, internal_cursor, didata->cursor_size); |
3139 | 333 } |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
334 |
3139 | 335 /* Set cursor visible */ |
336 didata->cursor_visible = SDL_TRUE; | |
337 } else { | |
338 /* SDL requests to disable cursor */ | |
339 status = | |
340 PtSetResource(wdata->window, Pt_ARG_CURSOR_TYPE, Ph_CURSOR_NONE, | |
341 0); | |
342 if (status != 0) { | |
343 SDL_SetError("Photon: Can't disable cursor"); | |
344 return -1; | |
345 } | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
346 |
3139 | 347 /* Set cursor invisible */ |
348 didata->cursor_visible = SDL_FALSE; | |
349 } | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
350 |
3139 | 351 /* Flush all pending widget data */ |
352 PtFlush(); | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
353 |
3139 | 354 /* New cursor shape is set */ |
355 return 0; | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
356 } |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
357 |
3139 | 358 void |
359 photon_movecursor(SDL_Cursor * cursor) | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
360 { |
3139 | 361 SDL_VideoDisplay *display; |
362 SDL_DisplayData *didata; | |
363 SDL_Window *window; | |
364 SDL_WindowData *wdata; | |
365 SDL_WindowID window_id; | |
366 int32_t status; | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
367 |
3139 | 368 /* Get current window id */ |
369 window_id = SDL_GetFocusWindow(); | |
370 if (window_id <= 0) { | |
371 didata = (SDL_DisplayData *) cursor->mouse->driverdata; | |
372 } else { | |
373 /* Sanity checks */ | |
374 window = SDL_GetWindowFromID(window_id); | |
375 if (window != NULL) { | |
3685
64ce267332c6
Switched from SDL_WindowID and SDL_TextureID to SDL_Window* and SDL_Texture* for code simplicity and improved performance.
Sam Lantinga <slouken@libsdl.org>
parents:
3500
diff
changeset
|
376 display = window->display; |
3139 | 377 if (display != NULL) { |
378 didata = (SDL_DisplayData *) display->driverdata; | |
379 if (didata != NULL) { | |
380 wdata = (SDL_WindowData *) window->driverdata; | |
381 if (wdata == NULL) { | |
382 return; | |
383 } | |
384 } else { | |
385 return; | |
386 } | |
387 } else { | |
388 return; | |
3115
1102a3305928
Added handler for all window events.
Mike Gorchak <lestat@i.com.ua>
parents:
3108
diff
changeset
|
389 } |
3139 | 390 } else { |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
391 return; |
3139 | 392 } |
393 } | |
394 | |
395 /* No need to move mouse cursor manually in the photon */ | |
396 | |
397 return; | |
398 } | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
399 |
3139 | 400 void |
401 photon_freecursor(SDL_Cursor * cursor) | |
402 { | |
403 PhCursorDef_t *internal_cursor = NULL; | |
3115
1102a3305928
Added handler for all window events.
Mike Gorchak <lestat@i.com.ua>
parents:
3108
diff
changeset
|
404 |
3139 | 405 if (cursor != NULL) { |
406 internal_cursor = (PhCursorDef_t *) cursor->driverdata; | |
407 if (internal_cursor != NULL) { | |
408 SDL_free(internal_cursor); | |
409 cursor->driverdata = NULL; | |
410 } | |
411 } | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
412 } |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
413 |
3139 | 414 void |
3685
64ce267332c6
Switched from SDL_WindowID and SDL_TextureID to SDL_Window* and SDL_Texture* for code simplicity and improved performance.
Sam Lantinga <slouken@libsdl.org>
parents:
3500
diff
changeset
|
415 photon_warpmouse(SDL_Mouse * mouse, SDL_Window * window, int x, int y) |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
416 { |
3139 | 417 SDL_VideoDisplay *display; |
418 SDL_DisplayData *didata; | |
419 SDL_WindowData *wdata; | |
420 int16_t wx; | |
421 int16_t wy; | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
422 |
3139 | 423 /* Sanity checks */ |
424 if (window != NULL) { | |
3685
64ce267332c6
Switched from SDL_WindowID and SDL_TextureID to SDL_Window* and SDL_Texture* for code simplicity and improved performance.
Sam Lantinga <slouken@libsdl.org>
parents:
3500
diff
changeset
|
425 display = window->display; |
3139 | 426 if (display != NULL) { |
427 didata = (SDL_DisplayData *) display->driverdata; | |
428 if (didata != NULL) { | |
429 wdata = (SDL_WindowData *) window->driverdata; | |
430 if (wdata == NULL) { | |
431 return; | |
432 } | |
433 } else { | |
434 return; | |
435 } | |
436 } else { | |
437 return; | |
438 } | |
439 } else { | |
440 return; | |
441 } | |
442 | |
443 PtGetAbsPosition(wdata->window, &wx, &wy); | |
444 PhMoveCursorAbs(PhInputGroup(NULL), wx + x, wy + y); | |
445 | |
446 return; | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
447 } |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
448 |
3139 | 449 void |
450 photon_freemouse(SDL_Mouse * mouse) | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
451 { |
3139 | 452 if (mouse->driverdata == NULL) { |
453 return; | |
454 } | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
455 |
3139 | 456 /* Mouse framework doesn't deletes automatically our driverdata */ |
457 SDL_free(mouse->driverdata); | |
458 mouse->driverdata = NULL; | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
459 |
3139 | 460 return; |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
461 } |
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
462 |
3139 | 463 SDL_scancode |
464 photon_to_sdl_keymap(uint32_t key) | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
465 { |
3139 | 466 SDL_scancode scancode = SDL_SCANCODE_UNKNOWN; |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
467 |
3139 | 468 switch (key & 0x0000007F) { |
469 case PHOTON_SCANCODE_ESCAPE: | |
470 scancode = SDL_SCANCODE_ESCAPE; | |
471 break; | |
472 case PHOTON_SCANCODE_F1: | |
473 scancode = SDL_SCANCODE_F1; | |
474 break; | |
475 case PHOTON_SCANCODE_F2: | |
476 scancode = SDL_SCANCODE_F2; | |
477 break; | |
478 case PHOTON_SCANCODE_F3: | |
479 scancode = SDL_SCANCODE_F3; | |
480 break; | |
481 case PHOTON_SCANCODE_F4: | |
482 scancode = SDL_SCANCODE_F4; | |
483 break; | |
484 case PHOTON_SCANCODE_F5: | |
485 scancode = SDL_SCANCODE_F5; | |
486 break; | |
487 case PHOTON_SCANCODE_F6: | |
488 scancode = SDL_SCANCODE_F6; | |
489 break; | |
490 case PHOTON_SCANCODE_F7: | |
491 scancode = SDL_SCANCODE_F7; | |
492 break; | |
493 case PHOTON_SCANCODE_F8: | |
494 scancode = SDL_SCANCODE_F8; | |
495 break; | |
496 case PHOTON_SCANCODE_F9: | |
497 scancode = SDL_SCANCODE_F9; | |
498 break; | |
499 case PHOTON_SCANCODE_F10: | |
500 scancode = SDL_SCANCODE_F10; | |
501 break; | |
502 case PHOTON_SCANCODE_F11: | |
503 scancode = SDL_SCANCODE_F11; | |
504 break; | |
505 case PHOTON_SCANCODE_F12: | |
506 scancode = SDL_SCANCODE_F12; | |
507 break; | |
508 case PHOTON_SCANCODE_BACKQOUTE: | |
509 scancode = SDL_SCANCODE_GRAVE; | |
510 break; | |
511 case PHOTON_SCANCODE_1: | |
512 scancode = SDL_SCANCODE_1; | |
513 break; | |
514 case PHOTON_SCANCODE_2: | |
515 scancode = SDL_SCANCODE_2; | |
516 break; | |
517 case PHOTON_SCANCODE_3: | |
518 scancode = SDL_SCANCODE_3; | |
519 break; | |
520 case PHOTON_SCANCODE_4: | |
521 scancode = SDL_SCANCODE_4; | |
522 break; | |
523 case PHOTON_SCANCODE_5: | |
524 scancode = SDL_SCANCODE_5; | |
525 break; | |
526 case PHOTON_SCANCODE_6: | |
527 scancode = SDL_SCANCODE_6; | |
528 break; | |
529 case PHOTON_SCANCODE_7: | |
530 scancode = SDL_SCANCODE_7; | |
531 break; | |
532 case PHOTON_SCANCODE_8: | |
533 scancode = SDL_SCANCODE_8; | |
534 break; | |
535 case PHOTON_SCANCODE_9: | |
536 scancode = SDL_SCANCODE_9; | |
537 break; | |
538 case PHOTON_SCANCODE_0: | |
539 scancode = SDL_SCANCODE_0; | |
540 break; | |
541 case PHOTON_SCANCODE_MINUS: | |
542 scancode = SDL_SCANCODE_MINUS; | |
543 break; | |
544 case PHOTON_SCANCODE_EQUAL: | |
545 scancode = SDL_SCANCODE_EQUALS; | |
546 break; | |
547 case PHOTON_SCANCODE_BACKSPACE: | |
548 scancode = SDL_SCANCODE_BACKSPACE; | |
549 break; | |
550 case PHOTON_SCANCODE_TAB: | |
551 scancode = SDL_SCANCODE_TAB; | |
552 break; | |
553 case PHOTON_SCANCODE_Q: | |
554 scancode = SDL_SCANCODE_Q; | |
555 break; | |
556 case PHOTON_SCANCODE_W: | |
557 scancode = SDL_SCANCODE_W; | |
558 break; | |
559 case PHOTON_SCANCODE_E: | |
560 scancode = SDL_SCANCODE_E; | |
561 break; | |
562 case PHOTON_SCANCODE_R: | |
563 scancode = SDL_SCANCODE_R; | |
564 break; | |
565 case PHOTON_SCANCODE_T: | |
566 scancode = SDL_SCANCODE_T; | |
567 break; | |
568 case PHOTON_SCANCODE_Y: | |
569 scancode = SDL_SCANCODE_Y; | |
570 break; | |
571 case PHOTON_SCANCODE_U: | |
572 scancode = SDL_SCANCODE_U; | |
573 break; | |
574 case PHOTON_SCANCODE_I: | |
575 scancode = SDL_SCANCODE_I; | |
576 break; | |
577 case PHOTON_SCANCODE_O: | |
578 scancode = SDL_SCANCODE_O; | |
579 break; | |
580 case PHOTON_SCANCODE_P: | |
581 scancode = SDL_SCANCODE_P; | |
582 break; | |
583 case PHOTON_SCANCODE_LEFT_SQ_BR: | |
584 scancode = SDL_SCANCODE_LEFTBRACKET; | |
585 break; | |
586 case PHOTON_SCANCODE_RIGHT_SQ_BR: | |
587 scancode = SDL_SCANCODE_RIGHTBRACKET; | |
588 break; | |
589 case PHOTON_SCANCODE_ENTER: | |
590 scancode = SDL_SCANCODE_RETURN; | |
591 break; | |
592 case PHOTON_SCANCODE_CAPSLOCK: | |
593 scancode = SDL_SCANCODE_CAPSLOCK; | |
594 break; | |
595 case PHOTON_SCANCODE_A: | |
596 scancode = SDL_SCANCODE_A; | |
597 break; | |
598 case PHOTON_SCANCODE_S: | |
599 scancode = SDL_SCANCODE_S; | |
600 break; | |
601 case PHOTON_SCANCODE_D: | |
602 scancode = SDL_SCANCODE_D; | |
603 break; | |
604 case PHOTON_SCANCODE_F: | |
605 scancode = SDL_SCANCODE_F; | |
606 break; | |
607 case PHOTON_SCANCODE_G: | |
608 scancode = SDL_SCANCODE_G; | |
609 break; | |
610 case PHOTON_SCANCODE_H: | |
611 scancode = SDL_SCANCODE_H; | |
612 break; | |
613 case PHOTON_SCANCODE_J: | |
614 scancode = SDL_SCANCODE_J; | |
615 break; | |
616 case PHOTON_SCANCODE_K: | |
617 scancode = SDL_SCANCODE_K; | |
618 break; | |
619 case PHOTON_SCANCODE_L: | |
620 scancode = SDL_SCANCODE_L; | |
621 break; | |
622 case PHOTON_SCANCODE_SEMICOLON: | |
623 scancode = SDL_SCANCODE_SEMICOLON; | |
624 break; | |
625 case PHOTON_SCANCODE_QUOTE: | |
626 scancode = SDL_SCANCODE_APOSTROPHE; | |
627 break; | |
628 case PHOTON_SCANCODE_BACKSLASH: | |
629 scancode = SDL_SCANCODE_BACKSLASH; | |
630 break; | |
631 case PHOTON_SCANCODE_LEFT_SHIFT: | |
632 scancode = SDL_SCANCODE_LSHIFT; | |
633 break; | |
634 case PHOTON_SCANCODE_Z: | |
635 scancode = SDL_SCANCODE_Z; | |
636 break; | |
637 case PHOTON_SCANCODE_X: | |
638 scancode = SDL_SCANCODE_X; | |
639 break; | |
640 case PHOTON_SCANCODE_C: | |
641 scancode = SDL_SCANCODE_C; | |
642 break; | |
643 case PHOTON_SCANCODE_V: | |
644 scancode = SDL_SCANCODE_V; | |
645 break; | |
646 case PHOTON_SCANCODE_B: | |
647 scancode = SDL_SCANCODE_B; | |
648 break; | |
649 case PHOTON_SCANCODE_N: | |
650 scancode = SDL_SCANCODE_N; | |
651 break; | |
652 case PHOTON_SCANCODE_M: | |
653 scancode = SDL_SCANCODE_M; | |
654 break; | |
655 case PHOTON_SCANCODE_COMMA: | |
656 scancode = SDL_SCANCODE_COMMA; | |
657 break; | |
658 case PHOTON_SCANCODE_POINT: | |
659 scancode = SDL_SCANCODE_PERIOD; | |
660 break; | |
661 case PHOTON_SCANCODE_SLASH: | |
662 scancode = SDL_SCANCODE_SLASH; | |
663 break; | |
664 case PHOTON_SCANCODE_RIGHT_SHIFT: | |
665 scancode = SDL_SCANCODE_RSHIFT; | |
666 break; | |
667 case PHOTON_SCANCODE_CTRL: | |
668 scancode = SDL_SCANCODE_LCTRL; | |
669 break; | |
670 case PHOTON_SCANCODE_WFLAG: | |
671 scancode = SDL_SCANCODE_LGUI; | |
672 break; | |
673 case PHOTON_SCANCODE_ALT: | |
674 scancode = SDL_SCANCODE_LALT; | |
675 break; | |
676 case PHOTON_SCANCODE_SPACE: | |
677 scancode = SDL_SCANCODE_SPACE; | |
678 break; | |
679 case PHOTON_SCANCODE_MENU: | |
680 scancode = SDL_SCANCODE_MENU; | |
681 break; | |
682 case PHOTON_SCANCODE_PRNSCR: | |
683 scancode = SDL_SCANCODE_PRINTSCREEN; | |
684 break; | |
685 case PHOTON_SCANCODE_SCROLLLOCK: | |
686 scancode = SDL_SCANCODE_SCROLLLOCK; | |
687 break; | |
688 case PHOTON_SCANCODE_INSERT: | |
689 scancode = SDL_SCANCODE_INSERT; | |
690 break; | |
691 case PHOTON_SCANCODE_HOME: | |
692 scancode = SDL_SCANCODE_HOME; | |
693 break; | |
694 case PHOTON_SCANCODE_PAGEUP: | |
695 scancode = SDL_SCANCODE_PAGEUP; | |
696 break; | |
697 case PHOTON_SCANCODE_DELETE: | |
698 scancode = SDL_SCANCODE_DELETE; | |
699 break; | |
700 case PHOTON_SCANCODE_END: | |
701 scancode = SDL_SCANCODE_END; | |
702 break; | |
703 case PHOTON_SCANCODE_PAGEDOWN: | |
704 scancode = SDL_SCANCODE_PAGEDOWN; | |
705 break; | |
706 case PHOTON_SCANCODE_UP: | |
707 scancode = SDL_SCANCODE_UP; | |
708 break; | |
709 case PHOTON_SCANCODE_DOWN: | |
710 scancode = SDL_SCANCODE_DOWN; | |
711 break; | |
712 case PHOTON_SCANCODE_LEFT: | |
713 scancode = SDL_SCANCODE_LEFT; | |
714 break; | |
715 case PHOTON_SCANCODE_RIGHT: | |
716 scancode = SDL_SCANCODE_RIGHT; | |
717 break; | |
718 case PHOTON_SCANCODE_NUMLOCK: | |
719 scancode = SDL_SCANCODE_NUMLOCKCLEAR; | |
720 break; | |
721 default: | |
722 break; | |
723 } | |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
724 |
3139 | 725 return scancode; |
3108
aa1897bee1e9
Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff
changeset
|
726 } |