Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

length of pressure

 
Paul Keohan
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When using the KeyPressed method of the KeyKistener interface how do I make sure a key hit is recognised only once? If I hold a key down for more than a second, the listener keeps responding. I should be able to hold the key down for ten minutes and still only get one response.
I know there's a keyReleased method but something tells me there's a problem with that.
Can anyone help me?
Thanks
Paul
 
Paul Keohan
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please ignore. I've found the problem and it was to do with mistakingly adding more than one listener.
 
Hang a left on main. Then read this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!