Mercurial > sdl-ios-xcode
comparison src/video/cybergfx/SDL_amigaevents.c @ 1668:4da1ee79c9af SDL-1.3
more tweaking indent options
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 29 May 2006 04:04:35 +0000 |
parents | 782fd950bd46 |
children |
comparison
equal
deleted
inserted
replaced
1667:1fddae038bc8 | 1668:4da1ee79c9af |
---|---|
35 #include "SDL_amigaevents_c.h" | 35 #include "SDL_amigaevents_c.h" |
36 | 36 |
37 | 37 |
38 /* The translation tables from an Amiga keysym to a SDL keysym */ | 38 /* The translation tables from an Amiga keysym to a SDL keysym */ |
39 static SDLKey MISC_keymap[256]; | 39 static SDLKey MISC_keymap[256]; |
40 SDL_keysym *amiga_TranslateKey (int code, SDL_keysym * keysym); | 40 SDL_keysym *amiga_TranslateKey(int code, SDL_keysym * keysym); |
41 struct IOStdReq *ConReq = NULL; | 41 struct IOStdReq *ConReq = NULL; |
42 struct MsgPort *ConPort = NULL; | 42 struct MsgPort *ConPort = NULL; |
43 | 43 |
44 /* Note: The X server buffers and accumulates mouse motion events, so | 44 /* Note: The X server buffers and accumulates mouse motion events, so |
45 the motion event generated by the warp may not appear exactly as we | 45 the motion event generated by the warp may not appear exactly as we |
49 #define MOUSE_FUDGE_FACTOR 8 | 49 #define MOUSE_FUDGE_FACTOR 8 |
50 | 50 |
51 #if 0 | 51 #if 0 |
52 | 52 |
53 static inline int | 53 static inline int |
54 amiga_WarpedMotion (_THIS, struct IntuiMessage *m) | 54 amiga_WarpedMotion(_THIS, struct IntuiMessage *m) |
55 { | 55 { |
56 int w, h, i; | 56 int w, h, i; |
57 int deltax, deltay; | 57 int deltax, deltay; |
58 int posted; | 58 int posted; |
59 | 59 |
60 w = SDL_VideoSurface->w; | 60 w = SDL_VideoSurface->w; |
61 h = SDL_VideoSurface->h; | 61 h = SDL_VideoSurface->h; |
62 deltax = xevent->xmotion.x - mouse_last.x; | 62 deltax = xevent->xmotion.x - mouse_last.x; |
63 deltay = xevent->xmotion.y - mouse_last.y; | 63 deltay = xevent->xmotion.y - mouse_last.y; |
64 #ifdef DEBUG_MOTION | 64 #ifdef DEBUG_MOTION |
65 printf ("Warped mouse motion: %d,%d\n", deltax, deltay); | 65 printf("Warped mouse motion: %d,%d\n", deltax, deltay); |
66 #endif | 66 #endif |
67 mouse_last.x = xevent->xmotion.x; | 67 mouse_last.x = xevent->xmotion.x; |
68 mouse_last.y = xevent->xmotion.y; | 68 mouse_last.y = xevent->xmotion.y; |
69 posted = SDL_PrivateMouseMotion (0, 1, deltax, deltay); | 69 posted = SDL_PrivateMouseMotion(0, 1, deltax, deltay); |
70 | 70 |
71 if ((xevent->xmotion.x < MOUSE_FUDGE_FACTOR) || | 71 if ((xevent->xmotion.x < MOUSE_FUDGE_FACTOR) || |
72 (xevent->xmotion.x > (w - MOUSE_FUDGE_FACTOR)) || | 72 (xevent->xmotion.x > (w - MOUSE_FUDGE_FACTOR)) || |
73 (xevent->xmotion.y < MOUSE_FUDGE_FACTOR) || | 73 (xevent->xmotion.y < MOUSE_FUDGE_FACTOR) || |
74 (xevent->xmotion.y > (h - MOUSE_FUDGE_FACTOR))) { | 74 (xevent->xmotion.y > (h - MOUSE_FUDGE_FACTOR))) { |
75 /* Get the events that have accumulated */ | 75 /* Get the events that have accumulated */ |
76 while (XCheckTypedEvent (SDL_Display, MotionNotify, xevent)) { | 76 while (XCheckTypedEvent(SDL_Display, MotionNotify, xevent)) { |
77 deltax = xevent->xmotion.x - mouse_last.x; | 77 deltax = xevent->xmotion.x - mouse_last.x; |
78 deltay = xevent->xmotion.y - mouse_last.y; | 78 deltay = xevent->xmotion.y - mouse_last.y; |
79 #ifdef DEBUG_MOTION | 79 #ifdef DEBUG_MOTION |
80 printf ("Extra mouse motion: %d,%d\n", deltax, deltay); | 80 printf("Extra mouse motion: %d,%d\n", deltax, deltay); |
81 #endif | 81 #endif |
82 mouse_last.x = xevent->xmotion.x; | 82 mouse_last.x = xevent->xmotion.x; |
83 mouse_last.y = xevent->xmotion.y; | 83 mouse_last.y = xevent->xmotion.y; |
84 posted += SDL_PrivateMouseMotion (0, 1, deltax, deltay); | 84 posted += SDL_PrivateMouseMotion(0, 1, deltax, deltay); |
85 } | 85 } |
86 mouse_last.x = w / 2; | 86 mouse_last.x = w / 2; |
87 mouse_last.y = h / 2; | 87 mouse_last.y = h / 2; |
88 XWarpPointer (SDL_Display, None, SDL_Window, 0, 0, 0, 0, | 88 XWarpPointer(SDL_Display, None, SDL_Window, 0, 0, 0, 0, |
89 mouse_last.x, mouse_last.y); | 89 mouse_last.x, mouse_last.y); |
90 for (i = 0; i < 10; ++i) { | 90 for (i = 0; i < 10; ++i) { |
91 XMaskEvent (SDL_Display, PointerMotionMask, xevent); | 91 XMaskEvent(SDL_Display, PointerMotionMask, xevent); |
92 if ((xevent->xmotion.x > | 92 if ((xevent->xmotion.x > |
93 (mouse_last.x - MOUSE_FUDGE_FACTOR)) && | 93 (mouse_last.x - MOUSE_FUDGE_FACTOR)) && |
94 (xevent->xmotion.x < | 94 (xevent->xmotion.x < |
95 (mouse_last.x + MOUSE_FUDGE_FACTOR)) && | 95 (mouse_last.x + MOUSE_FUDGE_FACTOR)) && |
96 (xevent->xmotion.y > | 96 (xevent->xmotion.y > |
97 (mouse_last.y - MOUSE_FUDGE_FACTOR)) && | 97 (mouse_last.y - MOUSE_FUDGE_FACTOR)) && |
98 (xevent->xmotion.y < (mouse_last.y + MOUSE_FUDGE_FACTOR))) { | 98 (xevent->xmotion.y < (mouse_last.y + MOUSE_FUDGE_FACTOR))) { |
99 break; | 99 break; |
100 } | 100 } |
101 #ifdef DEBUG_XEVENTS | 101 #ifdef DEBUG_XEVENTS |
102 printf ("Lost mouse motion: %d,%d\n", xevent->xmotion.x, | 102 printf("Lost mouse motion: %d,%d\n", xevent->xmotion.x, |
103 xevent->xmotion.y); | 103 xevent->xmotion.y); |
104 #endif | 104 #endif |
105 } | 105 } |
106 #ifdef DEBUG_XEVENTS | 106 #ifdef DEBUG_XEVENTS |
107 if (i == 10) { | 107 if (i == 10) { |
108 printf ("Warning: didn't detect mouse warp motion\n"); | 108 printf("Warning: didn't detect mouse warp motion\n"); |
109 } | 109 } |
110 #endif | 110 #endif |
111 } | 111 } |
112 return (posted); | 112 return (posted); |
113 } | 113 } |
114 | 114 |
115 #endif | 115 #endif |
116 | 116 |
117 static int | 117 static int |
118 amiga_GetButton (int code) | 118 amiga_GetButton(int code) |
119 { | 119 { |
120 switch (code) { | 120 switch (code) { |
121 case IECODE_MBUTTON: | 121 case IECODE_MBUTTON: |
122 return SDL_BUTTON_MIDDLE; | 122 return SDL_BUTTON_MIDDLE; |
123 case IECODE_RBUTTON: | 123 case IECODE_RBUTTON: |
126 return SDL_BUTTON_LEFT; | 126 return SDL_BUTTON_LEFT; |
127 } | 127 } |
128 } | 128 } |
129 | 129 |
130 static int | 130 static int |
131 amiga_DispatchEvent (_THIS, struct IntuiMessage *msg) | 131 amiga_DispatchEvent(_THIS, struct IntuiMessage *msg) |
132 { | 132 { |
133 int class = msg->Class, code = msg->Code; | 133 int class = msg->Class, code = msg->Code; |
134 int posted; | 134 int posted; |
135 | 135 |
136 posted = 0; | 136 posted = 0; |
137 switch (class) { | 137 switch (class) { |
138 /* Gaining mouse coverage? */ | 138 /* Gaining mouse coverage? */ |
139 case IDCMP_ACTIVEWINDOW: | 139 case IDCMP_ACTIVEWINDOW: |
140 posted = SDL_PrivateAppActive (1, SDL_APPMOUSEFOCUS); | 140 posted = SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS); |
141 break; | 141 break; |
142 | 142 |
143 /* Losing mouse coverage? */ | 143 /* Losing mouse coverage? */ |
144 case IDCMP_INACTIVEWINDOW: | 144 case IDCMP_INACTIVEWINDOW: |
145 posted = SDL_PrivateAppActive (0, SDL_APPMOUSEFOCUS); | 145 posted = SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS); |
146 break; | 146 break; |
147 #if 0 | 147 #if 0 |
148 /* Gaining input focus? */ | 148 /* Gaining input focus? */ |
149 case IDCMP_ACTIVEWINDOW: | 149 case IDCMP_ACTIVEWINDOW: |
150 posted = SDL_PrivateAppActive (1, SDL_APPINPUTFOCUS); | 150 posted = SDL_PrivateAppActive(1, SDL_APPINPUTFOCUS); |
151 | 151 |
152 /* Queue entry into fullscreen mode */ | 152 /* Queue entry into fullscreen mode */ |
153 switch_waiting = 0x01 | SDL_FULLSCREEN; | 153 switch_waiting = 0x01 | SDL_FULLSCREEN; |
154 switch_time = SDL_GetTicks () + 1500; | 154 switch_time = SDL_GetTicks() + 1500; |
155 break; | 155 break; |
156 | 156 |
157 /* Losing input focus? */ | 157 /* Losing input focus? */ |
158 case IDCMP_INACTIVEWINDOW: | 158 case IDCMP_INACTIVEWINDOW: |
159 posted = SDL_PrivateAppActive (0, SDL_APPINPUTFOCUS); | 159 posted = SDL_PrivateAppActive(0, SDL_APPINPUTFOCUS); |
160 | 160 |
161 /* Queue leaving fullscreen mode */ | 161 /* Queue leaving fullscreen mode */ |
162 switch_waiting = 0x01; | 162 switch_waiting = 0x01; |
163 switch_time = SDL_GetTicks () + 200; | 163 switch_time = SDL_GetTicks() + 200; |
164 break; | 164 break; |
165 #endif | 165 #endif |
166 /* Mouse motion? */ | 166 /* Mouse motion? */ |
167 case IDCMP_MOUSEMOVE: | 167 case IDCMP_MOUSEMOVE: |
168 if (SDL_VideoSurface) { | 168 if (SDL_VideoSurface) { |
169 posted = SDL_PrivateMouseMotion (0, 0, | 169 posted = SDL_PrivateMouseMotion(0, 0, |
170 msg->MouseX - | 170 msg->MouseX - |
171 SDL_Window->BorderLeft, | 171 SDL_Window->BorderLeft, |
172 msg->MouseY - | 172 msg->MouseY - |
173 SDL_Window->BorderTop); | 173 SDL_Window->BorderTop); |
174 } | 174 } |
175 break; | 175 break; |
176 | 176 |
177 /* Mouse button press? */ | 177 /* Mouse button press? */ |
178 case IDCMP_MOUSEBUTTONS: | 178 case IDCMP_MOUSEBUTTONS: |
179 | 179 |
180 if (!(code & IECODE_UP_PREFIX)) { | 180 if (!(code & IECODE_UP_PREFIX)) { |
181 posted = SDL_PrivateMouseButton (SDL_PRESSED, | 181 posted = SDL_PrivateMouseButton(SDL_PRESSED, |
182 amiga_GetButton (code), 0, 0); | 182 amiga_GetButton(code), 0, 0); |
183 } | 183 } |
184 /* Mouse button release? */ | 184 /* Mouse button release? */ |
185 else { | 185 else { |
186 code &= ~IECODE_UP_PREFIX; | 186 code &= ~IECODE_UP_PREFIX; |
187 posted = SDL_PrivateMouseButton (SDL_RELEASED, | 187 posted = SDL_PrivateMouseButton(SDL_RELEASED, |
188 amiga_GetButton (code), 0, 0); | 188 amiga_GetButton(code), 0, 0); |
189 } | 189 } |
190 break; | 190 break; |
191 | 191 |
192 case IDCMP_RAWKEY: | 192 case IDCMP_RAWKEY: |
193 | 193 |
194 /* Key press? */ | 194 /* Key press? */ |
195 | 195 |
196 if (!(code & IECODE_UP_PREFIX)) { | 196 if (!(code & IECODE_UP_PREFIX)) { |
197 SDL_keysym keysym; | 197 SDL_keysym keysym; |
198 posted = SDL_PrivateKeyboard (SDL_PRESSED, | 198 posted = SDL_PrivateKeyboard(SDL_PRESSED, |
199 amiga_TranslateKey (code, &keysym)); | 199 amiga_TranslateKey(code, &keysym)); |
200 } else { | 200 } else { |
201 /* Key release? */ | 201 /* Key release? */ |
202 | 202 |
203 SDL_keysym keysym; | 203 SDL_keysym keysym; |
204 code &= ~IECODE_UP_PREFIX; | 204 code &= ~IECODE_UP_PREFIX; |
205 | 205 |
206 /* Check to see if this is a repeated key */ | 206 /* Check to see if this is a repeated key */ |
207 /* if ( ! X11_KeyRepeat(SDL_Display, &xevent) ) */ | 207 /* if ( ! X11_KeyRepeat(SDL_Display, &xevent) ) */ |
208 | 208 |
209 posted = SDL_PrivateKeyboard (SDL_RELEASED, | 209 posted = SDL_PrivateKeyboard(SDL_RELEASED, |
210 amiga_TranslateKey (code, &keysym)); | 210 amiga_TranslateKey(code, &keysym)); |
211 } | 211 } |
212 break; | 212 break; |
213 /* Have we been iconified? */ | 213 /* Have we been iconified? */ |
214 #if 0 | 214 #if 0 |
215 case UnmapNotify: | 215 case UnmapNotify: |
216 { | 216 { |
217 #ifdef DEBUG_XEVENTS | 217 #ifdef DEBUG_XEVENTS |
218 printf ("UnmapNotify!\n"); | 218 printf("UnmapNotify!\n"); |
219 #endif | 219 #endif |
220 posted = | 220 posted = |
221 SDL_PrivateAppActive (0, SDL_APPACTIVE | SDL_APPINPUTFOCUS); | 221 SDL_PrivateAppActive(0, SDL_APPACTIVE | SDL_APPINPUTFOCUS); |
222 } | 222 } |
223 break; | 223 break; |
224 | 224 |
225 /* Have we been restored? */ | 225 /* Have we been restored? */ |
226 | 226 |
227 case MapNotify: | 227 case MapNotify: |
228 { | 228 { |
229 #ifdef DEBUG_XEVENTS | 229 #ifdef DEBUG_XEVENTS |
230 printf ("MapNotify!\n"); | 230 printf("MapNotify!\n"); |
231 #endif | 231 #endif |
232 | 232 |
233 posted = SDL_PrivateAppActive (1, SDL_APPACTIVE); | 233 posted = SDL_PrivateAppActive(1, SDL_APPACTIVE); |
234 | 234 |
235 if (SDL_VideoSurface && | 235 if (SDL_VideoSurface && |
236 (SDL_VideoSurface->flags & SDL_FULLSCREEN)) { | 236 (SDL_VideoSurface->flags & SDL_FULLSCREEN)) { |
237 CGX_EnterFullScreen (this); | 237 CGX_EnterFullScreen(this); |
238 } else { | 238 } else { |
239 X11_GrabInputNoLock (this, this->input_grab); | 239 X11_GrabInputNoLock(this, this->input_grab); |
240 } | 240 } |
241 if (SDL_VideoSurface) { | 241 if (SDL_VideoSurface) { |
242 CGX_RefreshDisplay (this); | 242 CGX_RefreshDisplay(this); |
243 } | 243 } |
244 } | 244 } |
245 break; | 245 break; |
246 case Expose: | 246 case Expose: |
247 if (SDL_VideoSurface && (xevent.xexpose.count == 0)) { | 247 if (SDL_VideoSurface && (xevent.xexpose.count == 0)) { |
248 CGX_RefreshDisplay (this); | 248 CGX_RefreshDisplay(this); |
249 } | 249 } |
250 break; | 250 break; |
251 #endif | 251 #endif |
252 | 252 |
253 /* Have we been resized? */ | 253 /* Have we been resized? */ |
254 case IDCMP_NEWSIZE: | 254 case IDCMP_NEWSIZE: |
255 SDL_PrivateResize (SDL_Window->Width - SDL_Window->BorderLeft - | 255 SDL_PrivateResize(SDL_Window->Width - SDL_Window->BorderLeft - |
256 SDL_Window->BorderRight, | 256 SDL_Window->BorderRight, |
257 SDL_Window->Height - SDL_Window->BorderTop - | 257 SDL_Window->Height - SDL_Window->BorderTop - |
258 SDL_Window->BorderBottom); | 258 SDL_Window->BorderBottom); |
259 | 259 |
260 break; | 260 break; |
261 | 261 |
262 /* Have we been requested to quit? */ | 262 /* Have we been requested to quit? */ |
263 case IDCMP_CLOSEWINDOW: | 263 case IDCMP_CLOSEWINDOW: |
264 posted = SDL_PrivateQuit (); | 264 posted = SDL_PrivateQuit(); |
265 break; | 265 break; |
266 | 266 |
267 /* Do we need to refresh ourselves? */ | 267 /* Do we need to refresh ourselves? */ |
268 | 268 |
269 default: | 269 default: |
270 { | 270 { |
271 /* Only post the event if we're watching for it */ | 271 /* Only post the event if we're watching for it */ |
272 if (SDL_ProcessEvents[SDL_SYSWMEVENT] == SDL_ENABLE) { | 272 if (SDL_ProcessEvents[SDL_SYSWMEVENT] == SDL_ENABLE) { |
273 SDL_SysWMmsg wmmsg; | 273 SDL_SysWMmsg wmmsg; |
274 | 274 |
275 SDL_VERSION (&wmmsg.version); | 275 SDL_VERSION(&wmmsg.version); |
276 #if 0 | 276 #if 0 |
277 wmmsg.subsystem = SDL_SYSWM_CGX; | 277 wmmsg.subsystem = SDL_SYSWM_CGX; |
278 wmmsg.event.xevent = xevent; | 278 wmmsg.event.xevent = xevent; |
279 #endif | 279 #endif |
280 posted = SDL_PrivateSysWMEvent (&wmmsg); | 280 posted = SDL_PrivateSysWMEvent(&wmmsg); |
281 } | 281 } |
282 } | 282 } |
283 break; | 283 break; |
284 } | 284 } |
285 ReplyMsg ((struct Message *) msg); | 285 ReplyMsg((struct Message *) msg); |
286 | 286 |
287 | 287 |
288 return (posted); | 288 return (posted); |
289 } | 289 } |
290 | 290 |
291 void | 291 void |
292 amiga_PumpEvents (_THIS) | 292 amiga_PumpEvents(_THIS) |
293 { | 293 { |
294 int pending; | 294 int pending; |
295 struct IntuiMessage *m; | 295 struct IntuiMessage *m; |
296 | 296 |
297 /* Keep processing pending events */ | 297 /* Keep processing pending events */ |
298 pending = 0; | 298 pending = 0; |
299 while (m = (struct IntuiMessage *) GetMsg (SDL_Window->UserPort)) { | 299 while (m = (struct IntuiMessage *) GetMsg(SDL_Window->UserPort)) { |
300 amiga_DispatchEvent (this, m); | 300 amiga_DispatchEvent(this, m); |
301 ++pending; | 301 ++pending; |
302 } | 302 } |
303 } | 303 } |
304 | 304 |
305 void | 305 void |
306 amiga_InitKeymap (void) | 306 amiga_InitKeymap(void) |
307 { | 307 { |
308 int i; | 308 int i; |
309 | 309 |
310 /* Map the miscellaneous keys */ | 310 /* Map the miscellaneous keys */ |
311 for (i = 0; i < SDL_arraysize (MISC_keymap); ++i) | 311 for (i = 0; i < SDL_arraysize(MISC_keymap); ++i) |
312 MISC_keymap[i] = SDLK_UNKNOWN; | 312 MISC_keymap[i] = SDLK_UNKNOWN; |
313 | 313 |
314 /* These X keysyms have 0xFF as the high byte */ | 314 /* These X keysyms have 0xFF as the high byte */ |
315 MISC_keymap[65] = SDLK_BACKSPACE; | 315 MISC_keymap[65] = SDLK_BACKSPACE; |
316 MISC_keymap[66] = SDLK_TAB; | 316 MISC_keymap[66] = SDLK_TAB; |
428 | 428 |
429 MISC_keymap[95] = SDLK_HELP; | 429 MISC_keymap[95] = SDLK_HELP; |
430 } | 430 } |
431 | 431 |
432 SDL_keysym * | 432 SDL_keysym * |
433 amiga_TranslateKey (int code, SDL_keysym * keysym) | 433 amiga_TranslateKey(int code, SDL_keysym * keysym) |
434 { | 434 { |
435 #ifdef STORMC4_WOS | 435 #ifdef STORMC4_WOS |
436 static struct Library *KeymapBase = NULL; /* Linking failed in WOS version if ConsoleDevice was used */ | 436 static struct Library *KeymapBase = NULL; /* Linking failed in WOS version if ConsoleDevice was used */ |
437 #else | 437 #else |
438 static struct Library *ConsoleDevice = NULL; | 438 static struct Library *ConsoleDevice = NULL; |
441 /* Get the raw keyboard scancode */ | 441 /* Get the raw keyboard scancode */ |
442 keysym->scancode = code; | 442 keysym->scancode = code; |
443 keysym->sym = MISC_keymap[code]; | 443 keysym->sym = MISC_keymap[code]; |
444 | 444 |
445 #ifdef DEBUG_KEYS | 445 #ifdef DEBUG_KEYS |
446 fprintf (stderr, "Translating key 0x%.4x (%d)\n", xsym, xkey->keycode); | 446 fprintf(stderr, "Translating key 0x%.4x (%d)\n", xsym, xkey->keycode); |
447 #endif | 447 #endif |
448 /* Get the translated SDL virtual keysym */ | 448 /* Get the translated SDL virtual keysym */ |
449 if (keysym->sym == SDLK_UNKNOWN) { | 449 if (keysym->sym == SDLK_UNKNOWN) { |
450 #ifdef STORMC4_WOS | 450 #ifdef STORMC4_WOS |
451 if (!KeymapBase) | 451 if (!KeymapBase) |
452 #else | 452 #else |
453 if (!ConsoleDevice) | 453 if (!ConsoleDevice) |
454 #endif | 454 #endif |
455 { | 455 { |
456 #ifdef STORMC4_WOS | 456 #ifdef STORMC4_WOS |
457 KeymapBase = OpenLibrary ("keymap.library", 0L); | 457 KeymapBase = OpenLibrary("keymap.library", 0L); |
458 #else | 458 #else |
459 if (ConPort = CreateMsgPort ()) { | 459 if (ConPort = CreateMsgPort()) { |
460 if (ConReq = | 460 if (ConReq = |
461 CreateIORequest (ConPort, sizeof (struct IOStdReq))) { | 461 CreateIORequest(ConPort, sizeof(struct IOStdReq))) { |
462 if (!OpenDevice | 462 if (!OpenDevice |
463 ("console.device", -1, | 463 ("console.device", -1, |
464 (struct IORequest *) ConReq, 0)) | 464 (struct IORequest *) ConReq, 0)) |
465 ConsoleDevice = (struct Library *) ConReq->io_Device; | 465 ConsoleDevice = (struct Library *) ConReq->io_Device; |
466 else { | 466 else { |
467 DeleteIORequest (ConReq); | 467 DeleteIORequest(ConReq); |
468 ConReq = NULL; | 468 ConReq = NULL; |
469 } | 469 } |
470 } else { | 470 } else { |
471 DeleteMsgPort (ConPort); | 471 DeleteMsgPort(ConPort); |
472 ConPort = NULL; | 472 ConPort = NULL; |
473 } | 473 } |
474 } | 474 } |
475 #endif | 475 #endif |
476 } | 476 } |
493 event.ie_NextEvent = NULL; | 493 event.ie_NextEvent = NULL; |
494 event.ie_Prev1DownCode = event.ie_Prev1DownQual = | 494 event.ie_Prev1DownCode = event.ie_Prev1DownQual = |
495 event.ie_Prev2DownCode = event.ie_Prev2DownQual = 0; | 495 event.ie_Prev2DownCode = event.ie_Prev2DownQual = 0; |
496 | 496 |
497 #ifdef STORMC4_WOS | 497 #ifdef STORMC4_WOS |
498 if ((actual = MapRawKey (&event, buffer, 5, NULL)) >= 0) | 498 if ((actual = MapRawKey(&event, buffer, 5, NULL)) >= 0) |
499 #else | 499 #else |
500 if ((actual = RawKeyConvert (&event, buffer, 5, NULL)) >= 0) | 500 if ((actual = RawKeyConvert(&event, buffer, 5, NULL)) >= 0) |
501 #endif | 501 #endif |
502 { | 502 { |
503 if (actual > 1) { | 503 if (actual > 1) { |
504 D (bug ("Warning (%ld) character conversion!\n", actual)); | 504 D(bug("Warning (%ld) character conversion!\n", actual)); |
505 } else if (actual == 1) { | 505 } else if (actual == 1) { |
506 keysym->sym = *buffer; | 506 keysym->sym = *buffer; |
507 D (bug | 507 D(bug("Converted rawcode %ld to <%lc>\n", code, *buffer)); |
508 ("Converted rawcode %ld to <%lc>\n", code, *buffer)); | |
509 // Bufferizzo x le successive chiamate! | 508 // Bufferizzo x le successive chiamate! |
510 MISC_keymap[code] = *buffer; | 509 MISC_keymap[code] = *buffer; |
511 } | 510 } |
512 } | 511 } |
513 } | 512 } |
520 if (SDL_TranslateUNICODE) { | 519 if (SDL_TranslateUNICODE) { |
521 #if 0 | 520 #if 0 |
522 static XComposeStatus state; | 521 static XComposeStatus state; |
523 /* Until we handle the IM protocol, use XLookupString() */ | 522 /* Until we handle the IM protocol, use XLookupString() */ |
524 unsigned char keybuf[32]; | 523 unsigned char keybuf[32]; |
525 if (XLookupString (xkey, (char *) keybuf, sizeof (keybuf), | 524 if (XLookupString(xkey, (char *) keybuf, sizeof(keybuf), |
526 NULL, &state)) { | 525 NULL, &state)) { |
527 keysym->unicode = keybuf[0]; | 526 keysym->unicode = keybuf[0]; |
528 } | 527 } |
529 #endif | 528 #endif |
530 } | 529 } |
531 return (keysym); | 530 return (keysym); |
532 } | 531 } |
533 | 532 |
534 void | 533 void |
535 amiga_InitOSKeymap (_THIS) | 534 amiga_InitOSKeymap(_THIS) |
536 { | 535 { |
537 amiga_InitKeymap (); | 536 amiga_InitKeymap(); |
538 } | 537 } |
539 | 538 |
540 /* vi: set ts=4 sw=4 expandtab: */ | 539 /* vi: set ts=4 sw=4 expandtab: */ |