Jump to content

Recent Topics

Recent Status Updates

  • Photo
      15 Nov

    Hi, I am final year Interior Design Student from University of Huddersfield. I am currently working on my final major project which is going to be linked to coding. I was hoping that you could help me with my research. I have prepared a short survey, it would be a massive help if you could fill it in for me. It takes less than 2 minutes to complete, I promise. Here is the link: https://www.surveymonkey.com/s/73XLJKK Thank you so much in advance!

View All Updates

Developed by TechBiz Xccelerator
- - - - -

Key press detection

  • Please log in to reply
1 reply to this topic

#1 mshanks


    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 23 April 2008 - 09:45 PM

Hey all,

I'm quite new to programming so apologies if I'm being stupid asking this.

I've made a little Windows (xp) application using Visual Studio - one of the features I want for it is to detect key presses.

I have an integeter, counter, that starts at 100. I want it to decrement by 1 each time the user presses any key on their keyboard. After 1 minute, it will reset to 100.

It also needs to do this regardless of whether the application window is the active window or in the background.

If any one could point me in the right direction with this I'd greatly appreciate it.


- mshanks
  • 0

#2 v0id



  • Retired Mod
  • PipPipPipPipPipPipPipPip
  • 2,313 posts

Posted 23 April 2008 - 09:52 PM

I'm not a Windows programmer, but I remember that GetAsyncKeyState is able to receive keyboard inputs no matter if it's inactive or active. It's found in user32.dll.
  • 0
If you enjoy reading this discussion and are thinking about commenting, why not click here to register and start participating in under a minute?

Powered by binpress