UserInputService:IsKeyDown() doesn't work with VR controller?

(My VR headset is the Oculus Rift CV1)
What do you want to achieve?
I want UserInputService to detect whether a button on my VR controller is being pressed down.

What is the issue?
Despite UserInputService being able to detect the correct buttons being pressed with InputBegan, it will always report false even if the button is being pressed down with :IsKeyDown().

What solutions have you tried so far?
I wrote this quick script to check if the button is being pressed

UIS = game:GetService("UserInputService")
game:GetService("RunService").Heartbeat:Connect(function()
	
	print(UIS:IsKeyDown(Enum.KeyCode.ButtonA))
	
end)

When pressing the A button on my controller, InputBegan reported that it’s Enum.KeyCode.ButtonA.
When checking if ButtonA is being pressed, with the script above, it will always report false. Restarting studio did not fix this.
I then replaced ButtonA with the Z key on my keyboard to see if that would print true. It did.

Does anyone know any solutions to this? I feel like it’s a really obvious solution.

I knew it was a simple solution.
You have to use UserInputService:IsGamepadButtonDown(). Woops.

6 Likes