// get the current state of SHIFT/CTRL keys
inline bool wxIsShiftDown()
{
- return (::GetKeyState(VK_SHIFT) & 0x100) != 0;
+// return (::GetKeyState(VK_SHIFT) & 0x100) != 0;
+ // Returns different negative values on WinME and WinNT,
+ // so simply test for negative value.
+ return ::GetKeyState(VK_SHIFT) < 0;
}
inline bool wxIsCtrlDown()
{
- return (::GetKeyState(VK_CONTROL) & 0x100) != 0;
+// return (::GetKeyState(VK_CONTROL) & 0x100) != 0;
+ // Returns different negative values on WinME and WinNT,
+ // so simply test for negative value.
+ return ::GetKeyState(VK_CONTROL) < 0;
}
// wrapper around GetWindowRect() and GetClientRect() APIs doing error checking
// similar to the ones from a "real" WM_KEYDOWN so that
// CreateKeyEvent() works correctly
WXLPARAM lParam =
- (::GetKeyState(VK_MENU) & 0x100 ? KF_ALTDOWN : 0) << 16;
+// (::GetKeyState(VK_MENU) & 0x100 ? KF_ALTDOWN : 0) << 16;
+ // Returns different negative values on WinME and WinNT,
+ // so simply test for negative value.
+ (::GetKeyState(VK_MENU) < 0 ? KF_ALTDOWN : 0) << 16;
WXWPARAM wParam = info->wVKey;
event.m_leftDown = (flags & MK_LBUTTON) != 0;
event.m_middleDown = (flags & MK_MBUTTON) != 0;
event.m_rightDown = (flags & MK_RBUTTON) != 0;
- event.m_altDown = (::GetKeyState(VK_MENU) & 0x80000000) != 0;
+ // event.m_altDown = (::GetKeyState(VK_MENU) & 0x80000000) != 0;
+ // Returns different negative values on WinME and WinNT,
+ // so simply test for negative value.
+ event.m_altDown = ::GetKeyState(VK_MENU) < 0;
event.SetTimestamp(s_currentMsg.time);
event.m_eventObject = this;