comparison src/video/x11/SDL_x11keyboard.c @ 4661:03dcb795c583

Merged changes from the main SDL codebase
author Sam Lantinga <slouken@libsdl.org>
date Mon, 12 Jul 2010 21:09:23 -0700
parents 3e69e077cb95
children ce811c9247da
comparison
equal deleted inserted replaced
4660:b15e7017409b 4661:03dcb795c583
170 170
171 int 171 int
172 X11_InitKeyboard(_THIS) 172 X11_InitKeyboard(_THIS)
173 { 173 {
174 SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; 174 SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
175 SDL_Keyboard keyboard;
176 int i, j; 175 int i, j;
177 int min_keycode, max_keycode; 176 int min_keycode, max_keycode;
178 struct { 177 struct {
179 SDL_scancode scancode; 178 SDL_scancode scancode;
180 KeySym keysym; 179 KeySym keysym;
249 } 248 }
250 } 249 }
251 } 250 }
252 } 251 }
253 252
254 SDL_zero(keyboard);
255 data->keyboard = SDL_AddKeyboard(&keyboard, -1);
256 X11_UpdateKeymap(_this); 253 X11_UpdateKeymap(_this);
257 254
258 SDL_SetScancodeName(SDL_SCANCODE_APPLICATION, "Menu"); 255 SDL_SetScancodeName(SDL_SCANCODE_APPLICATION, "Menu");
259 256
260 return 0; 257 return 0;
278 continue; 275 continue;
279 } 276 }
280 277
281 keymap[scancode] = X11_KeyCodeToSDLKey(data->display, (KeyCode)i); 278 keymap[scancode] = X11_KeyCodeToSDLKey(data->display, (KeyCode)i);
282 } 279 }
283 SDL_SetKeymap(data->keyboard, 0, keymap, SDL_NUM_SCANCODES); 280 SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES);
284 } 281 }
285 282
286 void 283 void
287 X11_QuitKeyboard(_THIS) 284 X11_QuitKeyboard(_THIS)
288 { 285 {
289 SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
290
291 SDL_DelKeyboard(data->keyboard);
292 } 286 }
293 287
294 /* vi: set ts=4 sw=4 expandtab: */ 288 /* vi: set ts=4 sw=4 expandtab: */