diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-11-14 20:14:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-14 20:14:36 +0100 |
commit | d1f8fd6384ae8d2caae368d79d1db23654868b98 (patch) | |
tree | ced7e8715403f874ed409f05268f3325d03edb59 | |
parent | a9fe8a7c3aa55d0802903b48ee677003da706fb8 (diff) | |
parent | 1e28571d82b711c6e1623eea0d5d844871ea22f5 (diff) |
Merge pull request #33607 from Calinou/orbit-modifier-always-alt
Always allow Alt as an orbit modifier in the 3D editor
-rw-r--r-- | editor/plugins/spatial_editor_plugin.cpp | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index e0189f8a92..d187e4ff4a 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -965,7 +965,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { } if (b->is_pressed()) { - int mod = _get_key_modifier(b); + const int mod = _get_key_modifier(b); if (!orthogonal) { if (mod == _get_key_modifier_setting("editors/3d/freelook/freelook_activation_modifier")) { set_freelook_active(true); @@ -1656,14 +1656,16 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { if (nav_scheme == NAVIGATION_GODOT) { - int mod = _get_key_modifier(m); + const int mod = _get_key_modifier(m); - if (mod == _get_key_modifier_setting("editors/3d/navigation/pan_modifier")) + if (mod == _get_key_modifier_setting("editors/3d/navigation/pan_modifier")) { nav_mode = NAVIGATION_PAN; - else if (mod == _get_key_modifier_setting("editors/3d/navigation/zoom_modifier")) + } else if (mod == _get_key_modifier_setting("editors/3d/navigation/zoom_modifier")) { nav_mode = NAVIGATION_ZOOM; - else if (mod == _get_key_modifier_setting("editors/3d/navigation/orbit_modifier")) + } else if (mod == KEY_ALT || mod == _get_key_modifier_setting("editors/3d/navigation/orbit_modifier")) { + // Always allow Alt as a modifier to better support graphic tablets. nav_mode = NAVIGATION_ORBIT; + } } else if (nav_scheme == NAVIGATION_MAYA) { if (m->get_alt()) @@ -1672,15 +1674,17 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { } else if (EditorSettings::get_singleton()->get("editors/3d/navigation/emulate_3_button_mouse")) { // Handle trackpad (no external mouse) use case - int mod = _get_key_modifier(m); + const int mod = _get_key_modifier(m); if (mod) { - if (mod == _get_key_modifier_setting("editors/3d/navigation/pan_modifier")) + if (mod == _get_key_modifier_setting("editors/3d/navigation/pan_modifier")) { nav_mode = NAVIGATION_PAN; - else if (mod == _get_key_modifier_setting("editors/3d/navigation/zoom_modifier")) + } else if (mod == _get_key_modifier_setting("editors/3d/navigation/zoom_modifier")) { nav_mode = NAVIGATION_ZOOM; - else if (mod == _get_key_modifier_setting("editors/3d/navigation/orbit_modifier")) + } else if (mod == KEY_ALT || mod == _get_key_modifier_setting("editors/3d/navigation/orbit_modifier")) { + // Always allow Alt as a modifier to better support graphic tablets. nav_mode = NAVIGATION_ORBIT; + } } } @@ -1727,14 +1731,16 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { if (nav_scheme == NAVIGATION_GODOT) { - int mod = _get_key_modifier(pan_gesture); + const int mod = _get_key_modifier(pan_gesture); - if (mod == _get_key_modifier_setting("editors/3d/navigation/pan_modifier")) + if (mod == _get_key_modifier_setting("editors/3d/navigation/pan_modifier")) { nav_mode = NAVIGATION_PAN; - else if (mod == _get_key_modifier_setting("editors/3d/navigation/zoom_modifier")) + } else if (mod == _get_key_modifier_setting("editors/3d/navigation/zoom_modifier")) { nav_mode = NAVIGATION_ZOOM; - else if (mod == _get_key_modifier_setting("editors/3d/navigation/orbit_modifier")) + } else if (mod == KEY_ALT || mod == _get_key_modifier_setting("editors/3d/navigation/orbit_modifier")) { + // Always allow Alt as a modifier to better support graphic tablets. nav_mode = NAVIGATION_ORBIT; + } } else if (nav_scheme == NAVIGATION_MAYA) { if (pan_gesture->get_alt()) |