Skip to content

Commit

Permalink
Implement window focus events with SDL 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ccawley2011 authored and hifi committed Mar 16, 2024
1 parent e57652a commit 2b506ad
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions common/wwkeyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,17 @@ void WWKeyboardClass::Fill_Buffer_From_System(void)

Put_Mouse_Message(key, x, y, event.type == SDL_MOUSEBUTTONDOWN ? false : true);
} break;
#ifdef SDL1_BUILD
case SDL_ACTIVEEVENT:
if (event.active.state & SDL_APPINPUTFOCUS) {
if (event.active.gain) {
Focus_Restore();
} else {
Focus_Loss();
}
}
break;
#endif
#ifdef SDL2_BUILD
case SDL_WINDOWEVENT:
switch (event.window.event) {
Expand Down

0 comments on commit 2b506ad

Please sign in to comment.