Re: [fpc-pascal] Getting Last User Input reliably

2021-12-03 Thread Luca Olivetti via fpc-pascal
El 3/12/21 a les 18:37, Dennis Lee Bieber via fpc-pascal ha escrit: Detection is normally done by: if current tick is less than saved tick, roll-over has occurred. Make adjustments to the delta. There is no need to do that, just make sure you're using DWORDs (i.e. unsigned arithmetic)

Re: [fpc-pascal] Getting Last User Input reliably

2021-12-03 Thread Luca Olivetti via fpc-pascal
El 3/12/21 a les 16:41, Travis Siegel via fpc-pascal ha escrit: If there's some sort of a configuration file, just write out the time/date info at the time of leaving the input, then when that routine gets called again, grab the current time/date, and perform a comparison.  That should allow yo

Re: [fpc-pascal] Getting Last User Input reliably

2021-12-03 Thread Travis Siegel via fpc-pascal
If there's some sort of a configuration file, just write out the time/date info at the time of leaving the input, then when that routine gets called again, grab the current time/date, and perform a comparison.  That should allow you to bypass any roll overs of any kind (unless it goes past the

Re: [fpc-pascal] Getting Last User Input reliably

2021-12-03 Thread Luca Olivetti via fpc-pascal
El 3/12/21 a les 14:52, James Richters via fpc-pascal ha escrit: I'm trying to get the time lapsed since the last user input with keyboard or mouse on a Windows PC. For this I am doing: GetLastInputInfo(Last_Input_Info); IdleTime:= (GetTickCount - Last_Input_Info.dwTime) DIV 1000; I was going

[fpc-pascal] Getting Last User Input reliably

2021-12-03 Thread James Richters via fpc-pascal
I'm trying to get the time lapsed since the last user input with keyboard or mouse on a Windows PC. For this I am doing: GetLastInputInfo(Last_Input_Info); IdleTime:= (GetTickCount - Last_Input_Info.dwTime) DIV 1000; This works most of the time, but every 25 days or so GetTickCount rolls over, a