File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -605,9 +605,10 @@ static void check_long_press_timer(void)
605605 if (app_state .mouse .toggle_down_at_ms == 0 ) return ; /* key not held */
606606 if (toggle_long_press_fired ) return ; /* already fired */
607607
608- struct timeval tv ;
609- gettimeofday (& tv , NULL );
610- long long now = (long long )tv .tv_sec * 1000 + tv .tv_usec / 1000 ;
608+ /* Use CLOCK_MONOTONIC — same source as input event timestamps on Android. */
609+ struct timespec ts ;
610+ clock_gettime (CLOCK_MONOTONIC , & ts );
611+ long long now = (long long )ts .tv_sec * 1000LL + ts .tv_nsec / 1000000LL ;
611612 long long held = now - app_state .mouse .toggle_down_at_ms ;
612613
613614 if (held >= TOGGLE_TAP_MAX_MS )
Original file line number Diff line number Diff line change 11id=DumbMouse
22name=DumbMouse
3- version=6
4- versionCode=6
3+ version=7
4+ versionCode=7
55author=dumbco
66description=Virtual mouse for flip phones.
You can’t perform that action at this time.
0 commit comments