comparison src/video/directfb/SDL_DirectFB_events.c @ 5083:25d4feb7c127

Renamed SDL_keysym to SDL_KeySym Renamed SDL_scancode to SDL_ScanCode Added #defines to SDL_compat.h
author krogoway
date Mon, 24 Jan 2011 13:47:35 -0600
parents b196d2758026
children dc0dfdd58f27
comparison
equal deleted inserted replaced
5082:de59e0218aa2 5083:25d4feb7c127
54 54
55 /* The translation tables from a DirectFB keycode to a SDL keysym */ 55 /* The translation tables from a DirectFB keycode to a SDL keysym */
56 static SDLKey oskeymap[256]; 56 static SDLKey oskeymap[256];
57 57
58 58
59 static SDL_keysym *DirectFB_TranslateKey(_THIS, DFBWindowEvent * evt, 59 static SDL_KeySym *DirectFB_TranslateKey(_THIS, DFBWindowEvent * evt,
60 SDL_keysym * keysym); 60 SDL_KeySym * keysym);
61 static SDL_keysym *DirectFB_TranslateKeyInputEvent(_THIS, int index, 61 static SDL_KeySym *DirectFB_TranslateKeyInputEvent(_THIS, int index,
62 DFBInputEvent * evt, 62 DFBInputEvent * evt,
63 SDL_keysym * keysym); 63 SDL_KeySym * keysym);
64 64
65 static void DirectFB_InitOSKeymap(_THIS, SDLKey * keypmap, int numkeys); 65 static void DirectFB_InitOSKeymap(_THIS, SDLKey * keypmap, int numkeys);
66 static int DirectFB_TranslateButton(DFBInputDeviceButtonIdentifier button); 66 static int DirectFB_TranslateButton(DFBInputDeviceButtonIdentifier button);
67 67
68 static void 68 static void
166 static void 166 static void
167 ProcessWindowEvent(_THIS, DFB_WindowData * p, Uint32 flags, 167 ProcessWindowEvent(_THIS, DFB_WindowData * p, Uint32 flags,
168 DFBWindowEvent * evt) 168 DFBWindowEvent * evt)
169 { 169 {
170 SDL_DFB_DEVICEDATA(_this); 170 SDL_DFB_DEVICEDATA(_this);
171 SDL_keysym keysym; 171 SDL_KeySym keysym;
172 char text[5]; 172 char text[5];
173 173
174 if (evt->clazz == DFEC_WINDOW) { 174 if (evt->clazz == DFEC_WINDOW) {
175 switch (evt->type) { 175 switch (evt->type) {
176 case DWET_BUTTONDOWN: 176 case DWET_BUTTONDOWN:
298 298
299 static void 299 static void
300 ProcessInputEvent(_THIS, DFBInputEvent * ievt) 300 ProcessInputEvent(_THIS, DFBInputEvent * ievt)
301 { 301 {
302 SDL_DFB_DEVICEDATA(_this); 302 SDL_DFB_DEVICEDATA(_this);
303 SDL_keysym keysym; 303 SDL_KeySym keysym;
304 int kbd_idx; 304 int kbd_idx;
305 char text[5]; 305 char text[5];
306 306
307 if (!devdata->use_linux_input) { 307 if (!devdata->use_linux_input) {
308 if (ievt->type == DIET_AXISMOTION) { 308 if (ievt->type == DIET_AXISMOTION) {
547 keymap[DIKI_SLASH - DIKI_UNKNOWN] = SDL_SCANCODE_SLASH; /* AB10 */ 547 keymap[DIKI_SLASH - DIKI_UNKNOWN] = SDL_SCANCODE_SLASH; /* AB10 */
548 keymap[DIKI_LESS_SIGN - DIKI_UNKNOWN] = SDL_SCANCODE_NONUSBACKSLASH; /* 103rd */ 548 keymap[DIKI_LESS_SIGN - DIKI_UNKNOWN] = SDL_SCANCODE_NONUSBACKSLASH; /* 103rd */
549 549
550 } 550 }
551 551
552 static SDL_keysym * 552 static SDL_KeySym *
553 DirectFB_TranslateKey(_THIS, DFBWindowEvent * evt, SDL_keysym * keysym) 553 DirectFB_TranslateKey(_THIS, DFBWindowEvent * evt, SDL_KeySym * keysym)
554 { 554 {
555 SDL_DFB_DEVICEDATA(_this); 555 SDL_DFB_DEVICEDATA(_this);
556 556
557 if (evt->key_code >= 0 && 557 if (evt->key_code >= 0 &&
558 evt->key_code < SDL_arraysize(linux_scancode_table)) 558 evt->key_code < SDL_arraysize(linux_scancode_table))
575 keysym->unicode = evt->key_symbol; 575 keysym->unicode = evt->key_symbol;
576 576
577 return keysym; 577 return keysym;
578 } 578 }
579 579
580 static SDL_keysym * 580 static SDL_KeySym *
581 DirectFB_TranslateKeyInputEvent(_THIS, int index, DFBInputEvent * evt, 581 DirectFB_TranslateKeyInputEvent(_THIS, int index, DFBInputEvent * evt,
582 SDL_keysym * keysym) 582 SDL_KeySym * keysym)
583 { 583 {
584 SDL_DFB_DEVICEDATA(_this); 584 SDL_DFB_DEVICEDATA(_this);
585 585
586 if (evt->key_code >= 0 && 586 if (evt->key_code >= 0 &&
587 evt->key_code < SDL_arraysize(linux_scancode_table)) 587 evt->key_code < SDL_arraysize(linux_scancode_table))
717 DFBInputEvent evt; 717 DFBInputEvent evt;
718 static last_x = 0, last_y = 0; 718 static last_x = 0, last_y = 0;
719 719
720 while (devdata->eventbuffer->GetEvent(devdata->eventbuffer, 720 while (devdata->eventbuffer->GetEvent(devdata->eventbuffer,
721 DFB_EVENT(&evt)) == DFB_OK) { 721 DFB_EVENT(&evt)) == DFB_OK) {
722 SDL_keysym keysym; 722 SDL_KeySym keysym;
723 DFBInputDeviceModifierMask mod; 723 DFBInputDeviceModifierMask mod;
724 724
725 if (evt.clazz = DFEC_INPUT) { 725 if (evt.clazz = DFEC_INPUT) {
726 if (evt.flags & DIEF_MODIFIERS) 726 if (evt.flags & DIEF_MODIFIERS)
727 mod = evt.modifiers; 727 mod = evt.modifiers;