PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

CaptureFocus

Forces the client to focus on the TextBox.

Returns

Return Type Summary

Code Samples


TextBox:CaptureFocus

The code shown below will force the client to focus on the /TextBox when the ‘q’ key is pressed by the player.

local Mouse = game.Players.LocalPlayer:GetMouse()
 
Mouse.KeyDown:Connect(function(Key)
	if Key:lower() == "q" then
		script.Parent:CaptureFocus()
	end
end)