Make sure two consecutive double clicks require four clicks

This commit is contained in:
Junegunn Choi 2023-01-03 01:36:51 +09:00
parent a893fc0ca2
commit ec471a5bc2
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -591,6 +591,9 @@ func (r *LightRenderer) mouseSequence(sz *int) Event {
if len(r.clicks) > 1 && r.clicks[0][0] == r.clicks[1][0] && r.clicks[0][1] == r.clicks[1][1] &&
time.Since(r.prevDownTime) < doubleClickDuration {
double = true
if double {
r.clicks = [][2]int{}
}
}
}
return Event{Mouse, 0, &MouseEvent{y, x, 0, left, down, double, mod}}