comparison src/video/x11/SDL_x11keyboard.c @ 4465:3e69e077cb95

Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API. Plus, this lets me start implementing cursor support.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 09 May 2010 20:47:22 -0700
parents f7b03b6838cb
children ce811c9247da
comparison
equal deleted inserted replaced
4464:fa77a6429698 4465:3e69e077cb95
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: */