Possible Duplicate:
Detecting that the user is away from the PC with .NET
I want to make a function which determines if someone is currently AFK or not.
For that I want to listen to the Keyboard Keys.
Any ideas how to realize such a function?
The normal KeyPressed event works only if the Form is focused, right?
That’s right. You need something more global since a user will not have focus set onto a single application. Take a look at this CodeProject article/Codeplex project
Regardless of language and framework this is how applications such as instant messengers determine whether or not a user is AFK. It should be noted though that this can be used for nefarious purposes such as key loggers.
Abstract: