How to detect i and o?

I’m using UIS to detect what a player is typing however I seem to be able to not detect i and o with UIS

can I see your code? :slightly_smiling_face:

function TrackInputs()
	TRACKTEXTCONNECTION = UIS.InputBegan:Connect(function(i)
		if i.UserInputType == Enum.UserInputType.Keyboard then
			wait(.05)
			if ChantTextLabel.Text == "" and i.KeyCode == Enum.KeyCode.T then
			else
				local char = UIS:GetStringForKeyCode(i.KeyCode)
				ChantTextLabel.Text = string.gsub(ChantTextLabel.Text,"_","")
				ChantTextLabel.Text = ChantTextLabel.Text..char.."_"
			end
		end
	end)
end

excuse me, what is this? (30s)

ah well its for disconnecting UIS

you’re detecting T key, is that why?

if you are trying to detect when you press “I” or “O”, you should check if i.KeyCode is Enum.KeyCode.I or Enum.KeyCode.O

if i.KeyCode == Enum.KeyCode.I or i.KeyCode == Enum.KeyCode.O then

...
1 Like

The issue is i and o isn’t even registered as an input

are you saying i and o aren’t keycodes?

Yup when I pressed i and o my print didn’t go off

(the print that I deleted when I posted that code)

They are valid KeyCodes, I don’t know why you are saying it doesn’t work.

1 Like

do you get any errors in the output?

Nope I have no clue why the input just isn’t registering

Can you show us your code when you test for I and O.

UIS.InputBegan:Connect(function(i)
	print(i.KeyCode)
end)

I believe it’s because “i” and “o” are ways to zoom your camera in and out. I have had this same problem with shift when shift lock is on.

1 Like

How would I fix this though? (30)

I don’t see why you would need those specific keys…why don’t you just use “K” and “L” instead?

Wouldn’t it only not work if they checked for GameProcessedEvent and returned. I’m pretty sure you’d be able to still detect input from reserved stuff.