applets/web: Fix keyboard to emulated controller input

This commit is contained in:
Morph 2020-11-30 22:25:01 -05:00
parent 358b38f3e1
commit 150d237919
3 changed files with 30 additions and 4 deletions

View file

@ -26,6 +26,10 @@ namespace Core {
class System;
}
namespace InputCommon {
class InputSubsystem;
}
#ifdef YUZU_USE_QT_WEB_ENGINE
enum class UserAgent {
@ -41,7 +45,8 @@ class QtNXWebEngineView : public QWebEngineView {
Q_OBJECT
public:
explicit QtNXWebEngineView(QWidget* parent, Core::System& system);
explicit QtNXWebEngineView(QWidget* parent, Core::System& system,
InputCommon::InputSubsystem* input_subsystem_);
~QtNXWebEngineView() override;
/**
@ -86,6 +91,10 @@ public:
public slots:
void hide();
protected:
void keyPressEvent(QKeyEvent* event) override;
void keyReleaseEvent(QKeyEvent* event) override;
private:
/**
* Handles button presses to execute functions assigned in yuzu_key_callbacks.
@ -138,6 +147,8 @@ private:
/// The thread where input is being polled and processed.
void InputThread();
InputCommon::InputSubsystem* input_subsystem;
std::unique_ptr<UrlRequestInterceptor> url_interceptor;
std::unique_ptr<InputInterpreter> input_interpreter;