| 242 | } |
| 243 | |
| 244 | QString GameController::getBindStringForButton(int index, bool trueIndex) |
| 245 | { |
| 246 | QString temp = QString(); |
| 247 | |
| 248 | SDL_GameControllerButtonBind bind = |
| 249 | SDL_GameControllerGetBindForButton(controller, static_cast<SDL_GameControllerButton>(index)); |
| 250 | |
| 251 | int offset = trueIndex ? 0 : 1; |
| 252 | int bindInt = static_cast<int>(bind.bindType); |
| 253 | |
| 254 | switch (bindInt) |
| 255 | { |
| 256 | case SDL_CONTROLLER_BINDTYPE_BUTTON: |
| 257 | temp.append(QString("Button %1").arg(bind.value.button + offset)); |
| 258 | break; |
| 259 | |
| 260 | case SDL_CONTROLLER_BINDTYPE_AXIS: |
| 261 | temp.append(QString("Axis %1").arg(bind.value.axis + offset)); |
| 262 | break; |
| 263 | |
| 264 | case SDL_CONTROLLER_BINDTYPE_HAT: |
| 265 | temp.append(QString("Hat %1.%2").arg(bind.value.hat.hat + offset).arg(bind.value.hat.hat_mask)); |
| 266 | break; |
| 267 | } |
| 268 | |
| 269 | return temp; |
| 270 | } |
| 271 | |
| 272 | SDL_GameControllerButtonBind GameController::getBindForAxis(int index) |
| 273 | { |
nothing calls this directly
no outgoing calls
no test coverage detected