mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
Merge pull request #2283 from OTHGMars/SDLFocus
Adds handlers for sdl focus events.
This commit is contained in:
commit
368a0041d1
1 changed files with 7 additions and 3 deletions
|
|
@ -244,7 +244,7 @@ const char * PlatformWindowSDL::getCaption()
|
||||||
|
|
||||||
void PlatformWindowSDL::setFocus()
|
void PlatformWindowSDL::setFocus()
|
||||||
{
|
{
|
||||||
SDL_SetWindowGrab( mWindowHandle, SDL_TRUE );
|
SDL_SetWindowInputFocus(mWindowHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlatformWindowSDL::setClientExtent( const Point2I newExtent )
|
void PlatformWindowSDL::setClientExtent( const Point2I newExtent )
|
||||||
|
|
@ -577,9 +577,7 @@ void PlatformWindowSDL::_processSDLEvent(SDL_Event &evt)
|
||||||
case SDL_MOUSEBUTTONDOWN:
|
case SDL_MOUSEBUTTONDOWN:
|
||||||
case SDL_MOUSEBUTTONUP:
|
case SDL_MOUSEBUTTONUP:
|
||||||
{
|
{
|
||||||
appEvent.trigger(getWindowId(), GainFocus);
|
|
||||||
_triggerMouseButtonNotify(evt);
|
_triggerMouseButtonNotify(evt);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -587,6 +585,12 @@ void PlatformWindowSDL::_processSDLEvent(SDL_Event &evt)
|
||||||
{
|
{
|
||||||
switch( evt.window.event )
|
switch( evt.window.event )
|
||||||
{
|
{
|
||||||
|
case SDL_WINDOWEVENT_FOCUS_GAINED:
|
||||||
|
appEvent.trigger(getWindowId(), GainFocus);
|
||||||
|
break;
|
||||||
|
case SDL_WINDOWEVENT_FOCUS_LOST:
|
||||||
|
appEvent.trigger(getWindowId(), LoseFocus);
|
||||||
|
break;
|
||||||
case SDL_WINDOWEVENT_MAXIMIZED:
|
case SDL_WINDOWEVENT_MAXIMIZED:
|
||||||
case SDL_WINDOWEVENT_RESIZED:
|
case SDL_WINDOWEVENT_RESIZED:
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue