Showing the changes to interface/src/scripting/ControllerScriptingInterface.cpp (1 of 10 files). Show all
Unified · Split
| @@ -297,6 +297,17 @@ AbstractInputController* ControllerScriptingInterface::createInputController(con · 296 unmodified lines | ||
| 297 | 297 | } |
| 298 | 298 | } |
| 299 | 299 | |
| 300 | +JoystickInputController* ControllerScriptingInterface::joystick() const { | |
| 301 | + // stub to just return the first joystick - assume we only have one connected | |
| 302 | + QVector<JoystickInputController>& activeJoysticks = Application::getInstance()->getJoystickManager()->getJoysticks(); | |
| 303 | + | |
| 304 | + if (activeJoysticks.size() > 0) { | |
| 305 | + return &activeJoysticks[0]; | |
| 306 | + } else { | |
| 307 | + return NULL; | |
| 308 | + } | |
| 309 | +} | |
| 310 | + | |
| 300 | 311 | void ControllerScriptingInterface::releaseInputController(AbstractInputController* input) { |
| 301 | 312 | _inputControllers.erase(input->getKey()); |
| 302 | 313 | } |