This commit is contained in:
OBattler
2022-10-30 16:45:03 +01:00
4 changed files with 31 additions and 20 deletions

View File

@@ -1999,7 +1999,7 @@ const machine_t machines[] = {
.max = 640, .max = 640,
.step = 128 .step = 128
}, },
.nvrmask = 0, .nvrmask = 15,
.kbc = KBC_OLIVETTI_XT, .kbc = KBC_OLIVETTI_XT,
.kbc_p1 = 0xff00, .kbc_p1 = 0xff00,
.gpio = 0xffffffff, .gpio = 0xffffffff,

View File

@@ -1005,17 +1005,17 @@ std::array<uint32_t, 256> x11_to_xt_2
0x51, 0x51,
0x52, 0x52,
0x53, 0x53,
0x54, 0x138,
0x55, 0x55,
0x56, 0x35,
0x57, 0x57,
0x58, 0x58,
0, 0x56,
0, 0x70,
0, 0x7B,
0, 0x7D,
0, 0x2B,
0, 0x7E,
0, 0,
0x11C, 0x11C,
0x11D, 0x11D,
@@ -1032,7 +1032,23 @@ std::array<uint32_t, 256> x11_to_xt_2
0x150, 0x150,
0x151, 0x151,
0x152, 0x152,
0x153 0x153,
0,
0, /* Mute */
0, /* Volume Down */
0, /* Volume Up */
0, /* Power Off */
0,
0,
0,
0,
0,
0x70,
0x7B,
0x73,
0x15B,
0x15C,
0x15D
}; };
std::array<uint32_t, 256> x11_to_xt_vnc std::array<uint32_t, 256> x11_to_xt_vnc
@@ -1627,8 +1643,6 @@ void MainWindow::keyPressEvent(QKeyEvent* event)
keyboard_input(1, 0x1D); keyboard_input(1, 0x1D);
keyboard_input(1, 0x45); keyboard_input(1, 0x45);
} }
} else if (event->key() == Qt::Key_Super_L || event->key() == Qt::Key_Super_R) {
keyboard_input(1, event->key() == Qt::Key_Super_L ? 0x15B : 0x15C);
} else } else
#ifdef Q_OS_MACOS #ifdef Q_OS_MACOS
processMacKeyboardInput(true, event); processMacKeyboardInput(true, event);
@@ -1672,9 +1686,6 @@ void MainWindow::keyReleaseEvent(QKeyEvent* event)
if (!send_keyboard_input) if (!send_keyboard_input)
return; return;
if (event->key() == Qt::Key_Super_L || event->key() == Qt::Key_Super_R) {
keyboard_input(0, event->key() == Qt::Key_Super_L ? 0x15B : 0x15C);
} else
#ifdef Q_OS_MACOS #ifdef Q_OS_MACOS
processMacKeyboardInput(false, event); processMacKeyboardInput(false, event);
#else #else
@@ -2052,9 +2063,9 @@ void MainWindow::setSendKeyboardInput(bool enabled)
send_keyboard_input = enabled; send_keyboard_input = enabled;
} }
void MainWindow::setUiPauseState(bool paused) { void MainWindow::updateUiPauseState() {
auto pause_icon = paused ? QIcon(":/menuicons/win/icons/run.ico") : QIcon(":/menuicons/win/icons/pause.ico"); auto pause_icon = dopause ? QIcon(":/menuicons/win/icons/run.ico") : QIcon(":/menuicons/win/icons/pause.ico");
auto tooltip_text = paused ? QString(tr("Resume execution")) : QString(tr("Pause execution")); auto tooltip_text = dopause ? QString(tr("Resume execution")) : QString(tr("Pause execution"));
ui->actionPause->setIcon(pause_icon); ui->actionPause->setIcon(pause_icon);
ui->actionPause->setToolTip(tooltip_text); ui->actionPause->setToolTip(tooltip_text);
} }

View File

@@ -33,7 +33,6 @@ public:
void blitToWidget(int x, int y, int w, int h, int monitor_index); void blitToWidget(int x, int y, int w, int h, int monitor_index);
QSize getRenderWidgetSize(); QSize getRenderWidgetSize();
void setSendKeyboardInput(bool enabled); void setSendKeyboardInput(bool enabled);
void setUiPauseState(bool paused);
std::array<std::unique_ptr<RendererStack>, 8> renderers; std::array<std::unique_ptr<RendererStack>, 8> renderers;
signals: signals:
@@ -65,6 +64,7 @@ public slots:
void togglePause(); void togglePause();
void initRendererMonitorSlot(int monitor_index); void initRendererMonitorSlot(int monitor_index);
void destroyRendererMonitorSlot(int monitor_index); void destroyRendererMonitorSlot(int monitor_index);
void updateUiPauseState();
private slots: private slots:
void on_actionFullscreen_triggered(); void on_actionFullscreen_triggered();
void on_actionSettings_triggered(); void on_actionSettings_triggered();

View File

@@ -366,7 +366,7 @@ plat_pause(int p)
ui_window_title(oldtitle); ui_window_title(oldtitle);
} }
discord_update_activity(dopause); discord_update_activity(dopause);
main_window->setUiPauseState(p); QTimer::singleShot(0, main_window, &MainWindow::updateUiPauseState);
#ifdef Q_OS_WINDOWS #ifdef Q_OS_WINDOWS
if (source_hwnd) if (source_hwnd)