Allow input repeating on A and B buttons

  1. Describe your reason for requesting this feature. What problems are you running into?

I want to add a mechanic where the player holds the A button and an action occurs when they release it. I understand that Pulp doesn't expose input pressed/released events, but I can work around that using the existing functionality and event.frame to count time. Unfortunately, config.inputRepeat only enabled input repeating on udlr as seen in the runtime here:

	if ( LuaTrue( acceptsInput ) ) {
		if ( LuaTrue( justRepeated(Button.UP) ) ) {
		} else if ( LuaTrue( justRepeated(Button.DOWN) ) ) {
		} else if ( LuaTrue( justRepeated(Button.LEFT) ) ) {
		} else if ( LuaTrue( justRepeated(Button.RIGHT) ) ) {
		if ( LuaTrue( justPressed(Button.A) ) ) {
		if ( LuaTrue( justPressed(Button.B) ) ) {
		if ( LuaTrue( crankAngle.relative!==0 ) ) {

I understand repeating A/B button presses could lead to confusing behavior (like interacting with a sprite multiple times, or skipping through dialog) so maybe it could be behind a separate flag like config.inputButtonRepeat?

  1. How would this request improve your experience with using Pulp?

I would be able to build the mechanic I want.

  1. Include any other details you have relating to this request.



I would like to propose an alternative to this, which is that as well as the confirm and cancel events triggering when the buttons are pressed, an event variable is also set that tracks whether or not a button is currently held down at any frame.

For example, if you're holding down the confirm button, event.confirmDown would be 1, else it would be 0, and this would update every frame to represent the state of the button. Using this, one could emit an event only when the confirm button is released using the following snippet:

on draw do
  if event.confirmDown==1 then
    holdingConfirm = 1
  elseif holdingConfirm==1 then
    emit "buttonReleased"
    holdingConfirm = 0

While it is currently possible to do this by counting frames with the dpad, it might be useful to provide this feature for those buttons too, as it would make programming simple experiences that require holding buttons much easier.

bump. would really love any way to interface with A or B being held down


I think a way to detect held button presses would be a HUGE benefit and open up a lot more possibilities in Pulp game development