diff --git a/mods/mobile_keybinds.js b/mods/mobile_keybinds.js new file mode 100644 index 00000000..9afbeb6d --- /dev/null +++ b/mods/mobile_keybinds.js @@ -0,0 +1,21 @@ +(() => { + function runKeybind() { + promptInput("Input the keybind you want to run. (e.g. KeyA, Digit1, Backspace)", (keybind) => { + if (keybinds[keybind]) { + keybinds[keybind](); + } + }) + } + + if (isMobile) { + const keybindButton = document.createElement("button") + keybindButton.id = "keybindButton" + keybindButton.title = "Change static mode" + keybindButton.classList.add("controlButton") + keybindButton.onclick = () => { + runKeybind() + } + keybindButton.textContent = "Keybind" + document.getElementById("pauseButton").before(keybindButton) + } +})() \ No newline at end of file