comparison test/checkkeys.c @ 2300:c97ad1abe05b

Minimal implementation of textinput events for x11. It only works for latin-1.
author Bob Pendleton <bob@pendleton.com>
date Tue, 15 Jan 2008 22:37:17 +0000
parents dbc6d1893869
children d87417504c75
comparison
equal deleted inserted replaced
2299:a7cbc25071b6 2300:c97ad1abe05b
87 } 87 }
88 print_modifiers(); 88 print_modifiers();
89 printf("\n"); 89 printf("\n");
90 } 90 }
91 91
92 static void
93 PrintText(char *text)
94 {
95 }
96
92 int 97 int
93 main(int argc, char *argv[]) 98 main(int argc, char *argv[])
94 { 99 {
95 SDL_Event event; 100 SDL_Event event;
96 int done; 101 int done;
137 PrintKey(&event.key.keysym, 1); 142 PrintKey(&event.key.keysym, 1);
138 break; 143 break;
139 case SDL_KEYUP: 144 case SDL_KEYUP:
140 PrintKey(&event.key.keysym, 0); 145 PrintKey(&event.key.keysym, 0);
141 break; 146 break;
147 case SDL_TEXTINPUT:
148 PrintText(event.text.text);
149 break;
142 case SDL_MOUSEBUTTONDOWN: 150 case SDL_MOUSEBUTTONDOWN:
143 /* Any button press quits the app... */ 151 /* Any button press quits the app... */
144 case SDL_QUIT: 152 case SDL_QUIT:
145 done = 1; 153 done = 1;
146 break; 154 break;