TSDL_ActiveEvent = record
type_: byte; // SDL_ACTIVEEVENT
gain: UInt8; // Whether given states were gained or lost (1/0)
state: UInt8; // A mask of the focus states
end;
TSDL_ActiveEvent is a member of the TSDL_Event union and is used when an event of type SDL_ACTIVEEVENT is reported.
When the mouse leaves or enters the window area a SDL_APPMOUSEFOCUS type activation event occurs, if the mouse entered the window then gain will be 1, otherwise gain will be 0. A SDL_APPINPUTFOCUS type activation event occurs when the application loses or gains keyboard focus. This usually occurs when another application is made active. Finally, a SDL_APPACTIVE type event occurs when the application is either minimised/iconified ( gain=0) or restored.
Note: This event does not occur when an application window is first created.