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>2021-09-23 15:06:50 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-09-23 15:08:02 +0300
commit88692baacef170d90e55f6ab89392237a55b1bf3 (patch)
tree5a30651db4f825888b3ac3643dbee54c3842a5cd /source/blender/windowmanager/intern/wm_event_query.c
parentb659d1a560410425b3454016eeead8dbae7a0898 (diff)
WM: gestures now activate immediately on mouse press
Some gestures were activating immediately on tweak events, extend this to mouse-press and click-drag. Without this change, box-select for example wouldn't be automatically activated on mouse-press.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_event_query.c')
-rw-r--r--source/blender/windowmanager/intern/wm_event_query.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_query.c b/source/blender/windowmanager/intern/wm_event_query.c
index e22285214f0..7b5691b99a0 100644
--- a/source/blender/windowmanager/intern/wm_event_query.c
+++ b/source/blender/windowmanager/intern/wm_event_query.c
@@ -270,6 +270,12 @@ bool WM_event_is_mouse_drag(const wmEvent *event)
return ISTWEAK(event->type) || (ISMOUSE_BUTTON(event->type) && (event->val == KM_CLICK_DRAG));
}
+bool WM_event_is_mouse_drag_or_press(const wmEvent *event)
+{
+ return WM_event_is_mouse_drag(event) ||
+ (ISMOUSE_BUTTON(event->type) && (event->val == KM_PRESS));
+}
+
/** \} */
/* -------------------------------------------------------------------- */