-
-
Notifications
You must be signed in to change notification settings - Fork 968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Touchpad-friently 3d navigation #4598
Conversation
Add camera navigation style config option as a preparation for introduction of touchpad style navigation
Implement FreeCAD-inspired touchpad-friendly camera operation mode: - Shift+move: panning - Alt+move: rotation Set "Camera mode" to "Touchpad" in settings menu to activate this mode.
src/slic3r/GUI/GLCanvas3D.cpp
Outdated
@@ -4452,6 +4456,24 @@ void GLCanvas3D::on_set_focus(wxFocusEvent& evt) | |||
m_tooltip_enabled = true; | |||
} | |||
|
|||
bool GLCanvas3D::is_camera_rotate(const wxMouseEvent& evt) const | |||
{ | |||
if (wxGetApp().app_config->get("camera_navigation_style") == "1") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be better to cache this value as member variable to avoid uncessary overhead as this is called in every mouse event.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated that code.
Now this setting is cached on canvas focus.
I've also added forced focus for the canvas on preferences window close. This helps to solve 2 things:
- Force update setting value (which also could be applied to "zoom_to_mouse", "reverse_mouse_wheel_zoom" and "use_free_camera")
- User could immediately use 3D view hotkeys without clicking on a view first.
src/slic3r/GUI/GLCanvas3D.cpp
Outdated
|
||
bool GLCanvas3D::is_camera_pan(const wxMouseEvent& evt) const | ||
{ | ||
if (wxGetApp().app_config->get("camera_navigation_style") == "1") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
Works like a charm ;) |
I made a screen cap which demonstrates this feature in action. Default navigation mode: nav-default2.mp4"Touchpad" navigation mode: nav-touchpad2.mp4This navigation modes splits scene control over two hands making scene control easier for devices like touchpad or some trackballs. |
Cache current navigation style on canvas focus, do not request settings value each mouse event.
Explicitly force focus 3D preview pane on closing preferences window. This allows preferences be updated only once without checking current value each input event. Another benefit is to have 3D view in focus is that user could immediatelly use 3d-view shortcuts like Ctrl+<1..7> without clicking to the 3D view first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Thank you!
* gui: camera navigation style option Add camera navigation style config option as a preparation for introduction of touchpad style navigation * gui: touchpa-friently 3d navigation Implement FreeCAD-inspired touchpad-friendly camera operation mode: - Shift+move: panning - Alt+move: rotation Set "Camera mode" to "Touchpad" in settings menu to activate this mode. * cache current navigation style in class member variable Cache current navigation style on canvas focus, do not request settings value each mouse event. * force focuse 3d preview on preferences window close Explicitly force focus 3D preview pane on closing preferences window. This allows preferences be updated only once without checking current value each input event. Another benefit is to have 3D view in focus is that user could immediatelly use 3d-view shortcuts like Ctrl+<1..7> without clicking to the 3D view first.
* gui: camera navigation style option Add camera navigation style config option as a preparation for introduction of touchpad style navigation * gui: touchpa-friently 3d navigation Implement FreeCAD-inspired touchpad-friendly camera operation mode: - Shift+move: panning - Alt+move: rotation Set "Camera mode" to "Touchpad" in settings menu to activate this mode. * cache current navigation style in class member variable Cache current navigation style on canvas focus, do not request settings value each mouse event. * force focuse 3d preview on preferences window close Explicitly force focus 3D preview pane on closing preferences window. This allows preferences be updated only once without checking current value each input event. Another benefit is to have 3D view in focus is that user could immediatelly use 3d-view shortcuts like Ctrl+<1..7> without clicking to the 3D view first.
* gui: camera navigation style option Add camera navigation style config option as a preparation for introduction of touchpad style navigation * gui: touchpa-friently 3d navigation Implement FreeCAD-inspired touchpad-friendly camera operation mode: - Shift+move: panning - Alt+move: rotation Set "Camera mode" to "Touchpad" in settings menu to activate this mode. * cache current navigation style in class member variable Cache current navigation style on canvas focus, do not request settings value each mouse event. * force focuse 3d preview on preferences window close Explicitly force focus 3D preview pane on closing preferences window. This allows preferences be updated only once without checking current value each input event. Another benefit is to have 3D view in focus is that user could immediatelly use 3d-view shortcuts like Ctrl+<1..7> without clicking to the 3D view first.
Implement FreeCAD-inspired touchpad navigation mode.
This mode makes 3d model inspection easier for devices with touchpad as the only pointer device.
Controls: