Page 1 of 1

Check for a key hit

Posted: Wed Nov 03, 2004 11:43 pm
by lucid
Hi, Ive searched the forums and couldnt find anything on this.

I am trying to find a way to determine if an arrow key has been hit, not "pressed down" and not "released"

In other words im not looking for KeyboardPushed, or KeyboardReleased.... I wish there was a KeyboardHit.

How can I simulate this for the arrow keys? The moment an arrow key is hit, i want a value to change but not continuously change if the user holds the key down.

Re: Check for a key hit

Posted: Wed Nov 03, 2004 11:53 pm
by Dare2
Hi lucid

Could you do this?

Create a variable you use as a flag.

If key pushed (arrow key) and flag is 0, then set flag to 1 and change the value you want to change.

If key released set flag to 0

Otherwise do nothing.

Posted: Thu Nov 04, 2004 12:03 am
by lucid
Hey thanks Dare2!

odd enough I was just trying the same thing just now.

Would be really nice to have a KeyHit feature to avoid the extra flag programming.

Guess it doesnt really matter though.