mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
More input handling fixes
This commit is contained in:
parent
cb900aa5bc
commit
051ca410f6
3 changed files with 15 additions and 5 deletions
|
@ -4119,6 +4119,7 @@ GLCanvas3D::GLCanvas3D(wxGLCanvas* canvas)
|
|||
, m_multisample_allowed(false)
|
||||
, m_regenerate_volumes(true)
|
||||
, m_moving(false)
|
||||
, m_tab_down(false)
|
||||
, m_color_by("volume")
|
||||
, m_reload_delayed(false)
|
||||
, m_render_sla_auxiliaries(true)
|
||||
|
@ -5314,6 +5315,8 @@ void GLCanvas3D::on_char(wxKeyEvent& evt)
|
|||
|
||||
void GLCanvas3D::on_key(wxKeyEvent& evt)
|
||||
{
|
||||
const int keyCode = evt.GetKeyCode();
|
||||
|
||||
#if ENABLE_IMGUI
|
||||
auto imgui = wxGetApp().imgui();
|
||||
if (imgui->update_key_data(evt)) {
|
||||
|
@ -5321,9 +5324,7 @@ void GLCanvas3D::on_key(wxKeyEvent& evt)
|
|||
} else
|
||||
#endif // ENABLE_IMGUI
|
||||
if (evt.GetEventType() == wxEVT_KEY_UP) {
|
||||
const int keyCode = evt.GetKeyCode();
|
||||
|
||||
if (keyCode == WXK_TAB) {
|
||||
if (m_tab_down && keyCode == WXK_TAB && !evt.HasAnyModifiers()) {
|
||||
// Enable switching between 3D and Preview with Tab
|
||||
// m_canvas->HandleAsNavigationKey(evt); // XXX: Doesn't work in some cases / on Linux
|
||||
post_event(SimpleEvent(EVT_GLCANVAS_TAB));
|
||||
|
@ -5331,9 +5332,17 @@ void GLCanvas3D::on_key(wxKeyEvent& evt)
|
|||
// shift has been just released - SLA gizmo might want to close rectangular selection.
|
||||
m_dirty = true;
|
||||
}
|
||||
} else if (evt.GetEventType() == wxEVT_KEY_DOWN) {
|
||||
m_tab_down = keyCode == WXK_TAB && !evt.HasAnyModifiers();
|
||||
}
|
||||
|
||||
evt.Skip(); // Needed to have EVT_CHAR generated as well
|
||||
if (keyCode != WXK_TAB
|
||||
&& keyCode != WXK_LEFT
|
||||
&& keyCode != WXK_UP
|
||||
&& keyCode != WXK_RIGHT
|
||||
&& keyCode != WXK_DOWN) {
|
||||
evt.Skip(); // Needed to have EVT_CHAR generated as well
|
||||
}
|
||||
}
|
||||
|
||||
void GLCanvas3D::on_mouse_wheel(wxMouseEvent& evt)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue