Controller Remapping GUI v2 (#3144)

* Remapping GUI V2 - initial commit

* Unmap button with escape key

* Allow combination inputs

* Use separate class for SDL event signals so that i can work with the SDL window event loop

* Automatically pause game when GUI open to better manage event queue

* Move sd;_gamepad_added event from remap object to GUI object to avoid conflicts with sdl window

* Use signals on button/trigger to release to make GUI more responsive

* pause game while KBM window is open for consistency

* don't check gamepad when game is running to avoid conflicts

* Block all other sdl events instead of pausing game, automatic parse inputs after saving

* Don't block window restored or window exposed cases

* Properly exit event loop thread on exit
This commit is contained in:
rainmakerv2
2025-06-27 21:55:52 +08:00
committed by GitHub
parent 09b584b23f
commit fa32537f40
11 changed files with 1194 additions and 601 deletions

View File

@@ -473,12 +473,13 @@ void MainWindow::CreateConnects() {
});
connect(ui->controllerButton, &QPushButton::clicked, this, [this]() {
auto configWindow = new ControlSettings(m_game_info, this);
configWindow->exec();
ControlSettings* remapWindow =
new ControlSettings(m_game_info, isGameRunning, runningGameSerial, this);
remapWindow->exec();
});
connect(ui->keyboardButton, &QPushButton::clicked, this, [this]() {
auto kbmWindow = new KBMSettings(m_game_info, this);
auto kbmWindow = new KBMSettings(m_game_info, isGameRunning, runningGameSerial, this);
kbmWindow->exec();
});
@@ -846,12 +847,14 @@ void MainWindow::StartGame() {
if (m_game_list_frame->currentItem()) {
int itemID = m_game_list_frame->currentItem()->row();
Common::FS::PathToQString(gamePath, m_game_info->m_games[itemID].path / "eboot.bin");
runningGameSerial = m_game_info->m_games[itemID].serial;
}
} else if (table_mode == 1) {
if (m_game_grid_frame->cellClicked) {
int itemID = (m_game_grid_frame->crtRow * m_game_grid_frame->columnCnt) +
m_game_grid_frame->crtColumn;
Common::FS::PathToQString(gamePath, m_game_info->m_games[itemID].path / "eboot.bin");
runningGameSerial = m_game_info->m_games[itemID].serial;
}
} else {
if (m_elf_viewer->currentItem()) {