| 1111 | } |
| 1112 | |
| 1113 | void 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 | |
| 1129 | void updateJoystickAxis(ImGuiIO& io, ImGuiKey key, sf::Joystick::Axis axis, float threshold, float maxThreshold, bool inverted) |
| 1130 | { |