diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-06-07 17:51:03 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-06-07 17:52:40 +0300 |
commit | df4525d1d9d5250b8d0bdc6370f2736c2607b044 (patch) | |
tree | 219d7a92be33f351b8a41753d48b2c3243d814ac /source | |
parent | 863e395ad8bc0c921a9c836018e2c17262340f46 (diff) |
Fix key repeat events resetting the click timer
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 7c81f836bc1..83bad28ce02 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -3523,9 +3523,12 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U /* double click test - only for press */ if (event.val == KM_PRESS) { - evt->prevclicktime = PIL_check_seconds_timer(); - evt->prevclickx = event.x; - evt->prevclicky = event.y; + /* Don't reset timer & location when holding the key generates repeat events. */ + if ((evt->prevtype != event.type) || (evt->prevval != KM_PRESS)) { + evt->prevclicktime = PIL_check_seconds_timer(); + evt->prevclickx = event.x; + evt->prevclicky = event.y; + } } wm_event_add(win, &event); |