Files
eden/src/yuzu/debugger/controller.h
T

57 lines
1.4 KiB
C++
Raw Normal View History

2022-05-15 02:06:02 +02:00
// SPDX-FileCopyrightText: 2015 Citra Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <QWidget>
class QAction;
class QHideEvent;
class QShowEvent;
2021-02-04 08:54:27 -06:00
class PlayerControlPreview;
2021-10-30 20:16:10 -05:00
namespace InputCommon {
class InputSubsystem;
}
namespace Core::HID {
class HIDCore;
2021-10-30 20:16:10 -05:00
class EmulatedController;
2021-11-01 14:17:53 -06:00
enum class ControllerTriggerType;
} // namespace Core::HID
class ControllerDialog : public QWidget {
Q_OBJECT
public:
explicit ControllerDialog(Core::HID::HIDCore& hid_core_,
2021-10-30 20:16:10 -05:00
std::shared_ptr<InputCommon::InputSubsystem> input_subsystem_,
QWidget* parent = nullptr);
/// Returns a QAction that can be used to toggle visibility of this dialog.
QAction* toggleViewAction();
2021-10-30 20:16:10 -05:00
/// Reloads the widget to apply any changes in the configuration
void refreshConfiguration();
/// Disables events from the emulated controller
void UnloadController();
protected:
void showEvent(QShowEvent* ev) override;
void hideEvent(QHideEvent* ev) override;
private:
2021-10-30 20:16:10 -05:00
/// Redirects input from the widget to the TAS driver
void ControllerUpdate(Core::HID::ControllerTriggerType type);
int callback_key;
bool is_controller_set{};
Core::HID::EmulatedController* controller;
QAction* toggle_view_action = nullptr;
2021-02-04 08:54:27 -06:00
PlayerControlPreview* widget;
Core::HID::HIDCore& hid_core;
2021-10-30 20:16:10 -05:00
std::shared_ptr<InputCommon::InputSubsystem> input_subsystem;
};