Merge pull request #93105 from kitbdev/keystate

Windows Input use GetKeyState instead of GetAsyncKeyState
This commit is contained in:
Rémi Verschelde 2024-06-13 11:50:44 +02:00
commit 2fab2c7850
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -662,19 +662,19 @@ Point2i DisplayServerWindows::mouse_get_position() const {
BitField<MouseButtonMask> DisplayServerWindows::mouse_get_button_state() const {
BitField<MouseButtonMask> 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);
}