I am currently developing a chat system, but I have run into an issue. By default, KeyDown and KeyUp and other input detection methods are blocked while a user is typing in a textbox. This is a problem because I need to be able to send the chat by pressing the "Enter" key. Anyway, is there any way around this problem? Thanks!
COMMUNITY QUESTION
Is there any method of detecting key input even with a TextBox focused?
1 answer
very simple, use userinputservice and ignore the game proccessed event.
like this:
local uis = game:GetService("UserInputService")
uis.InputBegan:connect(function(key, gpe)
if key.KeyCode == Enum.KeyCode.Return then
print("ok")
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Thanks, I'll try that out!
Actually, upon further examination, it turns out that UserInputService still does not detect key presses with the TextBox focused.
the script i used works perfectly fine, are you using filteringenabled?