At first time, I met this problem when I was trying to get mouse input through UserInputService.InputBegan signal.
local UserInputService = game:GetService("UserInputService")
UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
if gameProcessedEvent then
return nil
end
print(input.KeyCode) -- Output: Enum.KeyCode.Unknown
end)
Thanks for the report. As of now, the mouse keycodes are primarily meant to be used with our new Input Action System and do not get classified in UserInputService events in the KeyCode property of an InputObject. To do this, please use the UserInputType property like other users have suggested. Let us know if you encounter any issues!
Thanks to @2_rafael2 and @efsane14010 for response. I was confused when I saw that UserInputServicd.InputBegan input parameter does support mouse besides theres enums for mouse buttons.
I did research and found something in InputObject documentation: