I wan’t to read keyboard input but I can’t prompt the keyboard without having them click on the keyboard. the closest I can think of is having a native textbox off of the screen and using the setKeyboardFocus on it to simulate it opening up. I can’t find any other way online.
Edit:
I did some testing and my method did work but I can’t seem to remove the function from the event
function PromptKeyboard(callback) local function a(event) if event.phase == "ended" or event.phase == "submitted" then Runtime:removeEventListener("key",callback) Runtime:removeEventListener("userInput",a) end end Runtime:addEventListener("userInput",a) native.setKeyboardFocus(HiddenUi) Runtime:addEventListener("key",callback) end
after I close the keyboard it should disconnect all events from it but it does not?