Showing the changes to interface/src/ControllerScriptingInterface.cpp (1 of 11 files). Show all
Unified · Split
| @@ -219,3 +219,19 @@ void ControllerScriptingInterface::releaseKeyEvents(const KeyEvent& event) { · 218 unmodified lines | |||
| 219 | } | 219 | } |
| 220 | } | 220 | } |
| 221 | 221 | ||
| 222 | bool ControllerScriptingInterface::isJoystickCaptured(int joystickIndex) const { | ||
| 223 | return _capturedJoysticks.contains(joystickIndex); | ||
| 224 | } | ||
| 225 | |||
| 226 | void ControllerScriptingInterface::captureJoystick(int joystickIndex) { | ||
| 227 | if (!isJoystickCaptured(joystickIndex)) { | ||
| 228 | _capturedJoysticks.insert(joystickIndex); | ||
| 229 | } | ||
| 230 | } | ||
| 231 | |||
| 232 | void ControllerScriptingInterface::releaseJoystick(int joystickIndex) { | ||
| 233 | if (isJoystickCaptured(joystickIndex)) { | ||
| 234 | _capturedJoysticks.remove(joystickIndex); | ||
| 235 | } | ||
| 236 | } | ||
| 237 | |||