diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-03-02 09:02:54 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-03-02 09:02:54 +0300 |
commit | bf1ee49e2039dd27df833ce2005bacf3569cbbaa (patch) | |
tree | 69e460be86437512fa503723438b46acaf5514a4 | |
parent | 92dac21e6b4e6d53417484513d9e3c016f7dbba7 (diff) |
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.
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 7 |
1 files changed, 4 insertions, 3 deletions
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); } } |