Hack Forums
[C#] Need help creating Idle Timer - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [C#] Need help creating Idle Timer (/showthread.php?tid=6157505)



Need help creating Idle Timer - OCTRAIN - Jun 6, 2021

Hello,

I am trying to create a program that essentially checks if there is any input from either mouse or keyboard and if there is no input after a period of time to execute a part of the program.

I guess I will have to monitor for input and reset a timer if there is input however I am unsure how to monitor for input from both keyboard and mouse at the same time any help would be appreciated! I have tried to google but had no joy!


RE: Need help creating Idle Timer - HFDone - Jun 6, 2021

https://www.codeproject.com/Articles/28064/Global-Mouse-and-Keyboard-Library
http://joelabrahamsson.com/detecting-mouse-and-keyboard-input-with-net


RE: Need help creating Idle Timer - arsium - Jun 11, 2021

You have to create a global hook with CallNextHookEx for both keyboard and mouse