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 committed Jun 17, 2023
1 parent a36cba3 commit 6b7fda4
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 @@ -604,6 +604,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 6b7fda4

Please sign in to comment.