Only test the high order bit from GetKeyState, otherwise we can have

bogus readings.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31052 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2004-12-17 16:31:14 +00:00
parent 9180b5352f
commit fc32cd4a59

View File

@@ -1258,11 +1258,13 @@ void wxWindowMSW::OnInternalIdle()
state |= MK_SHIFT; state |= MK_SHIFT;
if ( wxIsCtrlDown() ) if ( wxIsCtrlDown() )
state |= MK_CONTROL; state |= MK_CONTROL;
if ( GetKeyState( VK_LBUTTON ) )
// Only the high-order bit should be tested
if ( GetKeyState( VK_LBUTTON ) & (1<<15) )
state |= MK_LBUTTON; state |= MK_LBUTTON;
if ( GetKeyState( VK_MBUTTON ) ) if ( GetKeyState( VK_MBUTTON ) & (1<<15) )
state |= MK_MBUTTON; state |= MK_MBUTTON;
if ( GetKeyState( VK_RBUTTON ) ) if ( GetKeyState( VK_RBUTTON ) & (1<<15) )
state |= MK_RBUTTON; state |= MK_RBUTTON;
POINT pt; POINT pt;