From 91c94af9f88ca7c1a4c2e0ba66ef4d3d3293044e Mon Sep 17 00:00:00 2001 From: neauoire Date: Sun, 27 Mar 2022 14:29:46 -0700 Subject: [PATCH] Added Controller/key --- etc/console.rom | Bin 0 -> 69 bytes src/uxn11.c | 4 ++++ 2 files changed, 4 insertions(+) create mode 100644 etc/console.rom diff --git a/etc/console.rom b/etc/console.rom new file mode 100644 index 0000000000000000000000000000000000000000..f8088dd7700ec9b29c152a77525c7bcfb7bf5bc3 GIT binary patch literal 69 zcmZ3$DAFKczJSqSN`r*B;*^H(yh;oU7_A$)`5J`8fI #include #include +#include #include "uxn.h" #include "devices/system.h" @@ -115,6 +116,7 @@ processEvent(void) } break; case KeyPress: { XKeyPressedEvent *e = (XKeyPressedEvent *)&ev; + char buf[7]; if(e->keycode == XKeysymToKeycode(display, XK_Escape)) exit(0); if(e->keycode == XKeysymToKeycode(display, XK_Up)) controller_down(devctrl, 0x10); if(e->keycode == XKeysymToKeycode(display, XK_Down)) controller_down(devctrl, 0x20); @@ -124,6 +126,8 @@ processEvent(void) if(e->keycode == XKeysymToKeycode(display, XK_Alt)) controller_down(devctrl, 0x02); if(e->keycode == XKeysymToKeycode(display, XK_Shift)) controller_down(devctrl, 0x04); if(e->keycode == XKeysymToKeycode(display, XK_Home)) controller_down(devctrl, 0x08); + XLookupString(e, buf, 7, NULL, NULL); + controller_key(devctrl, buf[0]); } break; case KeyRelease: { XKeyPressedEvent *e = (XKeyPressedEvent *)&ev;