MCPcopy Create free account
hub / github.com/SFML/SFML / processJoystickButtonEvent

Method processJoystickButtonEvent

src/SFML/Window/Android/WindowImplAndroid.cpp:476–488  ·  view source on GitHub ↗

///////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

474
475////////////////////////////////////////////////////////////
476int 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////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 2

findMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected