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 <campbell@blender.org>2022-03-11 15:06:45 +0300
committerCampbell Barton <campbell@blender.org>2022-03-11 15:06:45 +0300
commit9bee8e46a1dce4d0ae4b930d91690cc9dcf3fca3 (patch)
tree9155ce626a2a77e212ec3a7d1deadfb0b3b72451 /source/blender/windowmanager/intern/wm_event_system.c
parentc87c12b2a4c9166ebc021cbf254da3b63e779269 (diff)
Event System: limit early evaluation of drag actions to mouse buttons
Change early drag evaluation added in 1f1dcf41d51a03150ee38f220c590f8715b11e88 to only apply to drag events from mouse buttons. Otherwise pressing two keyboard keys at one would create a drag event for the first pressed key. While this didn't cause any bugs as far as I know, this behavior makes most sense for drags that come from cursor input.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_event_system.c')
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index f407bb38d22..62aeb8a2928 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -3697,10 +3697,12 @@ void wm_event_do_handlers(bContext *C)
/* Force handling drag if a key is pressed even if the drag threshold has not been met.
* Needed so tablet actions (which typically use a larger threshold) can click-drag
- * then press keys - activating the drag action early. */
+ * then press keys - activating the drag action early.
+ * Limit to mouse-buttons drag actions interrupted by pressing any non-mouse button.
+ * Otherwise pressing two keys on the keyboard will interpret this as a drag action. */
if (win->event_queue_check_drag) {
if ((event->val == KM_PRESS) && ((event->flag & WM_EVENT_IS_REPEAT) == 0) &&
- ISKEYBOARD_OR_BUTTON(event->type)) {
+ ISKEYBOARD_OR_BUTTON(event->type) && ISMOUSE_BUTTON(event->prev_press_type)) {
event = wm_event_add_mousemove_to_head(win);
event->flag |= WM_EVENT_FORCE_DRAG_THRESHOLD;
}