Author Topic: Key delay help  (Read 3903 times)

0 Members and 1 Guest are viewing this topic.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Key delay help
« on: May 11, 2010, 12:30:09 am »
I am certain I saw this in another topic, but there are so many posts I no longer can find it and search engine won't help either:

For example, on the highscore screen, when I press 2nd to exit it lands back on the title screen. To start the game, I need to press 2nd too. However, if I hold down 2nd for slightly too long, I don't even have time to see the title screen, even if I use Repeat Getkey=54 instead of Repeat Getkey(54). How would I fix that?

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Key delay help
« Reply #1 on: May 11, 2010, 12:33:29 am »
Put a dummy getKey before the loop, to clear the last key pressed. Hopefully that will work :)
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Key delay help
« Reply #2 on: May 11, 2010, 12:44:28 am »
ok thanks that works. Only with getkey, not getkey(), though.

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Key delay help
« Reply #3 on: May 11, 2010, 12:48:17 am »
You can do this:

While getkey(0):End

That works even when you're using direct keys.  It will wait until you've let go of all the keys.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Key delay help
« Reply #4 on: May 11, 2010, 01:56:07 am »
Aah ok thanks ^^

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Key delay help
« Reply #5 on: May 11, 2010, 07:50:19 am »
You can do this:

While getkey(0):End

That works even when you're using direct keys.  It will wait until you've let go of all the keys.
That's an awesome idea!  I'll have to remember this!  Great point. :D

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Key delay help
« Reply #6 on: May 11, 2010, 11:55:31 am »
If you have animations or the like, make sure they run when running this, though, else all animations will stop until you release all the keys. It's better to use this in menus