mirror of
https://github.com/love2d/megasource.git
synced 2026-08-19 12:14:41 +02:00
Updated SDL2 to the latest code from Mercurial.
This commit is contained in:
@@ -845,6 +845,19 @@ SDL_SetModState(SDL_Keymod modstate)
|
||||
keyboard->modstate = modstate;
|
||||
}
|
||||
|
||||
/* Note that SDL_ToggleModState() is not a public API. SDL_SetModState() is. */
|
||||
void
|
||||
SDL_ToggleModState(const SDL_Keymod modstate, const SDL_bool toggle)
|
||||
{
|
||||
SDL_Keyboard *keyboard = &SDL_keyboard;
|
||||
if (toggle) {
|
||||
keyboard->modstate |= modstate;
|
||||
} else {
|
||||
keyboard->modstate &= ~modstate;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SDL_Keycode
|
||||
SDL_GetKeyFromScancode(SDL_Scancode scancode)
|
||||
{
|
||||
|
||||
@@ -62,6 +62,9 @@ extern void SDL_KeyboardQuit(void);
|
||||
/* Convert to UTF-8 */
|
||||
extern char *SDL_UCS4ToUTF8(Uint32 ch, char *dst);
|
||||
|
||||
/* Toggle on or off pieces of the keyboard mod state. */
|
||||
extern void SDL_ToggleModState(const SDL_Keymod modstate, const SDL_bool toggle);
|
||||
|
||||
#endif /* _SDL_keyboard_c_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
@@ -127,6 +127,7 @@ SDL_SendWindowEvent(SDL_Window * window, Uint8 windowevent, int data1,
|
||||
if (window->flags & SDL_WINDOW_MINIMIZED) {
|
||||
return 0;
|
||||
}
|
||||
window->flags &= ~SDL_WINDOW_MAXIMIZED;
|
||||
window->flags |= SDL_WINDOW_MINIMIZED;
|
||||
SDL_OnWindowMinimized(window);
|
||||
break;
|
||||
@@ -134,6 +135,7 @@ SDL_SendWindowEvent(SDL_Window * window, Uint8 windowevent, int data1,
|
||||
if (window->flags & SDL_WINDOW_MAXIMIZED) {
|
||||
return 0;
|
||||
}
|
||||
window->flags &= ~SDL_WINDOW_MINIMIZED;
|
||||
window->flags |= SDL_WINDOW_MAXIMIZED;
|
||||
break;
|
||||
case SDL_WINDOWEVENT_RESTORED:
|
||||
|
||||
Reference in New Issue
Block a user