From c5bf78176e0bb70c1dcb43ef062afff3ce3da2e2 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 8 Jul 2023 20:27:14 -0500 Subject: [PATCH] Remove GetAsyncKeyState() check before sending mouse button events It's unnecessary and breaks in cases where event processing is slow Fixes #1433 --- src/platform/windows/input.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/platform/windows/input.cpp b/src/platform/windows/input.cpp index 5d89fead..c3067cb3 100644 --- a/src/platform/windows/input.cpp +++ b/src/platform/windows/input.cpp @@ -408,8 +408,6 @@ namespace platf { void button_mouse(input_t &input, int button, bool release) { - constexpr auto KEY_STATE_DOWN = (SHORT) 0x8000; - INPUT i {}; i.type = INPUT_MOUSE; @@ -439,14 +437,6 @@ namespace platf { mouse_button = VK_XBUTTON2; } - auto key_state = GetAsyncKeyState(mouse_button); - bool key_state_down = (key_state & KEY_STATE_DOWN) != 0; - if (key_state_down != release) { - BOOST_LOG(warning) << "Button state of mouse_button ["sv << button << "] does not match the desired state"sv; - - return; - } - send_input(i); }