PlatformKeyboardEvent::PlatformKeyboardEvent(HWND, WPARAM code, LPARAM keyData, Type type, bool systemKey) : PlatformEvent(type, GetKeyState(VK_SHIFT) & HIGH_BIT_MASK_SHORT, GetKeyState(VK_CONTROL) & HIGH_BIT_MASK_SHORT, GetKeyState(VK_MENU) & HIGH_BIT_MASK_SHORT, false, ::GetTickCount() * 0.001) , m_text((type == PlatformEvent::Char) ? singleCharacterString(code) : String()) , m_unmodifiedText((type == PlatformEvent::Char) ? singleCharacterString(code) : String()) , m_keyIdentifier((type == PlatformEvent::Char) ? String() : keyIdentifierForWindowsKeyCode(code)) , m_windowsVirtualKeyCode((type == RawKeyDown || type == KeyUp) ? code : 0) , m_nativeVirtualKeyCode(m_windowsVirtualKeyCode) , m_macCharCode(0) , m_autoRepeat(HIWORD(keyData) & KF_REPEAT) , m_isKeypad(isKeypadEvent(code, keyData, type)) , m_isSystemKey(systemKey) { }
PlatformKeyboardEvent::PlatformKeyboardEvent(HWND, WPARAM code, LPARAM keyData, Type type, bool systemKey) : m_type(type) , m_text((type == Char) ? singleCharacterString(code) : String()) , m_unmodifiedText((type == Char) ? singleCharacterString(code) : String()) , m_keyIdentifier((type == Char) ? String() : keyIdentifierForWindowsKeyCode(code)) , m_autoRepeat(HIWORD(keyData) & KF_REPEAT) , m_windowsVirtualKeyCode((type == RawKeyDown || type == KeyUp) ? code : 0) , m_isKeypad(isKeypadEvent(code, keyData, type)) , m_shiftKey(GetKeyState(VK_SHIFT) & HIGH_BIT_MASK_SHORT) , m_ctrlKey(GetKeyState(VK_CONTROL) & HIGH_BIT_MASK_SHORT) , m_altKey(GetKeyState(VK_MENU) & HIGH_BIT_MASK_SHORT) , m_metaKey(false) , m_isSystemKey(systemKey) { }
PlatformKeyboardEvent::PlatformKeyboardEvent(HWND hWnd, WPARAM wParam, LPARAM lParam) : m_text(singleCharacterString(wParam)) , m_unmodifiedText(singleCharacterString(wParam)) , m_keyIdentifier(keyIdentifierForWindowsKeyCode(wParam)) , m_isKeyUp((lParam & NEW_RELEASE_STATE_MASK)) , m_autoRepeat(lParam & REPEAT_COUNT_MASK) , m_WindowsKeyCode(wParam) , m_isKeypad(false) // FIXME , m_shiftKey(GetAsyncKeyState(VK_SHIFT) & HIGH_BIT_MASK_SHORT) , m_ctrlKey(GetAsyncKeyState(VK_CONTROL) & HIGH_BIT_MASK_SHORT) , m_altKey(lParam & ALT_KEY_DOWN_MASK) , m_metaKey(lParam & ALT_KEY_DOWN_MASK) // FIXME: Is this right? { if (!m_shiftKey) m_text = String(singleCharacterString(tolower(wParam))); }
PlatformKeyboardEvent::PlatformKeyboardEvent( Type type , unsigned int winCharCode , unsigned int winKeyCode , bool isShiftKey , bool isCtrlKey , bool isAltKey , bool isMetaKey , bool isAutoRepeat ) // we populate m_text/m_unmodifiedText on keyDown as the charCode is needed by swf in HTML on mac : m_type(type) , m_text(winCharCode ? singleCharacterString(winCharCode) : String()) , m_unmodifiedText(winCharCode ? singleCharacterString(winCharCode) : String()) , m_keyIdentifier((type == Char) ? String() : keyIdentifierForWindowsKeyCode(winKeyCode)) , m_autoRepeat(isAutoRepeat) , m_windowsVirtualKeyCode(winKeyCode ? winKeyCode : 0) , m_isKeypad(isKeypadEvent(winKeyCode, /*keyData,*/ type)) , m_shiftKey(isShiftKey) , m_ctrlKey(isCtrlKey) , m_altKey(isAltKey) , m_metaKey(isMetaKey) { }