From 9bee8e46a1dce4d0ae4b930d91690cc9dcf3fca3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 11 Mar 2022 23:06:45 +1100 Subject: 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. --- source/blender/windowmanager/intern/wm_event_system.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to '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; } -- cgit v1.2.3