diff options
author | William Reynish <billrey@me.com> | 2019-06-07 10:59:29 +0300 |
---|---|---|
committer | William Reynish <billrey@me.com> | 2019-06-07 10:59:29 +0300 |
commit | 8f56620a2358aa7019b7bee595aac270e9a64923 (patch) | |
tree | f16fcfac62991c44935263a1a0f65474ab502298 /release/scripts | |
parent | 19782e4f680e7db86a72cbfa78d23afd7e7c93ce (diff) |
Industry Compat keymap: Fix alt-key navigation over gizmos
This broke recently after recent gizmo keymap changes
Diffstat (limited to 'release/scripts')
-rw-r--r-- | release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py index e4eb5704fde..21f685f2282 100644 --- a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py +++ b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py @@ -103,6 +103,26 @@ def _template_items_animation(): ] +# Gizmos + +def _template_items_gizmo_tweak_value(): + return [ + ("gizmogroup.gizmo_tweak", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None), + ] + + +def _template_items_gizmo_tweak_value_click_drag(): + return [ + ("gizmogroup.gizmo_tweak", {"type": 'LEFTMOUSE', "value": 'CLICK'}, None), + ("gizmogroup.gizmo_tweak", {"type": 'EVT_TWEAK_L', "value": 'ANY'}, None), + ] + + +def _template_items_gizmo_tweak_value_drag(): + return [ + ("gizmogroup.gizmo_tweak", {"type": 'EVT_TWEAK_L', "value": 'ANY'}, None), + ] + # Tool System Templates @@ -3501,6 +3521,52 @@ def km_transform_modal_map(_params): return keymap +# ------------------------------------------------------------------------------ +# Gizmos + + +# Fallback for gizmos that don't have custom a custom key-map. +def km_generic_gizmo(_params): + keymap = ( + "Generic Gizmo", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + {"items": _template_items_gizmo_tweak_value()}, + ) + + return keymap + + +def km_generic_gizmo_drag(_params): + keymap = ( + "Generic Gizmo Drag", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + {"items": _template_items_gizmo_tweak_value_drag()}, + ) + + return keymap + + +def km_generic_gizmo_click_drag(_params): + keymap = ( + "Generic Gizmo Click Drag", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + {"items": _template_items_gizmo_tweak_value_click_drag()}, + ) + + 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() + }, + ) + + return keymap + # ------------------------------------------------------------------------------ # Tool System Keymaps @@ -3712,6 +3778,12 @@ def generate_keymaps(params=None): km_eyedropper_colorramp_pointsampling_map(params), km_transform_modal_map(params), + # Gizmos. + km_generic_gizmo(params), + km_generic_gizmo_drag(params), + km_generic_gizmo_maybe_drag(params), + km_generic_gizmo_click_drag(params), + # Tool System. km_3d_view_tool_transform(params), km_3d_view_tool_move(params), |