From bf1ee49e2039dd27df833ce2005bacf3569cbbaa Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 2 Mar 2021 17:02:54 +1100 Subject: WM: use wmEvent.is_repeat instead of previous event checks This check was added before is_repeat was supported, use this variable instead since it's more a more reliable way of detecting held keys. Also remove outdated comment. --- source/blender/windowmanager/intern/wm_event_system.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 205e49c5ab4..09a9e328b6d 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -4431,8 +4431,9 @@ static wmEvent *wm_event_add_trackpad(wmWindow *win, const wmEvent *event, int d return event_new; } -/* Windows store own event queues, no bContext here. */ -/* Time is in 1000s of seconds, from Ghost. */ +/** + * Windows store own event queues #wmWindow.queue (no #bContext here). + */ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, void *customdata) { if (UNLIKELY(G.f & G_FLAG_EVENT_SIMULATE)) { @@ -4729,7 +4730,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, void /* Double click test - only for press. */ if (event.val == KM_PRESS) { /* Don't reset timer & location when holding the key generates repeat events. */ - if ((evt->prevtype != event.type) || (evt->prevval != KM_PRESS)) { + if (event.is_repeat == false) { wm_event_prev_click_set(&event, evt); } } -- cgit v1.2.3