- Home /
New Input System GetKeyDown Alternative?
I'm updating my game to be using the new Input System. It's preaty much done, but there's one thing that I don't know how to do.
When using the IPointerDownHandler on my UI I need to find out if the button pressed was the left or the right one. I used to do this life this: if (Input.GetMouseButtonDown(1)) ...
But now I need to get rid of all the calls from the old method. How could I do this in the new Input System?
Comment
Best Answer
Answer by Zaeran · Sep 08, 2020 at 04:05 PM
In the PointerEventData class that you pass into the OnPointerDown event, you can check that
eventData.button == InputButton.Right