From 40062fcdc2a69d2712b0014ce24b59e2fb8577ae Mon Sep 17 00:00:00 2001 From: Synthasmagoria Date: Mon, 14 Sep 2026 23:21:01 +0200 Subject: [PATCH] Make input boxes actually take input --- src/libraries/raylib/raygui/raygui.h | 15 ++++++++++++--- src/web/odin.js | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/libraries/raylib/raygui/raygui.h b/src/libraries/raylib/raygui/raygui.h index 99e27e0..3851d48 100644 --- a/src/libraries/raylib/raygui/raygui.h +++ b/src/libraries/raylib/raygui/raygui.h @@ -3346,9 +3346,18 @@ int GuiValueBoxFloat(Rectangle bounds, const char *text, char *textValue, float { if (GuiGetTextWidth(textValue) < bounds.width) { - int key = GUI_INPUT_KEY; - if (key != 0) { - key = key; + int key = 0; + for (int i = 0; i < 10; i++) { + if (GUI_KEY_PRESSED(KEY_ZERO + i)) { + key = KEY_ZERO + i; + break; + } + } + if (key == 0 && GUI_KEY_PRESSED(KEY_MINUS)) { + key = '-'; + } + if (key == 0 && GUI_KEY_PRESSED(KEY_PERIOD)) { + key = '.'; } if (((key >= 48) && (key <= 57)) || (key == '.') || diff --git a/src/web/odin.js b/src/web/odin.js index 42456a8..071b0b4 100644 --- a/src/web/odin.js +++ b/src/web/odin.js @@ -1430,7 +1430,7 @@ function odinSetupDefaultImports(wasmMemoryInterface, consoleElement, memory) { let event_temp = {}; - const onEventReceived = (event_data, data, callback) => { + const onEventReceived = (event_data, data, callback) => { event_temp.data = event_data; const exports = wasmMemoryInterface.exports;