mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 06:34:35 +00:00
SDL takes care of handling mouse relative mode on focus change
This commit is contained in:
parent
657c0135b1
commit
0cc61b27a2
1 changed files with 0 additions and 11 deletions
|
|
@ -187,17 +187,6 @@ static void loop(void)
|
|||
SDL_GetDisplayName(SDL_GetDisplayForWindow(window)));
|
||||
}
|
||||
}
|
||||
if (event.type == SDL_EVENT_WINDOW_FOCUS_LOST) {
|
||||
relative_mode = SDL_GetRelativeMouseMode();
|
||||
if (relative_mode) {
|
||||
SDL_SetRelativeMouseMode(SDL_FALSE);
|
||||
}
|
||||
}
|
||||
if (event.type == SDL_EVENT_WINDOW_FOCUS_GAINED) {
|
||||
if (relative_mode) {
|
||||
SDL_SetRelativeMouseMode(SDL_TRUE);
|
||||
}
|
||||
}
|
||||
if (event.type == SDL_EVENT_KEY_UP) {
|
||||
SDL_bool updateCursor = SDL_FALSE;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue