Perform refactoring of pads to remove the ugly pad initialization.

This commit is contained in:
Robbie 2017-07-12 09:07:40 -05:00 committed by Ivan
parent b01e7e3362
commit d1cde4d0a7
8 changed files with 127 additions and 53 deletions

View file

@ -5,8 +5,8 @@
#include "stdafx.h"
#include "Emu/System.h"
#include <QWindow>
#include <QKeyEvent>
#include <QObject>
struct keyboard_pad_config final : cfg::node
{
@ -58,13 +58,14 @@ class keyboard_pad_handler final : public QObject, public PadHandlerBase
public:
virtual void Init(const u32 max_connect) override;
keyboard_pad_handler(QObject* target, QObject* parent);
keyboard_pad_handler();
void SetTargetWindow(QWindow* target);
void keyPressEvent(QKeyEvent* event);
void keyReleaseEvent(QKeyEvent* event);
void LoadSettings();
bool eventFilter(QObject* obj, QEvent* ev);
private:
QObject* m_target;
QWindow* m_target = nullptr;
};