mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-12 04:35:56 +00:00
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / windows-qt (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / macos-qt (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-qt (push) Has been cancelled
Build and Release / linux-sdl-gcc (push) Has been cancelled
Build and Release / linux-qt-gcc (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled
* 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
25 lines
564 B
C++
25 lines
564 B
C++
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#pragma once
|
|
#include <QObject>
|
|
#include <SDL3/SDL_events.h>
|
|
|
|
namespace SdlEventWrapper {
|
|
|
|
class Wrapper : public QObject {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit Wrapper(QObject* parent = nullptr);
|
|
~Wrapper();
|
|
bool ProcessEvent(SDL_Event* event);
|
|
static Wrapper* GetInstance();
|
|
static bool wrapperActive;
|
|
static Wrapper* WrapperInstance;
|
|
|
|
signals:
|
|
void SDLEvent(int Type, int Input, int Value);
|
|
};
|
|
|
|
} // namespace SdlEventWrapper
|