@@ -203,16 +203,16 @@ XInputGamepad::XInputGamepad() :
203203#endif
204204}
205205
206- void XInputGamepad::press (XInputControl button) {
206+ void XInputGamepad::press (uint8_t button) {
207207 setButton (button, true );
208208}
209209
210- void XInputGamepad::release (XInputControl button) {
210+ void XInputGamepad::release (uint8_t button) {
211211 setButton (button, false );
212212}
213213
214- void XInputGamepad::setButton (XInputControl button, boolean state) {
215- const XInputMap_Button * buttonData = getButtonFromEnum (button);
214+ void XInputGamepad::setButton (uint8_t button, boolean state) {
215+ const XInputMap_Button * buttonData = getButtonFromEnum ((XInputControl) button);
216216 if (buttonData != nullptr ) {
217217 if (getButton (button) == state) return ; // Button hasn't changed
218218
@@ -222,9 +222,9 @@ void XInputGamepad::setButton(XInputControl button, boolean state) {
222222 autosend ();
223223 }
224224 else {
225- Range * triggerRange = getRangeFromEnum (button);
225+ Range * triggerRange = getRangeFromEnum ((XInputControl) button);
226226 if (triggerRange == nullptr ) return ; // Not a trigger (or joystick, but the trigger function will ignore that)
227- setTrigger (button, state ? triggerRange->max : triggerRange->min ); // Treat trigger like a button
227+ setTrigger ((XInputControl) button, state ? triggerRange->max : triggerRange->min ); // Treat trigger like a button
228228 }
229229}
230230
@@ -291,8 +291,8 @@ void XInputGamepad::setAutoSend(boolean a) {
291291 autoSendOption = a;
292292}
293293
294- boolean XInputGamepad::getButton (XInputControl button) const {
295- const XInputMap_Button * buttonData = getButtonFromEnum (button);
294+ boolean XInputGamepad::getButton (uint8_t button) const {
295+ const XInputMap_Button * buttonData = getButtonFromEnum ((XInputControl) button);
296296 if (buttonData == nullptr ) return 0 ; // Not a button
297297 return tx[buttonData->index ] & buttonData->mask ;
298298}
0 commit comments