This is an example of one of the TextBoxes inflicted with this bug.
Title explains it all basically.
Literally, code:
game:GetService'UserInputService'.InputBegan:connect(function(Input, gameProcessed)
if Input.UserInputType == Enum.UserInputType.Keyboard and not gameProcessed then
......
end
end
However, there are like 8-10 TextBoxes across all the GUI, I don’t want to write actual Focused cases for ALL
individual ones for them. I don’t know what property or something I have to do in order for InputBegan keys to not fire while I’m typing on a TextBox.
I think there’s a way for you to specifically direct it to just one TextBox.
TextBox:GetPropertyChangedSignal(“Text”):Connect(function()
// code here
end)
This method can be used to determine whether the user has a textbox selected that they’re typing in, and if so disregard the fired input for further processing.
Well yeah, of course it’s going to fire. UserInputService.InputBegan is an event that fires when input is made. You’re checking for the keyboard UserInputType, meaning any keyboard interaction that isn’t internally preoccupied will fire.
UserInputService has two events UserInputService/TextBoxFocused and UserInputService/TextBoxReleased
Maybe hook them up to specific events with a boolean
Example:
local UserInputService = game:GetService("UserInputService")
local TEXTBOX_FOCUSED = false
UserInputService.TextBoxFocused:Connect(function(textBox)
TEXTBOX_FOCUSED = true
end)
UserInputService.TextBoxFocusReleased:Connect(function(textBox)
TEXTBOX_FOCUSED = false
end)
UserInputService.InputBegan:Connect(function(Input, game processed)
if Input.UserInputType == Enum.UserInputType.Keyboard and not gameProcessed and not TEXTBOX_FOCUSED then
--sample code here
end
end)
I noticed in the picture of the properties for the affected text box you uploaded that the class name is ‘TextLabel’. Are all the afflicted text boxes like this? It may be a custom text box implementation.