You need to sign in or sign up before continuing.
Commit a788e7ca authored by bitplane's avatar bitplane

Capture Alt+F4 in Windows SDL device and close it

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2287 dfc29bdd-3216-0410-991c-e03cc46cb475
parent be6fd3df
Changes in 1.6
- ALT+F4 keypress now closes Windows SDL device
- Allow Direct3D drivers in SDL, patch by Halifax
- Added compiler error when attempting to compile with VC6.
......
......@@ -383,9 +383,19 @@ bool CIrrDeviceSDL::run()
if (idx != -1)
{
EKEY_CODE key = (EKEY_CODE)KeyMap[idx].Win32Key;
#ifdef _IRR_WINDOWS_API_
// handle alt+f4 in Windows, because SDL seems not to
if ( (SDL_event.key.keysym.mod & KMOD_LALT) && key == KEY_F4)
{
Close = true;
break;
}
#endif
irrevent.EventType = irr::EET_KEY_INPUT_EVENT;
irrevent.KeyInput.Char = SDL_event.key.keysym.unicode;
irrevent.KeyInput.Key = (EKEY_CODE)KeyMap[idx].Win32Key;
irrevent.KeyInput.Key = key;
irrevent.KeyInput.PressedDown = (SDL_event.type == SDL_KEYDOWN);
irrevent.KeyInput.Shift = (SDL_event.key.keysym.mod & KMOD_SHIFT) != 0;
irrevent.KeyInput.Control = (SDL_event.key.keysym.mod & KMOD_CTRL ) != 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment