[Bf-blender-cvs] [9bee8e46a1d] master: Event System: limit early evaluation of drag actions to mouse buttons

Campbell Barton noreply at git.blender.org
Fri Mar 11 13:13:28 CET 2022


Commit: 9bee8e46a1dce4d0ae4b930d91690cc9dcf3fca3
Author: Campbell Barton
Date:   Fri Mar 11 23:06:45 2022 +1100
Branches: master
https://developer.blender.org/rB9bee8e46a1dce4d0ae4b930d91690cc9dcf3fca3

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.

===================================================================

M	source/blender/windowmanager/intern/wm_event_system.c

===================================================================

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;
         }



More information about the Bf-blender-cvs mailing list