Enum.KeyCode.DPad enums do not work with IsKeyDown or BindAction

The KeyCode Enums relating to D-Pad buttons on gamepads do not work with UserInputService.IsKeyDown or ContextActionService.BindAction. However, they do work with UserInputService.InputBegan/Changed/Ended.

This does not work (changeAttribute is never fired when pressing DPadLeft/DPadRight):

[code]local CAS = game:GetService(“ContextActionService”)

CAS:BindAction(
“Color”,
changeAttribute,
false,
Enum.KeyCode.Q, Enum.KeyCode.E,
Enum.KeyCode.DPadLeft, Enum.KeyCode.DPadRight
)[/code]

This works (it prints “lol” when DPadLeft is pressed):

[code]local UIS = game:GetService(“UserInputService”)

UIS.InputBegan:connect(function(input, processed)
if input.UserInputType == Enum.UserInputType.Gamepad1 then
if input.KeyCode == Enum.KeyCode.DPadLeft then
print “lol”
– do stuff
end
end
end)
[/code]

2 Likes