tjheldna Posted November 18, 2012 Share Posted November 18, 2012 Hi guys, Is there a way to detect a KeyHit event which can be any keyboard key? (C++) Thanks in advance! Quote Link to comment Share on other sites More sharing options...
Road Kill Kenny Posted November 19, 2012 Share Posted November 19, 2012 Maybe try something like this: Not sure if this is the exact code or what exactly GetChar() returns if nothing is hit cuz I'm at work and can't check. But it should give you enough information to figure it out. bool AnyKeyHit(){ int key = NULL; key = LE::GetChar(); LE::FlushKeys(); if(key != NULL) return true; else return false } Quote STS - Scarlet Thread Studios AKA: Engineer Ken Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now! Link to comment Share on other sites More sharing options...
tjheldna Posted November 19, 2012 Author Share Posted November 19, 2012 Cheers STS, I think GetChar() could be what I'm after. I'll give it a test tonight. Thanks again! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.