I would consider changing your app from responding to key events to polling
the keys.  That way, you can vary the rate at which you check for them or
ignore them all together.  The Reptoids example that use to be in the SDK
illustrates how to poll the hardware keys.  I don't know how hard it would
be to adapt polling to your game.  One suggestion would be to leave your key
handling routines in place and simply add a polling routine that can post
the same or custom key messages.  Its just a thought.

----- Original Message ----- 
From: "Giorgos Sarris" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Wednesday, September 24, 2003 6:11 PM
Subject: How can I slow down the Hard Key events if it is kept pressed?


> Hi to all,
>
> I have a game and it uses the hard keys.
> If one key is kept pressed it does repeat the KeyPress
> events too fast. I would like to SLOW it down or make
> it only one event.
> How do I do that?
> I use this GameMask.
>
> static void GameMaskKeys ()
> {
> UInt16 initDelay;
> UInt16 period;
> Boolean queueAhead;
>
> // Set the keys we poll to not generate events.  This
> saves cpu cycles.
> KeySetMask( ~(Key1 | Key2 | Key3 | Key4) );
>
> // Avoid the code below because KeyRates is broken.
> //return;
>
> // Also set the key repeat rate low to avoid
> constantly checking them.
> initDelay = slowestKeyDelayRate;
> period = slowestKeyPeriodRate;
> queueAhead = true;
> KeyRates(true, &initDelay, &period, &period,
> &queueAhead);
> }
>
>
> Thanks a lot
> Giorgos
>
> ____________________________________________________________
> Do You Yahoo!?
> Αποκτήστε τη δωρεάν @yahoo.gr διεύθυνση σας στο http://www.otenet.gr
>
> -- 
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/
>


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to