I would like to be able to detect the user inactivity for a certain amount of time.
For example, if the user do not use the mouse or keyboard for some predefined time (60min for example) I would like to close the databases and program.
I would like also to show the info somewhere on window, how much time is left before closing the program because of inactivity (like counter). Then if the user moves the mouse of uses keyboard I reset the counter back to 60min and count down again...
I know I have to use a timer, but I don't know how to detect the mouse or keyboard activity...
Is there any way I can accomplish this?