Calling postExitEvent() for Meta+Q as in other entries.

This commit is contained in:
Dario Manesku 2015-03-06 01:04:49 +01:00
parent 701cd3b3c9
commit 382c0b685b

View file

@ -313,17 +313,20 @@ namespace entry
uint8_t pressedChar[4];
Key::Enum key = handleKeyEvent(event, &modifiers, &pressedChar[0]);
// If KeyCode is none we don't don't handle the key and special case for cmd+q (quit)
// Note that return false here means that we take care of the key (instead of the default behavior)
// Returning false means that we take care of the key (instead of the default behavior)
if (key != Key::None)
{
if ( (Key::Key0 <= key && key <= Key::KeyZ)
|| (Key::Esc <= key && key <= Key::Minus) )
if (key == Key::KeyQ && (modifiers & Modifier::RightMeta) )
{
m_eventQueue.postExitEvent();
}
else if ( (Key::Key0 <= key && key <= Key::KeyZ)
|| (Key::Esc <= key && key <= Key::Minus) )
{
m_eventQueue.postCharEvent(s_defaultWindow, 1, pressedChar);
return false;
}
else if (key != Key::KeyQ
&& !(modifiers & Modifier::RightMeta) )
else
{
m_eventQueue.postKeyEvent(s_defaultWindow, key, modifiers, true);
return false;
@ -446,7 +449,6 @@ namespace entry
}
}
m_eventQueue.postExitEvent();
while (bgfx::RenderFrame::NoContext != bgfx::renderFrame() ) {};