Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Fixed compile errors

  • Loading branch information
slouken committed Feb 7, 2008
1 parent fc16ee0 commit 36d8a26ed0c33cdb94930779ac442324b596179c
Showing with 19 additions and 18 deletions.
  1. +3 −3 src/video/x11/SDL_x11events.c
  2. +1 −1 src/video/x11/SDL_x11keyboard.c
  3. +10 −10 test/common.c
  4. +5 −4 test/testkeys.c
@@ -145,7 +145,7 @@ X11_DispatchEvent(_THIS)
#ifdef DEBUG_XEVENTS
printf("MappingNotify!\n");
#endif
X11_UpdateKeymap(this);
X11_UpdateKeymap(_this);
}
break;

@@ -177,7 +177,7 @@ X11_DispatchEvent(_THIS)
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 @@ X11_DispatchEvent(_THIS)
#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);
@@ -364,7 +364,7 @@ X11_InitKeyboard(_THIS)

SDL_zero(keyboard);
data->keyboard = SDL_AddKeyboard(&keyboard, -1);
X11_UpdateKeymap(this);
X11_UpdateKeymap(_this);

SDL_SetScancodeName(SDL_SCANCODE_APPLICATION, "Menu");

@@ -804,19 +804,19 @@ PrintEvent(SDL_Event * event)
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",
@@ -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 <stdio.h>
#include <ctype.h>
@@ -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);

0 comments on commit 36d8a26

Please sign in to comment.