src/events/SDL_keyboard.c
changeset 9973 4d8a561cf978
parent 9678 9e8323b058d6
child 9998 f67cf37e9cd4
     1.1 --- a/src/events/SDL_keyboard.c	Sun Dec 27 23:39:43 2015 -0500
     1.2 +++ b/src/events/SDL_keyboard.c	Mon Dec 28 13:07:44 2015 -0500
     1.3 @@ -845,6 +845,19 @@
     1.4      keyboard->modstate = modstate;
     1.5  }
     1.6  
     1.7 +/* Note that SDL_ToggleModState() is not a public API. SDL_SetModState() is. */
     1.8 +void
     1.9 +SDL_ToggleModState(const SDL_Keymod modstate, const SDL_bool toggle)
    1.10 +{
    1.11 +    SDL_Keyboard *keyboard = &SDL_keyboard;
    1.12 +    if (toggle) {
    1.13 +        keyboard->modstate |= modstate;
    1.14 +    } else {
    1.15 +        keyboard->modstate &= ~modstate;
    1.16 +    }
    1.17 +}
    1.18 +
    1.19 +
    1.20  SDL_Keycode
    1.21  SDL_GetKeyFromScancode(SDL_Scancode scancode)
    1.22  {