rcinput: apply ev.time adjustment to all events

This fixes detection of keys that are allowed to be long-pressed if
"long keypress" feature is enabled.
No idea why this was applied only to key press events before :-)
This commit is contained in:
Stefan Seyfried
2017-02-25 15:58:07 +01:00
parent 9287d66472
commit df4987ad84

View File

@@ -1322,7 +1322,6 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6
} }
if (ev.type == EV_SYN) if (ev.type == EV_SYN)
continue; /* ignore... */ continue; /* ignore... */
if (ev.value) {
/* try to compensate for possible changes in wall clock /* try to compensate for possible changes in wall clock
* kernel ev.time default uses CLOCK_REALTIME, as does gettimeofday(). * kernel ev.time default uses CLOCK_REALTIME, as does gettimeofday().
* so subtract gettimeofday() from ev.time and then add * so subtract gettimeofday() from ev.time and then add
@@ -1337,7 +1336,6 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6
now_pressed += t1.tv_sec * 1000000ULL + t1.tv_nsec / 1000; now_pressed += t1.tv_sec * 1000000ULL + t1.tv_nsec / 1000;
now_pressed -= (t2.tv_usec + t2.tv_sec * 1000000ULL); now_pressed -= (t2.tv_usec + t2.tv_sec * 1000000ULL);
} }
}
SHTDCNT::getInstance()->resetSleepTimer(); SHTDCNT::getInstance()->resetSleepTimer();
if (ev.value && firstKey) { if (ev.value && firstKey) {
firstKey = false; firstKey = false;