Sinking specific keycodes from TextBox input?

  1. What do you want to achieve? Keep it simple and clear!
    I would like to sink Enum.KeyCode.Up, Enum.KeyCode.Down, and Enum.KeyCode.Return from being handled by a textbox so that I can handle it myself

  2. What is the issue? Include screenshots / videos if possible!
    Don’t know how to

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    ContextActionService and priority binding, but nope didn’t fix it

Also if you’re curious, I’m making a autocomplete for a lua editor for use in my plugin, RunLSC (there was demand so I decided to try since I was also interested on doing this)
image

can’t you just check with user input service without checking if it got processed

I’m not sure if it is possible yet to do this with native TextBox inputs. What you can do is use a TextLabel instead and manage everything yourself, or temporarily deactivating the TextBox. You can also try disabling MultiLine and registering inputs without checking if it was processed.

Is there a way to stop the textbox from unfocusing itself if you press enter when multiline is disabled then?

You can just focus it again when enter is clicked, just some extra lines of easy code.

Not really, you just need to focus it again, and place the cursor back into the cursor position.

Ah right, I forgot there are functions for controlling the TextBox focus

Thanks @AMisspelledUsernaem @SubtotalAnt8185 @msix29, I decided to go with using UserInputService (was planning to use ContextActionService at first) and the multiline trick

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.