comparison test/checkkeys.c @ 2305:fbe8ff44c519

First pass of new SDL scancode concept for X11.
author Sam Lantinga <slouken@libsdl.org>
date Thu, 07 Feb 2008 15:31:09 +0000
parents d87417504c75
children 47f8a579cd9b
comparison
equal deleted inserted replaced
2304:50f58ce12497 2305:fbe8ff44c519
89 } 89 }
90 90
91 static void 91 static void
92 PrintText(char *text) 92 PrintText(char *text)
93 { 93 {
94 printf("Text: %s\n", text);
94 } 95 }
95 96
96 int 97 int
97 main(int argc, char *argv[]) 98 main(int argc, char *argv[])
98 { 99 {
122 fprintf(stderr, "Couldn't set 640x480 video mode: %s\n", 123 fprintf(stderr, "Couldn't set 640x480 video mode: %s\n",
123 SDL_GetError()); 124 SDL_GetError());
124 quit(2); 125 quit(2);
125 } 126 }
126 127
127 /* Enable UNICODE translation for keyboard input */
128 SDL_EnableUNICODE(1);
129
130 /* Enable auto repeat for keyboard input */
131 SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY,
132 SDL_DEFAULT_REPEAT_INTERVAL);
133
134 /* Watch keystrokes */ 128 /* Watch keystrokes */
135 done = 0; 129 done = 0;
136 while (!done) { 130 while (!done) {
137 /* Check for events */ 131 /* Check for events */
138 SDL_WaitEvent(&event); 132 SDL_WaitEvent(&event);