From 33dd2c8de6d9f20a282191b7988f0ca9e37a4177 Mon Sep 17 00:00:00 2001 From: Mikko Mustonen Date: Sun, 23 Sep 2018 12:06:55 +0300 Subject: [PATCH 1/2] Fix zero relative motion event when clicking in MOUSE_MODE_CAPTURED --- platform/windows/os_windows.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index d575525f93f..140a43cf0bb 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -458,7 +458,7 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) */ } - if (window_has_focus && main_loop) + if (window_has_focus && main_loop && mm->get_relative() != Vector2()) input->parse_input_event(mm); } delete[] lpb; From db346bff8b3355e54fd032f7bd2389b573b8378e Mon Sep 17 00:00:00 2001 From: Mikko Mustonen Date: Sun, 23 Sep 2018 12:29:15 +0300 Subject: [PATCH 2/2] Fix mouse position when clicking in MOUSE_MODE_CAPTURED --- platform/windows/os_windows.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 140a43cf0bb..e8c209c0fcd 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -697,7 +697,7 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) last_button_state = mb->get_button_mask(); mb->set_position(Vector2(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); - if (mouse_mode == MOUSE_MODE_CAPTURED) { + if (mouse_mode == MOUSE_MODE_CAPTURED && !use_raw_input) { mb->set_position(Vector2(old_x, old_y)); }