Log In  

As simple as the subject.

  • Write a cart that uses btnp().
  • Run the cart.
  • Press and hold a button to see it repeats.
  • Hit esc to stop the cart.
  • Enter 'resume' to resume the cart.
  • Press and hold a button and see if it fails.

(Either that or key repeat isn't supposed to be a thing with btnp() and it only works right after you resume.)

This code is sufficient to show it:

boops=0
function _update()
  if btnp()!=0 then
    boops+=1
    print("boop #"..boops)
  end
end

Note: tested on win64 version.

P#66569 2019-08-11 20:53 ( Edited 2019-08-14 00:20)

You're right ! If you run your program, press [ESC] to STOP it, then manually type out RESUME followed by [ENTER], the key repeat function no longer works.

Same results if you place this code in _draw() instead.
Yeah, there's something screwy going on with exiting and RESUME() as Felice found.

Something for the ZEP to fix.

Try this update for fun:

boops=0
function _update()
  if btnp()!=0 then
    _update_buttons()
    boops+=1
    print("boop #"..boops)
  end
  _update_buttons()
end

Not very exciting, but now press [ESC] and type RESUME. And there it is, BTNP() with top-speed repeat in place.

P#66587 2019-08-11 23:43 ( Edited 2019-08-12 00:05)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-04-19 01:01:37 | 0.005s | Q:12