Fix sticky camera rotate for touchpad navigation style on Windows (#8249)

* glcanvas: add modifiers to mouse events logging

* glcanvas: workaround for touchpad nav on Win

Releasing ALT on windows platform result in GLCanvas losing focus.
Because of this mouse movements not being processed by on_mouse() event
handler and camera rotation have not cleaned up.

Make a workaround for Windows to cleanup camera rotate state on
releasing ALT modifier.
This commit is contained in:
Dima Buzdyk 2025-02-01 16:02:10 +06:00 committed by GitHub
parent 00418626cb
commit c0533eba6f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3519,6 +3519,12 @@ void GLCanvas3D::on_key(wxKeyEvent& evt)
m_dirty = true;
}
// set_cursor(Standard);
#ifdef __WXMSW__
if (m_camera_movement && m_is_touchpad_navigation) {
m_camera_movement = false;
m_mouse.set_start_position_3D_as_invalid();
}
#endif
}
else if (keyCode == WXK_CONTROL)
m_dirty = true;
@ -3873,6 +3879,12 @@ std::string format_mouse_event_debug_message(const wxMouseEvent &evt)
out += "RightUp ";
if (evt.RightDClick())
out += "RightDClick ";
if (evt.AltDown())
out += "AltDown ";
if (evt.ShiftDown())
out += "ShiftDown ";
if (evt.ControlDown())
out += "ControlDown ";
sprintf(buf, "(%d, %d)", evt.GetX(), evt.GetY());
out += buf;