Qt: Recalibrate axes in more places

This commit is contained in:
Jeffrey Pfau 2015-04-18 01:10:50 -07:00
parent 6750e7775e
commit a0a3ac191a
4 changed files with 10 additions and 1 deletions

View File

@ -62,7 +62,6 @@ GBAKeyEditor::GBAKeyEditor(InputController* controller, int type, const QString&
m_controller->setGamepad(m_type, i);
m_profile = m_profileSelect->currentText();
m_controller->loadProfile(m_type, m_profile);
m_controller->recalibrateAxes();
refresh();
});
}

View File

@ -273,6 +273,10 @@ void GameController::openGame() {
m_threadContext.patch = VFileOpen(m_patch.toLocal8Bit().constData(), O_RDONLY);
}
#ifdef BUILD_SDL
m_inputController->recalibrateAxes();
#endif
if (!GBAThreadStart(&m_threadContext)) {
m_gameOpen = false;
emit gameFailed();

View File

@ -94,6 +94,9 @@ void InputController::loadConfiguration(uint32_t type) {
void InputController::loadProfile(uint32_t type, const QString& profile) {
GBAInputProfileLoad(&m_inputMap, type, m_config->input(), profile.toLocal8Bit().constData());
#ifdef BUILD_SDL
recalibrateAxes();
#endif
}
void InputController::saveConfiguration(uint32_t type) {

View File

@ -298,6 +298,9 @@ void Window::openSettingsWindow() {
}
void Window::openShortcutWindow() {
#ifdef BUILD_SDL
m_inputController.recalibrateAxes();
#endif
ShortcutView* shortcutView = new ShortcutView();
shortcutView->setController(m_shortcutController);
openView(shortcutView);