Skip to content

Commit

Permalink
Merge pull request #93105 from kitbdev/keystate
Browse files Browse the repository at this point in the history
Windows Input use GetKeyState instead of GetAsyncKeyState
  • Loading branch information
akien-mga committed Jun 13, 2024
2 parents c3030ca + 45c6971 commit 2fab2c7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions platform/windows/display_server_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 2fab2c7

Please sign in to comment.