mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-04-19 19:14:48 +00:00
Qt: Add Initial KBM remapping GUI (#2544)
* Initial KBM remapping GUI * Added Mousewheel mapping * Make window wider so for mousewheel + modifier string * Fix alt + mousewheel vertical being changed to horizontal for qwidgets --------- Co-authored-by: rainmakerv2 <30595646+jpau02@users.noreply.github.com>
This commit is contained in:
parent
517d7f04c6
commit
c2adaf41c0
8 changed files with 2818 additions and 4 deletions
|
@ -917,6 +917,9 @@ set(QT_GUI src/qt_gui/about_dialog.cpp
|
|||
src/qt_gui/control_settings.cpp
|
||||
src/qt_gui/control_settings.h
|
||||
src/qt_gui/control_settings.ui
|
||||
src/qt_gui/kbm_gui.cpp
|
||||
src/qt_gui/kbm_gui.h
|
||||
src/qt_gui/kbm_gui.ui
|
||||
src/qt_gui/main_window_ui.h
|
||||
src/qt_gui/main_window.cpp
|
||||
src/qt_gui/main_window.h
|
||||
|
|
|
@ -41,6 +41,7 @@ path = [
|
|||
"src/images/grid_icon.png",
|
||||
"src/images/keyboard_icon.png",
|
||||
"src/images/iconsize_icon.png",
|
||||
"src/images/KBM.png",
|
||||
"src/images/ko-fi.png",
|
||||
"src/images/list_icon.png",
|
||||
"src/images/list_mode_icon.png",
|
||||
|
|
BIN
src/images/KBM.png
Normal file
BIN
src/images/KBM.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 236 KiB |
1047
src/qt_gui/kbm_gui.cpp
Normal file
1047
src/qt_gui/kbm_gui.cpp
Normal file
File diff suppressed because it is too large
Load diff
56
src/qt_gui/kbm_gui.h
Normal file
56
src/qt_gui/kbm_gui.h
Normal file
|
@ -0,0 +1,56 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <QDialog>
|
||||
#include "game_info.h"
|
||||
|
||||
namespace Ui {
|
||||
class KBMSettings;
|
||||
}
|
||||
|
||||
class KBMSettings : public QDialog {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit KBMSettings(std::shared_ptr<GameInfoClass> game_info_get, QWidget* parent = nullptr);
|
||||
~KBMSettings();
|
||||
|
||||
private Q_SLOTS:
|
||||
void SaveKBMConfig(bool CloseOnSave);
|
||||
void SetDefault();
|
||||
void CheckMapping(QPushButton*& button);
|
||||
void StartTimer(QPushButton*& button);
|
||||
void onHelpClicked();
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui::KBMSettings> ui;
|
||||
std::shared_ptr<GameInfoClass> m_game_info;
|
||||
|
||||
bool eventFilter(QObject* obj, QEvent* event) override;
|
||||
void ButtonConnects();
|
||||
void SetUIValuestoMappings(std::string config_id);
|
||||
void GetGameTitle();
|
||||
void DisableMappingButtons();
|
||||
void EnableMappingButtons();
|
||||
void SetMapping(QString input);
|
||||
|
||||
bool EnableMapping = false;
|
||||
bool MappingCompleted = false;
|
||||
bool HelpWindowOpen = false;
|
||||
QString mapping;
|
||||
QString modifier;
|
||||
int MappingTimer;
|
||||
QTimer* timer;
|
||||
QPushButton* MappingButton;
|
||||
QList<QPushButton*> ButtonsList;
|
||||
|
||||
const std::vector<std::string> ControllerInputs = {
|
||||
"cross", "circle", "square", "triangle", "l1",
|
||||
"r1", "l2", "r2", "l3",
|
||||
|
||||
"r3", "options", "pad_up",
|
||||
|
||||
"pad_down",
|
||||
|
||||
"pad_left", "pad_right", "axis_left_x", "axis_left_y", "axis_right_x",
|
||||
"axis_right_y", "back"};
|
||||
};
|
1708
src/qt_gui/kbm_gui.ui
Normal file
1708
src/qt_gui/kbm_gui.ui
Normal file
File diff suppressed because it is too large
Load diff
|
@ -21,11 +21,10 @@
|
|||
#include "core/loader.h"
|
||||
#include "game_install_dialog.h"
|
||||
#include "install_dir_select.h"
|
||||
#include "kbm_gui.h"
|
||||
#include "main_window.h"
|
||||
#include "settings_dialog.h"
|
||||
|
||||
#include "kbm_config_dialog.h"
|
||||
|
||||
#include "video_core/renderer_vulkan/vk_instance.h"
|
||||
#ifdef ENABLE_DISCORD_RPC
|
||||
#include "common/discord_rpc_handler.h"
|
||||
|
@ -348,14 +347,13 @@ void MainWindow::CreateConnects() {
|
|||
settingsDialog->exec();
|
||||
});
|
||||
|
||||
// this is the editor for kbm keybinds
|
||||
connect(ui->controllerButton, &QPushButton::clicked, this, [this]() {
|
||||
auto configWindow = new ControlSettings(m_game_info, this);
|
||||
configWindow->exec();
|
||||
});
|
||||
|
||||
connect(ui->keyboardButton, &QPushButton::clicked, this, [this]() {
|
||||
auto kbmWindow = new EditorDialog(this);
|
||||
auto kbmWindow = new KBMSettings(m_game_info, this);
|
||||
kbmWindow->exec();
|
||||
});
|
||||
|
||||
|
|
|
@ -32,5 +32,6 @@
|
|||
<file>images/website.png</file>
|
||||
<file>images/ps4_controller.png</file>
|
||||
<file>images/keyboard_icon.png</file>
|
||||
<file>images/KBM.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
Loading…
Add table
Reference in a new issue