src/events/SDL_keyboard.c
changeset 4437 25e45611fa3d
parent 4435 e953700da4ca
child 4465 3e69e077cb95
child 4713 ba38983b10c2
     1.1 --- a/src/events/SDL_keyboard.c	Thu Apr 15 22:27:50 2010 -0700
     1.2 +++ b/src/events/SDL_keyboard.c	Tue Apr 20 07:16:42 2010 -0700
     1.3 @@ -813,7 +813,7 @@
     1.4          event.key.keysym.sym = keyboard->keymap[scancode];
     1.5          event.key.keysym.mod = modstate;
     1.6          event.key.keysym.unicode = 0;
     1.7 -        event.key.windowID = keyboard->focus->id;
     1.8 +        event.key.windowID = keyboard->focus ? keyboard->focus->id : 0;
     1.9          posted = (SDL_PushEvent(&event) > 0);
    1.10      }
    1.11      return (posted);
    1.12 @@ -837,7 +837,7 @@
    1.13          event.text.windowID = keyboard->focus ? keyboard->focus->id : 0;
    1.14          event.text.which = (Uint8) index;
    1.15          SDL_strlcpy(event.text.text, text, SDL_arraysize(event.text.text));
    1.16 -        event.text.windowID = keyboard->focus->id;
    1.17 +        event.text.windowID = keyboard->focus ? keyboard->focus->id : 0;
    1.18          posted = (SDL_PushEvent(&event) > 0);
    1.19      }
    1.20      return (posted);