diff src/events/SDL_keyboard.c @ 3685:64ce267332c6

Switched from SDL_WindowID and SDL_TextureID to SDL_Window* and SDL_Texture* for code simplicity and improved performance.
author Sam Lantinga <slouken@libsdl.org>
date Thu, 21 Jan 2010 06:21:52 +0000
parents 98a819296cdc
children f7b03b6838cb
line wrap: on
line diff
--- a/src/events/SDL_keyboard.c	Thu Jan 21 05:49:41 2010 +0000
+++ b/src/events/SDL_keyboard.c	Thu Jan 21 06:21:52 2010 +0000
@@ -646,7 +646,7 @@
 }
 
 void
-SDL_SetKeyboardFocus(int index, SDL_WindowID windowID)
+SDL_SetKeyboardFocus(int index, SDL_Window * window)
 {
     SDL_Keyboard *keyboard = SDL_GetKeyboard(index);
     int i;
@@ -657,7 +657,7 @@
     }
 
     /* See if the current window has lost focus */
-    if (keyboard->focus && keyboard->focus != windowID) {
+    if (keyboard->focus && keyboard->focus != window) {
         focus = SDL_FALSE;
         for (i = 0; i < SDL_num_keyboards; ++i) {
             if (i != index) {
@@ -674,7 +674,7 @@
         }
     }
 
-    keyboard->focus = windowID;
+    keyboard->focus = window;
 
     if (keyboard->focus) {
         SDL_SendWindowEvent(keyboard->focus, SDL_WINDOWEVENT_FOCUS_GAINED,
@@ -809,7 +809,7 @@
         event.key.keysym.sym = keyboard->keymap[scancode];
         event.key.keysym.mod = modstate;
         event.key.keysym.unicode = 0;
-        event.key.windowID = keyboard->focus;
+        event.key.windowID = keyboard->focus->id;
         posted = (SDL_PushEvent(&event) > 0);
     }
     return (posted);
@@ -832,7 +832,7 @@
         event.text.type = SDL_TEXTINPUT;
         event.text.which = (Uint8) index;
         SDL_strlcpy(event.text.text, text, SDL_arraysize(event.text.text));
-        event.text.windowID = keyboard->focus;
+        event.text.windowID = keyboard->focus->id;
         posted = (SDL_PushEvent(&event) > 0);
     }
     return (posted);