settings: ignore first movement for mouse gestures when reprog controls version is 5 or more

This commit is contained in:
Peter F. Patel-Schneider 2022-07-19 13:15:32 -04:00
parent f1d69ede2c
commit 72dbf1c32f
1 changed files with 3 additions and 0 deletions

View File

@ -928,6 +928,9 @@ class MouseGesture(_Setting):
def move_action(self, dx, dy):
if self.fsmState == 'pressed':
now = _time() * 1000 # _time_ns() / 1e6
if self.device.features.get_feature_version(_F.REPROG_CONTROLS_V4) >= 5 and self.lastEv is None:
self.lastEv = now # hack to ignore strange first movement report from MX Master 3S
return
if self.lastEv is not None and now - self.lastEv > 50.:
self.push_mouse_event()
dpi = self.dpiSetting.read() if self.dpiSetting else 1000