Multiple controllers: Select active controller and set default controller (#3169)

* initial commit - not cleanup yet, not usable with imGUI

* Ugly solution to working with ImGUI

* Populate the default controller labels

* Add remove default button

* missing tr calls

* edit imgui flag after updating

* Refactor

* Update sirit
This commit is contained in:
rainmakerv2
2025-07-31 02:37:45 +08:00
committed by GitHub
parent 35132d9fdc
commit c924c20575
10 changed files with 515 additions and 255 deletions

View File

@@ -1,6 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <QDialog>
#include <SDL3/SDL.h>
#include <SDL3/SDL_gamepad.h>
@@ -29,6 +29,7 @@ private Q_SLOTS:
void CheckMapping(QPushButton*& button);
void StartTimer(QPushButton*& button, bool isButton);
void ConnectAxisInputs(QPushButton*& button);
void ActiveControllerChanged(int value);
private:
std::unique_ptr<Ui::ControlSettings> ui;
@@ -59,9 +60,11 @@ private:
bool MappingCompleted = false;
QString mapping;
int MappingTimer;
int gamepad_count;
QTimer* timer;
QPushButton* MappingButton;
SDL_Gamepad* gamepad = nullptr;
SDL_JoystickID* gamepads;
SdlEventWrapper::Wrapper* RemapWrapper;
QFuture<void> Polling;