Userinputservice Tab key not working

my current code is:

local uis = game:GetService("UserInputService")

local inv = script.Parent


uis.InputBegan:Connect(function(input, busy)
	if input.KeyCode == Enum.KeyCode.Tab and not busy then
		if inv.Visible == true then
			game.Lighting.menublur.Enabled = false
			inv.Visible = false
		else
			game.Lighting.menublur.Enabled = true
			inv.Visible = true
		end
	end
end)

and it works fine whenever i change Enum.KeyCode to M or a letter but whenever I change it to something like tab or escape it doesnt work. why and how do i fix this.

2 Likes

It could be Tab is usually processed by another event, so the not busy may be causing an issue? Try just checking the KeyCode is equal to the Tab KeyCode

4 Likes

ive removed the not busy and it was still the same, the keycode is indeed correct.

edit: nevermind i just didnt publish, removing the not busy worked, thank you.

1 Like