Detect when enter key pressed while textbox focused

How can I make my script detect when the user presses the enter key on their keyboard while having a GUI textbox focused?

4 Likes

You can use UserInputService to do this.

Well easy way: use UIS (UserInputService) to listen for enter key press, then check if the text box is in focus

1 Like

Is this something you are looking for?
https://developer.roblox.com/en-us/api-reference/event/TextBox/FocusLost

7 Likes