///////////////////////////////////////////////////////
| 474 | |
| 475 | //////////////////////////////////////////////////////////// |
| 476 | int WindowImplAndroid::processJoystickButtonEvent(AInputEvent* inputEvent, |
| 477 | std::int32_t action, |
| 478 | Joystick::Button button, |
| 479 | ActivityStates& states) |
| 480 | { |
| 481 | const auto deviceId = AInputEvent_getDeviceId(inputEvent); |
| 482 | if (states.joystickStates.find(deviceId) == states.joystickStates.end()) |
| 483 | return 1; |
| 484 | |
| 485 | const auto buttonIdx = static_cast<std::underlying_type_t<decltype(button)>>(button); |
| 486 | states.joystickStates[deviceId].buttons[buttonIdx] = action == AKEY_EVENT_ACTION_DOWN; |
| 487 | return 1; |
| 488 | } |
| 489 | |
| 490 | |
| 491 | //////////////////////////////////////////////////////////// |