# HG changeset patch # User Sam Lantinga # Date 1202400029 0 # Node ID 1a8bab15a45d057e9cb7bac6a1cd7fd946f30a71 # Parent fbe8ff44c519924ccc9070c333ea54ea51256741 Fixed compile errors diff -r fbe8ff44c519 -r 1a8bab15a45d src/video/x11/SDL_x11events.c --- a/src/video/x11/SDL_x11events.c Thu Feb 07 15:31:09 2008 +0000 +++ b/src/video/x11/SDL_x11events.c Thu Feb 07 16:00:29 2008 +0000 @@ -145,7 +145,7 @@ #ifdef DEBUG_XEVENTS printf("MappingNotify!\n"); #endif - X11_UpdateKeymap(this); + X11_UpdateKeymap(_this); } break; @@ -177,7 +177,7 @@ case KeyPress:{ KeyCode keycode = xevent.xkey.keycode; KeySym keysym = NoSymbol; - char text[sizeof(SDL_TEXTINPUTEVENT_TEXT_SIZE)]; + char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; Uint32 ucs4 = 0; #ifdef DEBUG_XEVENTS @@ -199,7 +199,7 @@ #endif /* Xutf8LookupString(), works for Latin-1 */ SDL_zero(text); - XLookupString(&xevent, text, sizeof(text), &keysym, NULL); + XLookupString(&xevent.xkey, text, sizeof(text), &keysym, NULL); if (*text) { printf("Sending text event %s\n", text); SDL_SendKeyboardText(videodata->keyboard, text); diff -r fbe8ff44c519 -r 1a8bab15a45d src/video/x11/SDL_x11keyboard.c --- a/src/video/x11/SDL_x11keyboard.c Thu Feb 07 15:31:09 2008 +0000 +++ b/src/video/x11/SDL_x11keyboard.c Thu Feb 07 16:00:29 2008 +0000 @@ -364,7 +364,7 @@ SDL_zero(keyboard); data->keyboard = SDL_AddKeyboard(&keyboard, -1); - X11_UpdateKeymap(this); + X11_UpdateKeymap(_this); SDL_SetScancodeName(SDL_SCANCODE_APPLICATION, "Menu"); diff -r fbe8ff44c519 -r 1a8bab15a45d test/common.c --- a/test/common.c Thu Feb 07 15:31:09 2008 +0000 +++ b/test/common.c Thu Feb 07 16:00:29 2008 +0000 @@ -804,19 +804,19 @@ break; case SDL_KEYDOWN: fprintf(stderr, - "Keyboard %d: key pressed in window %d: physical 0x%08X = %s, layout 0x%08X = %s", - event->key.which, event->key.windowID, event->key.keysym.sym, - SDL_GetKeyName(event->key.keysym.sym), - SDL_GetLayoutKey(event->key.keysym.sym), - SDL_GetKeyName(SDL_GetLayoutKey(event->key.keysym.sym))); + "Keyboard %d: key pressed in window %d: scancode 0x%08X = %s, keycode 0x%08X = %s", + event->key.which, event->key.windowID, + event->key.keysym.scancode, + SDL_GetScancodeName(event->key.keysym.scancode), + event->key.keysym.sym, SDL_GetKeyName(event->key.keysym.sym)); break; case SDL_KEYUP: fprintf(stderr, - "Keyboard %d: key released in window %d: physical 0x%08X = %s, layout 0x%08X = %s", - event->key.which, event->key.windowID, event->key.keysym.sym, - SDL_GetKeyName(event->key.keysym.sym), - SDL_GetLayoutKey(event->key.keysym.sym), - SDL_GetKeyName(SDL_GetLayoutKey(event->key.keysym.sym))); + "Keyboard %d: key released in window %d: scancode 0x%08X = %s, keycode 0x%08X = %s", + event->key.which, event->key.windowID, + event->key.keysym.scancode, + SDL_GetScancodeName(event->key.keysym.scancode), + event->key.keysym.sym, SDL_GetKeyName(event->key.keysym.sym)); break; case SDL_TEXTINPUT: fprintf(stderr, "Keyboard %d: text input \"%s\" in window %d", diff -r fbe8ff44c519 -r 1a8bab15a45d test/testkeys.c --- a/test/testkeys.c Thu Feb 07 15:31:09 2008 +0000 +++ b/test/testkeys.c Thu Feb 07 16:00:29 2008 +0000 @@ -1,5 +1,5 @@ -/* Print out all the keysyms we have, just to verify them */ +/* Print out all the scancodes we have, just to verify them */ #include #include @@ -11,14 +11,15 @@ int main(int argc, char *argv[]) { - SDLKey key; + SDL_scancode scancode; if (SDL_Init(SDL_INIT_VIDEO) < 0) { fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError()); exit(1); } - for (key = SDLK_FIRST; key < SDLK_LAST; ++key) { - printf("Key #%d, \"%s\"\n", key, SDL_GetKeyName(key)); + for (scancode = 0; scancode < SDL_NUM_SCANCODES; ++scancode) { + printf("Scancode #%d, \"%s\"\n", scancode, + SDL_GetScancodeName(scancode)); } SDL_Quit(); return (0);