FullscreenUI: Re-enable most previously-missing settings
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "common/assert.h"
|
||||
#include "common/bitutils.h"
|
||||
#include "common/log.h"
|
||||
#include "frontend-common/imgui_manager.h"
|
||||
#include "mainwindow.h"
|
||||
#include "qthost.h"
|
||||
#include "qtutils.h"
|
||||
@@ -205,6 +206,14 @@ bool DisplayWidget::event(QEvent* event)
|
||||
case QEvent::KeyRelease:
|
||||
{
|
||||
const QKeyEvent* key_event = static_cast<QKeyEvent*>(event);
|
||||
|
||||
if (ImGuiManager::WantsTextInput() && key_event->type() == QEvent::KeyPress)
|
||||
{
|
||||
const QString text(key_event->text());
|
||||
if (!text.isEmpty())
|
||||
emit windowTextEntered(text);
|
||||
}
|
||||
|
||||
if (key_event->isAutoRepeat())
|
||||
return true;
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ Q_SIGNALS:
|
||||
void windowResizedEvent(int width, int height, float scale);
|
||||
void windowRestoredEvent();
|
||||
void windowKeyEvent(int key_code, bool pressed);
|
||||
void windowTextEntered(const QString& text);
|
||||
void windowMouseMoveEvent(bool relative, float x, float y);
|
||||
void windowMouseButtonEvent(int button, bool pressed);
|
||||
void windowMouseWheelEvent(const QPoint& angle_delta);
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <QtCore/QEventLoop>
|
||||
#include <QtCore/QFile>
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtGui/QClipboard>
|
||||
#include <QtGui/QKeyEvent>
|
||||
#include <QtWidgets/QFileDialog>
|
||||
#include <QtWidgets/QMenu>
|
||||
@@ -541,6 +542,13 @@ void EmuThread::onDisplayWindowKeyEvent(int key, bool pressed)
|
||||
GenericInputBinding::Unknown);
|
||||
}
|
||||
|
||||
void EmuThread::onDisplayWindowTextEntered(const QString& text)
|
||||
{
|
||||
DebugAssert(isOnThread());
|
||||
|
||||
ImGuiManager::AddTextInput(text.toStdString());
|
||||
}
|
||||
|
||||
void EmuThread::onDisplayWindowMouseMoveEvent(bool relative, float x, float y)
|
||||
{
|
||||
// display might be null here if the event happened after shutdown
|
||||
@@ -763,6 +771,7 @@ void EmuThread::connectDisplaySignals(DisplayWidget* widget)
|
||||
connect(widget, &DisplayWidget::windowResizedEvent, this, &EmuThread::onDisplayWindowResized);
|
||||
connect(widget, &DisplayWidget::windowRestoredEvent, this, &EmuThread::redrawDisplayWindow);
|
||||
connect(widget, &DisplayWidget::windowKeyEvent, this, &EmuThread::onDisplayWindowKeyEvent);
|
||||
connect(widget, &DisplayWidget::windowTextEntered, this, &EmuThread::onDisplayWindowTextEntered);
|
||||
connect(widget, &DisplayWidget::windowMouseMoveEvent, this, &EmuThread::onDisplayWindowMouseMoveEvent);
|
||||
connect(widget, &DisplayWidget::windowMouseButtonEvent, this, &EmuThread::onDisplayWindowMouseButtonEvent);
|
||||
connect(widget, &DisplayWidget::windowMouseWheelEvent, this, &EmuThread::onDisplayWindowMouseWheelEvent);
|
||||
@@ -1489,6 +1498,21 @@ bool Host::ConfirmMessage(const std::string_view& title, const std::string_view&
|
||||
QString::fromUtf8(message.data(), message.size()));
|
||||
}
|
||||
|
||||
void Host::OpenURL(const std::string_view& url)
|
||||
{
|
||||
QtHost::RunOnUIThread([url = QtUtils::StringViewToQString(url)]() { QtUtils::OpenURL(g_main_window, QUrl(url)); });
|
||||
}
|
||||
|
||||
bool Host::CopyTextToClipboard(const std::string_view& text)
|
||||
{
|
||||
QtHost::RunOnUIThread([text = QtUtils::StringViewToQString(text)]() {
|
||||
QClipboard* clipboard = QGuiApplication::clipboard();
|
||||
if (clipboard)
|
||||
clipboard->setText(text);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
void Host::ReportDebuggerMessage(const std::string_view& message)
|
||||
{
|
||||
emit g_emu_thread->debuggerMessageReported(QString::fromUtf8(message));
|
||||
|
||||
@@ -190,6 +190,7 @@ private Q_SLOTS:
|
||||
void onDisplayWindowMouseWheelEvent(const QPoint& delta_angle);
|
||||
void onDisplayWindowResized(int width, int height);
|
||||
void onDisplayWindowKeyEvent(int key, bool pressed);
|
||||
void onDisplayWindowTextEntered(const QString& text);
|
||||
void doBackgroundControllerPoll();
|
||||
void runOnEmuThread(std::function<void()> callback);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user