Hey there, I've been looking for the enum.keycode for right click without using the mousebuttondown function, any help?
COMMUNITY QUESTION
What is the enum.keycode for right click?
1 answer
It's not a keycode. When using mouse buttons in a GUI, use:
(path of GUI).MouseButton2Down:Connect(function(RCLICK)
And when using mouse buttons on a physical object, use:
(path of Objct).Button2Down:Connect(function(RCLICK)
Haven't scripted for a while, hope it works, and let me know if it doesn't!
2 comments
0
I'm certain this answer is not what he was looking for, and the second example is not a valid event of any object other than a gui.
0
@AetherProgrammer, the second example is mostly wrong, because when its a gui, you can only use for example Button1Down with a Mouse in the start so ye
This discussion is preserved as it was. New answers, comments, and votes are closed.

7 comments
Why not use UserInputService?
MouseButton2, although it isn't a KeyCode because it isn't a key.
^ Isn't that deprecated? Or am I thinking of a different object
No, it isn't deprecated.
oh
https://developer.roblox.com/en-us/api-reference/property/InputObject/UserInputType
Thus, it should be
Enum.UserInputType.MouseButton2.