Changeset View
Changeset View
Standalone View
Standalone View
intern/ghost/intern/GHOST_SystemWin32.h
| Show First 20 Lines • Show All 434 Lines • ▼ Show 20 Lines | #endif | ||||
| /** High frequency timer variable. */ | /** High frequency timer variable. */ | ||||
| __int64 m_freq; | __int64 m_freq; | ||||
| /** High frequency timer variable. */ | /** High frequency timer variable. */ | ||||
| __int64 m_start; | __int64 m_start; | ||||
| /** Low frequency timer variable. */ | /** Low frequency timer variable. */ | ||||
| __int64 m_lfstart; | __int64 m_lfstart; | ||||
| /** AltGr on current keyboard layout. */ | /** AltGr on current keyboard layout. */ | ||||
| bool m_hasAltGr; | bool m_hasAltGr; | ||||
| /** Language identifier. */ | |||||
| WORD m_langId; | |||||
| /** Stores keyboard layout. */ | /** Stores keyboard layout. */ | ||||
| HKL m_keylayout; | HKL m_keylayout; | ||||
| /** Console status. */ | /** Console status. */ | ||||
| int m_consoleStatus; | int m_consoleStatus; | ||||
| /** Wheel delta accumulator. */ | /** Wheel delta accumulator. */ | ||||
| int m_wheelDeltaAccum; | int m_wheelDeltaAccum; | ||||
| Show All 10 Lines | |||||
| } | } | ||||
| inline void GHOST_SystemWin32::handleKeyboardChange(void) | inline void GHOST_SystemWin32::handleKeyboardChange(void) | ||||
| { | { | ||||
| m_keylayout = GetKeyboardLayout(0); // get keylayout for current thread | m_keylayout = GetKeyboardLayout(0); // get keylayout for current thread | ||||
| int i; | int i; | ||||
| SHORT s; | SHORT s; | ||||
| // save the language identifier. | |||||
| m_langId = LOWORD(m_keylayout); | |||||
| for (m_hasAltGr = false, i = 32; i < 256; ++i) { | for (m_hasAltGr = false, i = 32; i < 256; ++i) { | ||||
| s = VkKeyScanEx((char)i, m_keylayout); | s = VkKeyScanEx((char)i, m_keylayout); | ||||
| // s == -1 means no key that translates passed char code | // s == -1 means no key that translates passed char code | ||||
| // high byte contains shift state. bit 2 ctrl pressed, bit 4 alt pressed | // high byte contains shift state. bit 2 ctrl pressed, bit 4 alt pressed | ||||
| // if both are pressed, we have AltGr keycombo on keylayout | // if both are pressed, we have AltGr keycombo on keylayout | ||||
| if (s != -1 && (s & 0x600) == 0x600) { | if (s != -1 && (s & 0x600) == 0x600) { | ||||
| m_hasAltGr = true; | m_hasAltGr = true; | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||