diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-06-07 04:45:50 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-06-07 05:10:56 +0300 |
commit | 6dd9e08051d20e0c673660b2826470965e1eb8ca (patch) | |
tree | ae99e17c4e79cda58cdae6f9af9b14e9817ac141 /release/scripts | |
parent | 6bc761a12e523b1c3c583b5519fb5faa3f84e408 (diff) |
Keymap: gizmos now use a map that optionally activates on press
The legacy keymap now activates on press.
Diffstat (limited to 'release/scripts')
-rw-r--r-- | release/scripts/presets/keyconfig/blender_27x.py | 1 | ||||
-rw-r--r-- | release/scripts/presets/keyconfig/keymap_data/blender_default.py | 20 |
2 files changed, 21 insertions, 0 deletions
diff --git a/release/scripts/presets/keyconfig/blender_27x.py b/release/scripts/presets/keyconfig/blender_27x.py index eb630482393..052f5dd706a 100644 --- a/release/scripts/presets/keyconfig/blender_27x.py +++ b/release/scripts/presets/keyconfig/blender_27x.py @@ -56,6 +56,7 @@ def load(): use_mouse_emulate_3_button=prefs.inputs.use_mouse_emulate_3_button, spacebar_action='SEARCH', use_select_all_toggle=True, + use_gizmo_drag=False, legacy=True, ), ) diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py index 5de9b7569f8..374a70b7600 100644 --- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py +++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py @@ -44,6 +44,8 @@ class Params: "spacebar_action", # Key toggles selection with 'A'. "use_select_all_toggle", + # Activate gizmo on drag (which support it). + "use_gizmo_drag", # Use pie menu for tab by default (swap 'Tab/Ctrl-Tab'). "use_v3d_tab_menu", # Use extended pie menu for shading. @@ -63,6 +65,7 @@ class Params: # User preferences. spacebar_action='TOOL', use_select_all_toggle=False, + use_gizmo_drag=True, use_v3d_tab_menu=False, use_v3d_shade_ex_pie=False, use_pie_click_drag=False, @@ -108,6 +111,8 @@ class Params: # User preferences self.spacebar_action = spacebar_action + + self.use_gizmo_drag = use_gizmo_drag self.use_select_all_toggle = use_select_all_toggle self.use_v3d_tab_menu = use_v3d_tab_menu self.use_v3d_shade_ex_pie = use_v3d_shade_ex_pie @@ -4755,6 +4760,20 @@ def km_generic_gizmo_click_drag(_params): return keymap +def km_generic_gizmo_maybe_drag(params): + keymap = ( + "Generic Gizmo Maybe Drag", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + {"items": + _template_items_gizmo_tweak_value_drag() + if params.use_gizmo_drag else + _template_items_gizmo_tweak_value() + }, + ) + + return keymap + + def km_generic_gizmo_select(_params): keymap = ( "Generic Gizmo Select", @@ -5889,6 +5908,7 @@ def generate_keymaps(params=None): # Gizmos. km_generic_gizmo(params), km_generic_gizmo_drag(params), + km_generic_gizmo_maybe_drag(params), km_generic_gizmo_click_drag(params), km_generic_gizmo_select(params), km_generic_gizmo_tweak_modal_map(params), |