------------------------------------------------------------------------------
| 168 | |
| 169 | //------------------------------------------------------------------------------ |
| 170 | void SDLInputManager::init() |
| 171 | { |
| 172 | Con::addVariable( "pref::Input::JoystickEnabled", TypeBool, &smJoystickEnabled, |
| 173 | "If true, Joystick devices will be automatically opened.\n\n" |
| 174 | "@ingroup Input"); |
| 175 | Con::addVariable("pref::Input::JoystickSplitAxesLR", TypeBool, &smJoystickSplitAxesLR, |
| 176 | "Split axis inputs on 4 axis joysticks. This has no effect on any other device.\n\n" |
| 177 | "4 Axis joysticks use IDs 0-3 which get mapped to xaxis, yaxis, zaxis and rxaxis. " |
| 178 | "When true, this will increment IDs 2 and 3 so the inputs map to xaxis, yaxis, rxaxis and ryaxis.\n" |
| 179 | "@ingroup Input"); |
| 180 | Con::addVariable("pref::Input::sdlControllerEnabled", TypeBool, &smControllerEnabled, |
| 181 | "If true, any Joystick device that SDL recognizes as a Game Controller will be automatically opened as a game controller.\n\n" |
| 182 | "@ingroup Input"); |
| 183 | Con::addVariable("pref::Input::JoystickPOVButtons", TypeBool, &smPOVButtonEvents, |
| 184 | "If true, the pov hat will be treated as 4 buttons and make/break events will be generated for " |
| 185 | "upov, dpov, lpov and rpov.\n" |
| 186 | "@ingroup Input"); |
| 187 | Con::addVariable("pref::Input::JoystickPOVMask", TypeBool, &smPOVMaskEvents, |
| 188 | "If true, the pov hat will be treated as a single input with a 4 bit mask value. The povmask " |
| 189 | "event will be generated with the current mask every time the mask value changes.\n" |
| 190 | "@ingroup Input"); |
| 191 | |
| 192 | // POV Hat mask bits |
| 193 | Con::setIntVariable("$SDLMask::HatUp", SDL_HAT_UP); |
| 194 | Con::setIntVariable("$SDLMask::HatRight", SDL_HAT_RIGHT); |
| 195 | Con::setIntVariable("$SDLMask::HatDown", SDL_HAT_DOWN); |
| 196 | Con::setIntVariable("$SDLMask::HatLeft", SDL_HAT_LEFT); |
| 197 | } |
| 198 | |
| 199 | //------------------------------------------------------------------------------ |
| 200 | bool SDLInputManager::enable() |
nothing calls this directly
no test coverage detected