Posted: Tue May 20, 2014 4:20 pm Post subject: Re: How to detect if a key is being held down?
Yes I've read the tutorial, but I want to know if there is a way to detect if a key is being HELD down because I want part of my program to run only once until the user presses the corressponding key again
Tony
Posted: Tue May 20, 2014 5:51 pm Post subject: Re: How to detect if a key is being held down?
CheshireFox @ Tue May 20, 2014 4:20 pm wrote:
if a key is being HELD down
What does it mean for a key to be "held down"? There's some area of ambiguity -- was that a really fast hold, or a really slow click? Once you define what it means to be held (likely along the lines of "state DOWN and state DOWN some time later"), you can use examples from the tutorial to implement your definition.
Notice how when the up arrow key is pressed it says true, and when it is not pressed it says false.
CheshireFox
Posted: Thu May 22, 2014 9:42 am Post subject: Re: How to detect if a key is being held down?
I want to know how to have a piece of code run if a user presses a key but have that piece of code only run when the user lets go of the key and presses it again.
Raknarg
Posted: Thu May 22, 2014 11:18 am Post subject: RE:How to detect if a key is being held down?
Ok, well like Tony said, define what you mean by the double click. Do you mean like two presses in quick succession, or every second time a button is clicked?