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

How do you tell if the player is typing?

Asked by
rexhawk 222 Moderation Voter
4 years ago

Hello! I'm currently making a custom system UI and I'm attempting to make the custom chat button (as shown below) turn blue when I start typing.

The problem is that I don't know how to approach this. I've tried searching for the solutions but all I get are unhelpful answers to other problems.

Example #1

Is there an event that fires when the player starts/stops typing? I'm sorry I don't have code, I don't have any because I didn't know where to start.

1 answer

Log in to vote
2
Answered by 4 years ago

Ok, so this is the way to do it:

local typing = false
game:GetService(“UserInputService”).InputBegan:Connect(function(key, istyping)
      if istyping then
            typing = true 
     end
end)

Basically, the second argument of the function checks if the player is typing. Hope it helps!

0
Also, you can use InputEnded to make typing false. alexfinger21 341 — 4y
0
Yeah. ThatWorldDev 2 — 4y
Ad

Answer this question