From 45c6971a36817215a0c454f2eb32b2f713cd8653 Mon Sep 17 00:00:00 2001 From: kit Date: Wed, 12 Jun 2024 18:37:31 -0400 Subject: [PATCH] Input use GetKeyState instead of GetAsyncKeyState --- platform/windows/display_server_windows.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index 10cec9f5ed8a..01a4fbf96e08 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -662,19 +662,19 @@ Point2i DisplayServerWindows::mouse_get_position() const { BitField DisplayServerWindows::mouse_get_button_state() const { BitField last_button_state = 0; - if (GetAsyncKeyState(VK_LBUTTON) & (1 << 15)) { + if (GetKeyState(VK_LBUTTON) & (1 << 15)) { last_button_state.set_flag(MouseButtonMask::LEFT); } - if (GetAsyncKeyState(VK_RBUTTON) & (1 << 15)) { + if (GetKeyState(VK_RBUTTON) & (1 << 15)) { last_button_state.set_flag(MouseButtonMask::RIGHT); } - if (GetAsyncKeyState(VK_MBUTTON) & (1 << 15)) { + if (GetKeyState(VK_MBUTTON) & (1 << 15)) { last_button_state.set_flag(MouseButtonMask::MIDDLE); } - if (GetAsyncKeyState(VK_XBUTTON1) & (1 << 15)) { + if (GetKeyState(VK_XBUTTON1) & (1 << 15)) { last_button_state.set_flag(MouseButtonMask::MB_XBUTTON1); } - if (GetAsyncKeyState(VK_XBUTTON2) & (1 << 15)) { + if (GetKeyState(VK_XBUTTON2) & (1 << 15)) { last_button_state.set_flag(MouseButtonMask::MB_XBUTTON2); }