Qt: Add some more default hotkeys (fullscreen/pause/poweroff)

Along with the previous commit, fixes #32
This commit is contained in:
Connor McLaughlin 2020-02-26 19:27:23 +10:00
parent e4ff8b0936
commit 509f26ad7e

View file

@ -79,6 +79,10 @@ void QtHostInterface::setDefaultSettings()
m_qsettings.setValue(QStringLiteral("Controller1/ButtonL2"), QStringLiteral("Keyboard/1")); m_qsettings.setValue(QStringLiteral("Controller1/ButtonL2"), QStringLiteral("Keyboard/1"));
m_qsettings.setValue(QStringLiteral("Controller1/ButtonR1"), QStringLiteral("Keyboard/E")); m_qsettings.setValue(QStringLiteral("Controller1/ButtonR1"), QStringLiteral("Keyboard/E"));
m_qsettings.setValue(QStringLiteral("Controller1/ButtonR2"), QStringLiteral("Keyboard/3")); m_qsettings.setValue(QStringLiteral("Controller1/ButtonR2"), QStringLiteral("Keyboard/3"));
m_qsettings.setValue(QStringLiteral("Hotkeys/FastForward"), QStringLiteral("Keyboard/Tab"));
m_qsettings.setValue(QStringLiteral("Hotkeys/PowerOff"), QStringLiteral("Keyboard/Escape"));
m_qsettings.setValue(QStringLiteral("Hotkeys/TogglePause"), QStringLiteral("Keyboard/Pause"));
m_qsettings.setValue(QStringLiteral("Hotkeys/ToggleFullscreen"), QStringLiteral("Keyboard/Alt+Return"));
updateQSettingsFromCoreSettings(); updateQSettingsFromCoreSettings();
} }
@ -431,8 +435,8 @@ std::vector<QtHostInterface::HotkeyInfo> QtHostInterface::getHotkeyList() const
{ {
std::vector<HotkeyInfo> hotkeys = { std::vector<HotkeyInfo> hotkeys = {
{QStringLiteral("FastForward"), QStringLiteral("Toggle Fast Forward"), QStringLiteral("General")}, {QStringLiteral("FastForward"), QStringLiteral("Toggle Fast Forward"), QStringLiteral("General")},
{QStringLiteral("Fullscreen"), QStringLiteral("Toggle Fullscreen"), QStringLiteral("General")}, {QStringLiteral("ToggleFullscreen"), QStringLiteral("Toggle Fullscreen"), QStringLiteral("General")},
{QStringLiteral("Pause"), QStringLiteral("Toggle Pause"), QStringLiteral("General")}, {QStringLiteral("TogglePause"), QStringLiteral("Toggle Pause"), QStringLiteral("General")},
{QStringLiteral("PowerOff"), QStringLiteral("Power Off System"), QStringLiteral("General")}, {QStringLiteral("PowerOff"), QStringLiteral("Power Off System"), QStringLiteral("General")},
{QStringLiteral("ToggleSoftwareRendering"), QStringLiteral("Toggle Software Rendering"), {QStringLiteral("ToggleSoftwareRendering"), QStringLiteral("Toggle Software Rendering"),
QStringLiteral("Graphics")}, QStringLiteral("Graphics")},
@ -477,12 +481,12 @@ void QtHostInterface::updateHotkeyInputMap()
HostInterface::UpdateSpeedLimiterState(); HostInterface::UpdateSpeedLimiterState();
}); });
hk(QStringLiteral("Fullscreen"), [this](bool pressed) { hk(QStringLiteral("ToggleFullscreen"), [this](bool pressed) {
if (!pressed) if (!pressed)
emit toggleFullscreenRequested(); emit toggleFullscreenRequested();
}); });
hk(QStringLiteral("Pause"), [this](bool pressed) { hk(QStringLiteral("TogglePause"), [this](bool pressed) {
if (!pressed) if (!pressed)
pauseSystem(!m_paused); pauseSystem(!m_paused);
}); });