So I am currently making a custom chat which has some minor problems with the key codes.
UIS.InputBegan:Connect(function(input, gpe)
if gpe then return end
if input.KeyCode == Enum.KeyCode.Slash then
chatBar:CaptureFocus()
chatBar.Text = ""
end
end)
So if the player presses / then the player will focus on the chat box, but
If the slash key is being listened to internally for events, then gameProcessedEvent will be true which in your case is grounds for rejecting continuation of the code. I do believe that chat bars ignore gameProcessedEvent as you realistically don’t use it for anything other than chatting. I otherwise don’t fully understand the first question: please make sure to be detailed but succinct when explaining issues.
A text box’s text will not reset unless ClearTextOnFocus is true. This is a property you can modify on the chat box itself. If you, for some reason, can’t have this off but want to clear the box upon a certain action occurring, just set the text property to a blank string.
Unless the gameProcessedEvent is true thus stopping the chatbar code from running, I don’t see a problem code wise. As long as your chatBar is a TextBox then it should be working. I only have 2 thoughts. The first is that it should be ran in a LocalScript and if not then try that, but I assume it is already in one. My only other thought/question is are you using PlaceHolder text? If you are and not typing into the chatBar to test it, the chatBar.Text = "" may not be showing (it is setting the text to nothing, but you are still seeing the placeholder text).
So for the first question, I meant: If I wanted to chat by pressed the slash key, it wouldn’t work, so I’d just have to tap the chat bar instead. Then, it would work all fine…
ClearTextOnFocus is true yet somehow that / keeps coming up.