You can avoid frequent polling if key autorepeat is on. You set a timeout with keyDown (you can use it with EvtGetEvent also) which is slightly bigger than autorepeat rate, and you don't poll until time is up. In this case polling is postponed with any auto-repeated keyDown.
Michael -----Original Message----- From: Howard Tomlinson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 27 November 2001 7:07 AM To: Palm Developer Forum Subject: RE: How to detect if a key is released Just to follow up, (For Mike's benefit, plus anyone else) There's no event posted when the user releases a hard key. The only way to detect is to continually poll the key states until the user releases. The implications for battery life are there too - the more responsive you want to be able to detect the release, the shorter timeout you'll put on your event loop, and the worse the battery life would be. Regards, Howard. -- Howard Tomlinson - [EMAIL PROTECTED] Games Designer, Astraware Ltd. - http://www.astraware.com/ > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of Peter > Epstein > Sent: 26 November 2001 19:45 > To: Palm Developer Forum > Subject: RE: How to detect if a key is released > > > If I recall, you can poll the hard button state any time you want. I think > this is how many games work. You might want to check out the source for > HardBall in the Examples folder. > -- > Peter Epstein > > -- > For information on using the Palm Developer Forums, or to > unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/ > -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/ -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
