From 1ee68ad12a4f20504797629ddf89837ba6aa87f6 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Wed, 18 Mar 2020 22:28:03 +1000 Subject: [PATCH] CommonHostInterface: Add Screenshot hotkey --- src/frontend-common/common_host_interface.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/frontend-common/common_host_interface.cpp b/src/frontend-common/common_host_interface.cpp index 8d4be880e..50040e752 100644 --- a/src/frontend-common/common_host_interface.cpp +++ b/src/frontend-common/common_host_interface.cpp @@ -84,9 +84,10 @@ void CommonHostInterface::SetDefaultSettings(SettingsInterface& si) si.SetStringValue("Controller1", "ButtonR1", "Keyboard/E"); si.SetStringValue("Controller1", "ButtonR2", "Keyboard/3"); si.SetStringValue("Hotkeys", "FastForward", "Keyboard/Tab"); - si.SetStringValue("Hotkeys", "PowerOff", "Keyboard/Escape"); si.SetStringValue("Hotkeys", "TogglePause", "Keyboard/Pause"); si.SetStringValue("Hotkeys", "ToggleFullscreen", "Keyboard/Alt+Return"); + si.SetStringValue("Hotkeys", "PowerOff", "Keyboard/Escape"); + si.SetStringValue("Hotkeys", "Screenshot", "Keyboard/F10"); si.SetStringValue("Hotkeys", "IncreaseResolutionScale", "Keyboard/PageUp"); si.SetStringValue("Hotkeys", "DecreaseResolutionScale", "Keyboard/PageDown"); si.SetStringValue("Hotkeys", "ToggleSoftwareRendering", "Keyboard/End"); @@ -351,6 +352,12 @@ void CommonHostInterface::RegisterGeneralHotkeys() PowerOffSystem(); } }); + + RegisterHotkey(StaticString("General"), StaticString("Screenshot"), StaticString("Save Screenshot"), + [this](bool pressed) { + if (!pressed && m_system) + SaveScreenshot(); + }); } void CommonHostInterface::RegisterGraphicsHotkeys()