src/events/SDL_keyboard.c
changeset 4437 25e45611fa3d
parent 4435 e953700da4ca
child 4465 3e69e077cb95
child 4713 ba38983b10c2
equal deleted inserted replaced
4436:d3c193100522 4437:25e45611fa3d
   811         event.key.state = state;
   811         event.key.state = state;
   812         event.key.keysym.scancode = scancode;
   812         event.key.keysym.scancode = scancode;
   813         event.key.keysym.sym = keyboard->keymap[scancode];
   813         event.key.keysym.sym = keyboard->keymap[scancode];
   814         event.key.keysym.mod = modstate;
   814         event.key.keysym.mod = modstate;
   815         event.key.keysym.unicode = 0;
   815         event.key.keysym.unicode = 0;
   816         event.key.windowID = keyboard->focus->id;
   816         event.key.windowID = keyboard->focus ? keyboard->focus->id : 0;
   817         posted = (SDL_PushEvent(&event) > 0);
   817         posted = (SDL_PushEvent(&event) > 0);
   818     }
   818     }
   819     return (posted);
   819     return (posted);
   820 }
   820 }
   821 
   821 
   835         SDL_Event event;
   835         SDL_Event event;
   836         event.text.type = SDL_TEXTINPUT;
   836         event.text.type = SDL_TEXTINPUT;
   837         event.text.windowID = keyboard->focus ? keyboard->focus->id : 0;
   837         event.text.windowID = keyboard->focus ? keyboard->focus->id : 0;
   838         event.text.which = (Uint8) index;
   838         event.text.which = (Uint8) index;
   839         SDL_strlcpy(event.text.text, text, SDL_arraysize(event.text.text));
   839         SDL_strlcpy(event.text.text, text, SDL_arraysize(event.text.text));
   840         event.text.windowID = keyboard->focus->id;
   840         event.text.windowID = keyboard->focus ? keyboard->focus->id : 0;
   841         posted = (SDL_PushEvent(&event) > 0);
   841         posted = (SDL_PushEvent(&event) > 0);
   842     }
   842     }
   843     return (posted);
   843     return (posted);
   844 }
   844 }
   845 
   845