Remove GetAsyncKeyState() check before sending mouse button events

It's unnecessary and breaks in cases where event processing is slow

Fixes #1433
This commit is contained in:
Cameron Gutman 2023-07-08 20:27:14 -05:00
parent d075424225
commit c5bf78176e

View File

@ -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);
}