Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is there any method of detecting key input even with a TextBox focused?

Asked by 8 years ago

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!

1 answer

Log in to vote
1
Answered by
wackem 50
8 years ago

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)
0
Thanks, I'll try that out! ChipioIndustries 454 — 8y
0
Actually, upon further examination, it turns out that UserInputService still does not detect key presses with the TextBox focused. ChipioIndustries 454 — 8y
0
the script i used works perfectly fine, are you using filteringenabled? wackem 50 — 8y
Ad

Answer this question