~rabbits/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch

[PATCH uxn5] Fix Controller vector behaviour for keyboard keys

Details
Message ID
<20250115101324.75192-1-finn.coffey@gmail.com>
Sender timestamp
1736975605
DKIM signature
pass
Download raw message
Patch: +6 -1
Ignores key-up events for regular (non-button) keys.
Clears Controller/key byte after eval-ing the vector.

---
 src/devices/controller.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/devices/controller.js b/src/devices/controller.js
index 4b01d77..cd2d733 100644
--- a/src/devices/controller.js
+++ b/src/devices/controller.js
@@ -53,6 +53,11 @@ function Controller(emu)
			event.preventDefault(); 
		}
		emu.uxn.dev[0x82] = this.state;
		emu.uxn.eval(peek16(emu.uxn.dev, 0x80))
		if(mask || event.type == "keydown") {
			emu.uxn.eval(peek16(emu.uxn.dev, 0x80))
		}
		if(event.type == "keydown") {
			emu.uxn.dev[0x83] = 0;
		}
	}
}
-- 
2.39.5 (Apple Git-154)
Reply to thread Export thread (mbox)