diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2010-10-19 04:45:37 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2010-10-19 04:45:37 +0400 |
commit | a377a7edf67869722c585086ac6ab1f295cbff87 (patch) | |
tree | 1736de08fe9174761607dce5d54a16af25eba049 /intern/ghost/intern/GHOST_SystemWin32.h | |
parent | 08232350d5797302e3638e69ec78657d853976aa (diff) | |
parent | b743454ce1c361e6161da8ae5f840c2befe3a081 (diff) |
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r32300:32571soc-2010-nicolasbishop
Diffstat (limited to 'intern/ghost/intern/GHOST_SystemWin32.h')
-rw-r--r-- | intern/ghost/intern/GHOST_SystemWin32.h | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/intern/ghost/intern/GHOST_SystemWin32.h b/intern/ghost/intern/GHOST_SystemWin32.h index 35b8debf6b4..3cd1deefda0 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.h +++ b/intern/ghost/intern/GHOST_SystemWin32.h @@ -239,7 +239,7 @@ protected: * @param lParam The lParam from the wndproc * @return The GHOST key (GHOST_kKeyUnknown if no match). */ - virtual GHOST_TKey convertKey(WPARAM wParam, LPARAM lParam) const; + virtual GHOST_TKey convertKey(GHOST_IWindow *window, WPARAM wParam, LPARAM lParam) const; /** * Creates modifier key event(s) and updates the key data stored locally (m_modifierKeys). @@ -248,7 +248,7 @@ protected: * events generated for both keys. * @param window The window receiving the event (the active window). */ - void processModifierKeys(GHOST_IWindow *window); + GHOST_EventKey* processModifierKeys(GHOST_IWindow *window); /** * Creates mouse button event. @@ -310,6 +310,11 @@ protected: * @param keys The new state of the modifier keys. */ inline virtual void storeModifierKeys(const GHOST_ModifierKeys& keys); + + /** + * Check current key layout for AltGr + */ + inline virtual void keyboardAltGr(); /** * Windows call back routine for our window class. @@ -324,11 +329,8 @@ protected: __int64 m_freq; /** High frequency timer variable. */ __int64 m_start; - /** Stores the capability of this system to distinguish left and right modifier keys. */ - bool m_separateLeftRight; - /** Stores the initialization state of the member m_leftRightDistinguishable. */ - bool m_separateLeftRightInitialized; - + /** AltGr on current keyboard layout. */ + bool m_hasAltGr; }; inline void GHOST_SystemWin32::retrieveModifierKeys(GHOST_ModifierKeys& keys) const @@ -341,5 +343,22 @@ inline void GHOST_SystemWin32::storeModifierKeys(const GHOST_ModifierKeys& keys) m_modifierKeys = keys; } +inline void GHOST_SystemWin32::keyboardAltGr() +{ + HKL keylayout = GetKeyboardLayout(0); // get keylayout for current thread + int i; + SHORT s; + for(m_hasAltGr = false, i = 32; i < 256; ++i) { + s = VkKeyScanEx((char)i, keylayout); + // s == -1 means no key that translates passed char code + // high byte contains shift state. bit 2 ctrl pressed, bit 4 alt pressed + // if both are pressed, we have AltGr keycombo on keylayout + if(s!=-1 && (s & 0x600) == 0x600) { + m_hasAltGr = true; + break; + } + } +} + #endif // _GHOST_SYSTEM_WIN32_H_ |