Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-05-28 07:28:06 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-05-28 07:34:00 +0300
commitd35a33ef723e70f6ca89c2d92da112744e44003c (patch)
tree6f97da70b2ace61aa35391e4603ff8891c03966e /source/blender/windowmanager
parentcdcbcca25e3f5d4fddd984fa284ea248dc3869a4 (diff)
Gizmo: add flag for gizmos to ignore keymap events
Needed for the snap gizmo not to steal mouse events from the tool.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/gizmo/WM_gizmo_types.h16
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c2
2 files changed, 10 insertions, 8 deletions
diff --git a/source/blender/windowmanager/gizmo/WM_gizmo_types.h b/source/blender/windowmanager/gizmo/WM_gizmo_types.h
index e79031193c2..346ed131c59 100644
--- a/source/blender/windowmanager/gizmo/WM_gizmo_types.h
+++ b/source/blender/windowmanager/gizmo/WM_gizmo_types.h
@@ -67,31 +67,33 @@ typedef enum eWM_GizmoFlag {
WM_GIZMO_DRAW_VALUE = (1 << 2),
WM_GIZMO_HIDDEN = (1 << 3),
WM_GIZMO_HIDDEN_SELECT = (1 << 4),
+ /** Ignore the key-map for this gizmo. */
+ WM_GIZMO_HIDDEN_KEYMAP = (1 << 5),
/**
* When set 'scale_final' value also scales the offset.
* Use when offset is to avoid screen-space overlap instead of absolute positioning. */
- WM_GIZMO_DRAW_OFFSET_SCALE = (1 << 5),
+ WM_GIZMO_DRAW_OFFSET_SCALE = (1 << 6),
/**
* User should still use 'scale_final' for any handles and UI elements.
* This simply skips scale when calculating the final matrix.
* Needed when the gizmo needs to align with the interface underneath it. */
- WM_GIZMO_DRAW_NO_SCALE = (1 << 6),
+ WM_GIZMO_DRAW_NO_SCALE = (1 << 7),
/**
* Hide the cursor and lock it's position while interacting with this gizmo.
*/
- WM_GIZMO_MOVE_CURSOR = (1 << 7),
+ WM_GIZMO_MOVE_CURSOR = (1 << 8),
/** Don't write into the depth buffer when selecting. */
- WM_GIZMO_SELECT_BACKGROUND = (1 << 8),
+ WM_GIZMO_SELECT_BACKGROUND = (1 << 9),
/** Use the active tools operator properties when running as an operator. */
- WM_GIZMO_OPERATOR_TOOL_INIT = (1 << 9),
+ WM_GIZMO_OPERATOR_TOOL_INIT = (1 << 10),
/** Don't pass through events to other handlers
* (allows click/drag not to have it's events stolen by press events in other keymaps). */
- WM_GIZMO_EVENT_HANDLE_ALL = (1 << 10),
+ WM_GIZMO_EVENT_HANDLE_ALL = (1 << 11),
/** Don't use tool-tips for this gizmo (can be distracting). */
- WM_GIZMO_NO_TOOLTIP = (1 << 11),
+ WM_GIZMO_NO_TOOLTIP = (1 << 12),
} eWM_GizmoFlag;
/**
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 54498b21369..e5f288b1963 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -2602,7 +2602,7 @@ static int wm_handlers_do_gizmo_handler(bContext *C,
if (handle_keymap) {
/* Handle highlight gizmo. */
- if (gz != NULL) {
+ if ((gz != NULL) && (gz->flag & WM_GIZMO_HIDDEN_KEYMAP) == 0) {
bool keymap_poll = false;
wmGizmoGroup *gzgroup = gz->parent_gzgroup;
wmKeyMap *keymap = WM_keymap_active(wm, gz->keymap ? gz->keymap : gzgroup->type->keymap);