Keypress delay

Discuss PocketC for Palm OS (including Desktop Edition)

Postby Int21h on Sat Jul 23, 2005 4:10 pm

When programming a game and using the keys to move (with event() or Fevent()) there is a delay after the key is first pressed of about a second before the character continues to move. For instance, when you press and hold the key to move left, your character would move one space left, wait about a second, and then move quickly left. Another problem with this is if you hold a 'move left' button and then press a 'jump' button, there is a delay as the keypress queue gets rid of all the 'move left' characters and finally hits your 'jump' character. In the old days you could set the key click delay so that right when you pressed and held a key it would immediately start moving and continue to move. Does anyone know how to overcome this? Maybe the second problem could be fixed by flushing the key() queue?
Int21h
 
Posts: 14
Joined: Tue Jun 21, 2005 8:04 pm

Postby jstadolnik on Sun Jul 24, 2005 1:50 am

Use the PToolboxLib's NoKeyEvent() and checkKey() functions to get around this.

-Joe

The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm
jstadolnik
 
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA


Return to PocketC for Palm OS

Who is online

Users browsing this forum: No registered users and 4 guests

cron