| 6284 | } |
| 6285 | |
| 6286 | const bool Inputs::bControllerRawInputPressed(int player, const unsigned button) const |
| 6287 | { |
| 6288 | if ( button < 299 || button >= (301 + SDL_GameControllerButton::SDL_CONTROLLER_BUTTON_MAX) ) |
| 6289 | { |
| 6290 | return false; |
| 6291 | } |
| 6292 | const GameController* controller = getController(player); |
| 6293 | if ( !controller ) |
| 6294 | { |
| 6295 | return false; |
| 6296 | } |
| 6297 | |
| 6298 | if ( button == 299 || button == 300 ) // triggers |
| 6299 | { |
| 6300 | return controller->binaryToggle(static_cast<SDL_GameControllerAxis>(button - 299 + SDL_CONTROLLER_AXIS_TRIGGERLEFT)); |
| 6301 | } |
| 6302 | else |
| 6303 | { |
| 6304 | return controller->binaryToggle(static_cast<SDL_GameControllerButton>(button - 301)); |
| 6305 | } |
| 6306 | } |
| 6307 | |
| 6308 | const bool Inputs::bControllerRawInputReleased(int player, const unsigned button) const |
| 6309 | { |
no test coverage detected