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 /source/blender/windowmanager/gizmo/intern | |
parent | 6bc761a12e523b1c3c583b5519fb5faa3f84e408 (diff) |
Keymap: gizmos now use a map that optionally activates on press
The legacy keymap now activates on press.
Diffstat (limited to 'source/blender/windowmanager/gizmo/intern')
-rw-r--r-- | source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c index bea951e7708..709b7b03376 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c @@ -662,6 +662,12 @@ wmKeyMap *WM_gizmogroup_setup_keymap_generic_drag(const wmGizmoGroupType *UNUSED return WM_gizmo_keymap_generic_drag_with_keyconfig(kc); } +wmKeyMap *WM_gizmogroup_setup_keymap_generic_maybe_drag(const wmGizmoGroupType *UNUSED(gzgt), + wmKeyConfig *kc) +{ + return WM_gizmo_keymap_generic_maybe_drag_with_keyconfig(kc); +} + /** * Variation of #WM_gizmogroup_keymap_common but with keymap items for selection * @@ -767,6 +773,17 @@ struct wmKeyMap *WM_gizmo_keymap_generic_click_drag(wmWindowManager *wm) return WM_gizmo_keymap_generic_click_drag_with_keyconfig(wm->defaultconf); } +/** Drag or press depending on preference. */ +struct wmKeyMap *WM_gizmo_keymap_generic_maybe_drag_with_keyconfig(wmKeyConfig *kc) +{ + const char *idname = "Generic Gizmo Maybe Drag"; + return WM_keymap_ensure(kc, idname, SPACE_EMPTY, RGN_TYPE_WINDOW); +} +struct wmKeyMap *WM_gizmo_keymap_generic_maybe_drag(wmWindowManager *wm) +{ + return WM_gizmo_keymap_generic_drag_with_keyconfig(wm->defaultconf); +} + /** \} */ /* -------------------------------------------------------------------- */ |