diff options
Diffstat (limited to 'xbmc/windowing/windows/WinEventsWin32.cpp')
-rw-r--r-- | xbmc/windowing/windows/WinEventsWin32.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/xbmc/windowing/windows/WinEventsWin32.cpp b/xbmc/windowing/windows/WinEventsWin32.cpp index 9abe5299e6..3bf3c0813a 100644 --- a/xbmc/windowing/windows/WinEventsWin32.cpp +++ b/xbmc/windowing/windows/WinEventsWin32.cpp @@ -308,24 +308,28 @@ static XBMC_keysym *TranslateKey(WPARAM vkey, UINT scancode, XBMC_keysym *keysym // Set the modifier bitmap mod = (uint16_t) XBMCKMOD_NONE; + + // If left control and right alt are down this usually means that + // AltGr is down + if ((keystate[VK_LCONTROL] & 0x80) && (keystate[VK_RMENU] & 0x80)) + { + mod |= XBMCKMOD_MODE; + } + else + { + if (keystate[VK_LCONTROL] & 0x80) mod |= XBMCKMOD_LCTRL; + if (keystate[VK_RMENU] & 0x80) mod |= XBMCKMOD_RALT; + } + + // Check the remaining modifiers if (keystate[VK_LSHIFT] & 0x80) mod |= XBMCKMOD_LSHIFT; if (keystate[VK_RSHIFT] & 0x80) mod |= XBMCKMOD_RSHIFT; - if (keystate[VK_LCONTROL] & 0x80) mod |= XBMCKMOD_LCTRL; if (keystate[VK_RCONTROL] & 0x80) mod |= XBMCKMOD_RCTRL; if (keystate[VK_LMENU] & 0x80) mod |= XBMCKMOD_LALT; - if (keystate[VK_RMENU] & 0x80) mod |= XBMCKMOD_RALT; if (keystate[VK_LWIN] & 0x80) mod |= XBMCKMOD_LSUPER; if (keystate[VK_RWIN] & 0x80) mod |= XBMCKMOD_LSUPER; keysym->mod = (XBMCMod) mod; -/* Ignore these modifiers for now; we may handle these in the future. - XBMCKMOD_LMETA = 0x0400 - XBMCKMOD_RMETA = 0x0800 - XBMCKMOD_NUM = 0x1000 - XBMCKMOD_CAPS = 0x2000 - XBMCKMOD_MODE = 0x4000 -*/ - // Return the updated keysym return(keysym); } |