I'm writing a program just now that will shutdown my computer if it hasn't been used in a while. Is there any code that will check to see if any keys are being pressed?

If a key is pressed I want to set a variable to 0. I have tried using GetAsyncKeyState but it didn't want to work in a loop.

It doesn't matter what keys are pressed. Just if any are. Thanks.