~foura/uxn900

3a626ba43e255da7f9627b0b74cd7a12cfcdf3e2 — james palmer 4 months ago 88b17af
controller: only trigger the controller vector if the button state has changed.

fixes double pressing events in donsol.
1 files changed, 6 insertions(+), 3 deletions(-)

M src/dev/controller.c
M src/dev/controller.c => src/dev/controller.c +6 -3
@@ 83,10 83,12 @@ static void
controller_process_buttons(Controller *ctrl, Uxn *u)
{
	int col, row;
	Uint8 c;
	Uint8 c, last;

	/* scan the keyboard matrix */
	last = ctrl->buttons;
	ctrl->buttons = 0;

	/* scan the keyboard matrix */
	for(col = 0; col < 8; col++) {
		c  = ctrl->raw.cur[col];



@@ 98,7 100,8 @@ controller_process_buttons(Controller *ctrl, Uxn *u)
		}
	}

	uxn_eval(u, ctrl->vector);
	if(ctrl->buttons != last)
		uxn_eval(u, ctrl->vector);
}

static void