From c51e22cb5263b146cdffa49b08e02dad6a7173ee Mon Sep 17 00:00:00 2001 From: Laurent Gomila Date: Fri, 2 Sep 2011 23:03:46 +0200 Subject: [PATCH] Fixed sf::Mouse::IsButtonPressed and sf::Keyboard::IsKeyPressed incorrectly returning true on Windows --- src/SFML/Window/Win32/InputImpl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SFML/Window/Win32/InputImpl.cpp b/src/SFML/Window/Win32/InputImpl.cpp index 8122e581a..c3cf5c658 100644 --- a/src/SFML/Window/Win32/InputImpl.cpp +++ b/src/SFML/Window/Win32/InputImpl.cpp @@ -145,7 +145,7 @@ bool InputImpl::IsKeyPressed(Keyboard::Key key) case Keyboard::Pause: vkey = VK_PAUSE; break; } - return GetAsyncKeyState(vkey) != 0; + return (GetAsyncKeyState(vkey) & 0x8000) != 0; } @@ -162,7 +162,7 @@ bool InputImpl::IsMouseButtonPressed(Mouse::Button button) case Mouse::XButton2: vkey = VK_XBUTTON2; break; } - return GetAsyncKeyState(vkey) != 0; + return (GetAsyncKeyState(vkey) & 0x8000) != 0; }