How do you detect every keyboard input?

UserInputService.InputBegan detects almost every keyboard input. I don’t know why, but it just doesn’t detect the Esc, I and O keys. Probably because they are ones that roblox uses by default.
This causes issues for a keybind changing system because I have no way of detecting when these buttons are pressed. Usually in a game you would press the Esc key to cancel the keybind setting operation, but since I can’t even detect the Esc key, this can’t be done.
Any alternatives to UserInputService?

I just did some testing and found that I and O could be detected via UIS but as you say, Escape cannot. I do think this is intended for accessing the built in menu (so that it can’t be blocked from access).

There is a way around this though which may work in your situation. By using a TextBox you can connect to the FocusLost event which passes (enterPressed, InputObject) to the connected function. This event can be triggered by Escape and gives the input object as expected.

1 Like

Good idea. On top of making Esc key recordable, using a TextBox also fixes the problem of the inputs activating when you change a keybind.
All I had to do was add a textbox to the gui, and then set up the script to use both the InputBegan event and the FocusLost event at the same time.
The focus on the TextBox can be controlled with TextBox:CaptureFocus() and TextBox:ReleaseFocus(), so there is actually alot you can do with them.
Thanks for the help.

1 Like