comparison src/video/directfb/SDL_DirectFB_events.c @ 5223:572a73d71b5f

Sheena pointed out that "scancode" and "keysym" are single words and shouldn't be camel-cased.
author Sam Lantinga <slouken@libsdl.org>
date Mon, 07 Feb 2011 09:37:11 -0800
parents 164f20ba08eb
children c1a92e61907d
comparison
equal deleted inserted replaced
5222:9c0593fa27d6 5223:572a73d71b5f
59 int sys_ids; 59 int sys_ids;
60 int sys_kbd; 60 int sys_kbd;
61 }; 61 };
62 62
63 /* The translation tables from a DirectFB keycode to a SDL keysym */ 63 /* The translation tables from a DirectFB keycode to a SDL keysym */
64 static SDL_ScanCode oskeymap[256]; 64 static SDL_Scancode oskeymap[256];
65 65
66 66
67 static SDL_KeySym *DirectFB_TranslateKey(_THIS, DFBWindowEvent * evt, 67 static SDL_Keysym *DirectFB_TranslateKey(_THIS, DFBWindowEvent * evt,
68 SDL_KeySym * keysym); 68 SDL_Keysym * keysym);
69 static SDL_KeySym *DirectFB_TranslateKeyInputEvent(_THIS, DFBInputEvent * evt, 69 static SDL_Keysym *DirectFB_TranslateKeyInputEvent(_THIS, DFBInputEvent * evt,
70 SDL_KeySym * keysym); 70 SDL_Keysym * keysym);
71 71
72 static void DirectFB_InitOSKeymap(_THIS, SDL_ScanCode * keypmap, int numkeys); 72 static void DirectFB_InitOSKeymap(_THIS, SDL_Scancode * keypmap, int numkeys);
73 static int DirectFB_TranslateButton(DFBInputDeviceButtonIdentifier button); 73 static int DirectFB_TranslateButton(DFBInputDeviceButtonIdentifier button);
74 74
75 static void UnicodeToUtf8( Uint16 w , char *utf8buf) 75 static void UnicodeToUtf8( Uint16 w , char *utf8buf)
76 { 76 {
77 unsigned char *utf8s = (unsigned char *) utf8buf; 77 unsigned char *utf8s = (unsigned char *) utf8buf;
174 static void 174 static void
175 ProcessWindowEvent(_THIS, SDL_Window *sdlwin, DFBWindowEvent * evt) 175 ProcessWindowEvent(_THIS, SDL_Window *sdlwin, DFBWindowEvent * evt)
176 { 176 {
177 SDL_DFB_DEVICEDATA(_this); 177 SDL_DFB_DEVICEDATA(_this);
178 SDL_DFB_WINDOWDATA(sdlwin); 178 SDL_DFB_WINDOWDATA(sdlwin);
179 SDL_KeySym keysym; 179 SDL_Keysym keysym;
180 char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; 180 char text[SDL_TEXTINPUTEVENT_TEXT_SIZE];
181 181
182 if (evt->clazz == DFEC_WINDOW) { 182 if (evt->clazz == DFEC_WINDOW) {
183 switch (evt->type) { 183 switch (evt->type) {
184 case DWET_BUTTONDOWN: 184 case DWET_BUTTONDOWN:
306 306
307 static void 307 static void
308 ProcessInputEvent(_THIS, DFBInputEvent * ievt) 308 ProcessInputEvent(_THIS, DFBInputEvent * ievt)
309 { 309 {
310 SDL_DFB_DEVICEDATA(_this); 310 SDL_DFB_DEVICEDATA(_this);
311 SDL_KeySym keysym; 311 SDL_Keysym keysym;
312 int kbd_idx; 312 int kbd_idx;
313 char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; 313 char text[SDL_TEXTINPUTEVENT_TEXT_SIZE];
314 314
315 if (!devdata->use_linux_input) { 315 if (!devdata->use_linux_input) {
316 if (ievt->type == DIET_AXISMOTION) { 316 if (ievt->type == DIET_AXISMOTION) {
446 ProcessInputEvent(_this, &ievt); 446 ProcessInputEvent(_this, &ievt);
447 } 447 }
448 } 448 }
449 449
450 void 450 void
451 DirectFB_InitOSKeymap(_THIS, SDL_ScanCode * keymap, int numkeys) 451 DirectFB_InitOSKeymap(_THIS, SDL_Scancode * keymap, int numkeys)
452 { 452 {
453 int i; 453 int i;
454 454
455 /* Initialize the DirectFB key translation table */ 455 /* Initialize the DirectFB key translation table */
456 for (i = 0; i < numkeys; ++i) 456 for (i = 0; i < numkeys; ++i)
573 keymap[DIKI_SLASH - DIKI_UNKNOWN] = SDL_SCANCODE_SLASH; /* AB10 */ 573 keymap[DIKI_SLASH - DIKI_UNKNOWN] = SDL_SCANCODE_SLASH; /* AB10 */
574 keymap[DIKI_LESS_SIGN - DIKI_UNKNOWN] = SDL_SCANCODE_NONUSBACKSLASH; /* 103rd */ 574 keymap[DIKI_LESS_SIGN - DIKI_UNKNOWN] = SDL_SCANCODE_NONUSBACKSLASH; /* 103rd */
575 575
576 } 576 }
577 577
578 static SDL_KeySym * 578 static SDL_Keysym *
579 DirectFB_TranslateKey(_THIS, DFBWindowEvent * evt, SDL_KeySym * keysym) 579 DirectFB_TranslateKey(_THIS, DFBWindowEvent * evt, SDL_Keysym * keysym)
580 { 580 {
581 SDL_DFB_DEVICEDATA(_this); 581 SDL_DFB_DEVICEDATA(_this);
582 int kbd_idx = 0; /* Window events lag the device source KbdIndex(_this, evt->device_id); */ 582 int kbd_idx = 0; /* Window events lag the device source KbdIndex(_this, evt->device_id); */
583 DFB_KeyboardData *kbd = &devdata->keyboard[kbd_idx]; 583 DFB_KeyboardData *kbd = &devdata->keyboard[kbd_idx];
584 584
603 keysym->unicode = evt->key_symbol; 603 keysym->unicode = evt->key_symbol;
604 604
605 return keysym; 605 return keysym;
606 } 606 }
607 607
608 static SDL_KeySym * 608 static SDL_Keysym *
609 DirectFB_TranslateKeyInputEvent(_THIS, DFBInputEvent * evt, 609 DirectFB_TranslateKeyInputEvent(_THIS, DFBInputEvent * evt,
610 SDL_KeySym * keysym) 610 SDL_Keysym * keysym)
611 { 611 {
612 SDL_DFB_DEVICEDATA(_this); 612 SDL_DFB_DEVICEDATA(_this);
613 int kbd_idx = KbdIndex(_this, evt->device_id); 613 int kbd_idx = KbdIndex(_this, evt->device_id);
614 DFB_KeyboardData *kbd = &devdata->keyboard[kbd_idx]; 614 DFB_KeyboardData *kbd = &devdata->keyboard[kbd_idx];
615 615