"Hand" in Xbox Controller Programming

I was setting up a little code for next year and for instructional purposes to the freshmen, and i was trying to pre-program the Xbox Triggers, and I keep on seeing this code:
if (xbox.getTriggerAxis(hand)){ }
I am very curious on what they mean by “hand.” (I was a little confused on this before the end of build season this year too.) Thanks for your time and sorry for the late conversation.

~Robert Byrd

It’s the side of the controller you want to get. I would imagine that most people hold gamepads with two hands.

2 Likes

That code would I use to put in the place of the “hand”? I was looking on the libraries and saw kLeft and kRightBut it keeps giving me an error every time I replace it with them. I also tried left and right but I still got an error.

Hand may be stored in an enum. It may be Hand.kLeft

This is correct. Hand.kLeft and Hand.kRight. I found an issue though where the xbox1 controller doesn’t work properly with the enum so you would just use raw axis instead.

How would I set the the code up do that I can control the motor?