diff --git a/bin/PCSX2_keys.ini.default b/bin/PCSX2_keys.ini.default index c4709b3c69..00ba3836be 100644 --- a/bin/PCSX2_keys.ini.default +++ b/bin/PCSX2_keys.ini.default @@ -48,10 +48,9 @@ FullscreenToggle = Alt-ENTER Sys_Suspend = ESC -# PCSX2 binds F8, shift-F8 and ctrl-shift-f8 to Sys_TakeSnapshot. -# This ini file supports only one key per function, so if you override -# it then it will override all 3 original bindings (and show some warnings). -# Sys_TakeSnapshot = F8 +# Screenshot. Note: must not include shift or ctrl. With these held - it will +# create debug GS dump. The two other shortcuts will be added automatically. +Sys_TakeSnapshot = F8 # Hardware/software rendering toggle Sys_RenderswitchToggle = F9 diff --git a/pcsx2/gui/FrameForGS.cpp b/pcsx2/gui/FrameForGS.cpp index 00f147dcde..8e52c0aa10 100644 --- a/pcsx2/gui/FrameForGS.cpp +++ b/pcsx2/gui/FrameForGS.cpp @@ -67,9 +67,7 @@ void GSPanel::InitDefaultAccelerators() m_Accels->Map( AAC( WXK_NUMPAD_DIVIDE ).Cmd().Alt(), "GSwindow_OffsetReset" ); m_Accels->Map( AAC( WXK_ESCAPE ), "Sys_Suspend" ); - m_Accels->Map( AAC( WXK_F8 ), "Sys_TakeSnapshot" ); - m_Accels->Map( AAC( WXK_F8 ).Shift(), "Sys_TakeSnapshot"); - m_Accels->Map( AAC( WXK_F8 ).Shift().Cmd(), "Sys_TakeSnapshot"); + m_Accels->Map( AAC( WXK_F8 ), "Sys_TakeSnapshot" ); // also shift and ctrl-shift will be added automatically m_Accels->Map( AAC( WXK_F9 ), "Sys_RenderswitchToggle"); m_Accels->Map( AAC( WXK_F10 ), "Sys_LoggingToggle" ); diff --git a/pcsx2/gui/GlobalCommands.cpp b/pcsx2/gui/GlobalCommands.cpp index e7ff948a33..551ec38bf0 100644 --- a/pcsx2/gui/GlobalCommands.cpp +++ b/pcsx2/gui/GlobalCommands.cpp @@ -661,7 +661,39 @@ void AcceleratorDictionary::Map( const KeyAcceleratorCode& _acode, const char *s } else { - operator[](acode.val32) = result; + if (!strcmp("Sys_TakeSnapshot", searchfor)) { + // Sys_TakeSnapshot is special in a bad way. On its own it creates a screenshot + // but GSdx also checks whether shift or ctrl are held down, and for each of + // them it does a different thing (gs dumps). So we need to map a shortcut and + // also the same shortcut with shift and the same with ctrl to the same function. + // So make sure the shortcut doesn't include shift or ctrl, and then add two more + // which are derived from it. + // Also, looking at the GSdx code, it seems that it never cares about both shift + // and ctrl held together, but PCSX2 traditionally mapped f8, shift-f8 and ctrl-shift-f8 + // to Sys_TakeSnapshot, so let's not change it - we'll keep adding only shift and + // ctrl-shift to the base shortcut. + if (acode.cmd || acode.shift) { + Console.Error(L"Cannot map %s to Sys_TakeSnapshot - must not include Shift or Ctrl - these modifiers will be added automatically.", + WX_STR(acode.ToString())); + } + else { + KeyAcceleratorCode shifted(acode); shifted.Shift(); + KeyAcceleratorCode controlledShifted(shifted); controlledShifted.Cmd(); + operator[](acode.val32) = result; + operator[](shifted.val32) = result; + operator[](controlledShifted.val32) = result; + + if (_acode.val32 != acode.val32) { // overriding default + Console.WriteLn(Color_Green, L"Sys_TakeSnapshot: automatically mapping also %s and %s", + WX_STR(shifted.ToString()), + WX_STR(controlledShifted.ToString()) + ); + } + } + } + else { + operator[](acode.val32) = result; + } } }