|
Input problems |
Sylvarant
Member #7,886
October 2006
|
I'm making a start screen in wich you can choose from 3 options New Game, Load Game and Quit game by pressing up or down the problem is the keyboard input is collected way to fast. Is there any thing I can do against this? Here's part of the code
|
Kitty Cat
Member #2,815
October 2002
|
You want to check if a key was pressed, not if it's being held down. Use keypressed and readkey. -- |
TeamTerradactyl
Member #7,733
September 2006
|
You can also have a key-input delay. When a key is pressed, set a timer. If they're still holding down the same key when the timer runs out, count it as "another" keypress. This way, they don't have to hit the same key a hundred times to move the cursor around, but they also don't get the key moving so quickly that it's impractical. If they let up on the key, clear the timer. This DOES allow for someone to hit the key very quickly to move the cursor faster than your timer would allow, and it prevents the timer from continuing to think a DIFFERENT key should wait until it's done counting before it accepts its input. Just my 2 cents...
|
|