MCPcopy Create free account
hub / github.com/SFML/imgui-sfml / updateJoystickButtonState

Function updateJoystickButtonState

imgui-SFML.cpp:1113–1127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1111}
1112
1113void updateJoystickButtonState(ImGuiIO& io)
1114{
1115 for (int i = 0; i < static_cast<int>(sf::Joystick::ButtonCount); ++i)
1116 {
1117 const ImGuiKey key = s_currWindowCtx->joystickMapping[i];
1118 if (key != ImGuiKey_None)
1119 {
1120 const bool isPressed = sf::Joystick::isButtonPressed(s_currWindowCtx->joystickId, static_cast<unsigned>(i));
1121 if (s_currWindowCtx->windowHasFocus || !isPressed)
1122 {
1123 io.AddKeyEvent(key, isPressed);
1124 }
1125 }
1126 }
1127}
1128
1129void updateJoystickAxis(ImGuiIO& io, ImGuiKey key, sf::Joystick::Axis axis, float threshold, float maxThreshold, bool inverted)
1130{

Callers 1

UpdateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected