kb shortcuts customization: improve messages, add sample PCSX2_keys.ini

- don't display a message if the replacement is the same as the default.
- display a message if the key combination is unknown
- (same as before) display a message when replacing a shortcut
- also added PCSX2_keys.ini.default sample file with some help
This commit is contained in:
Avi Halachmi (:avih) 2014-12-30 22:08:59 +02:00
parent c4bd50c04c
commit 25382d471d
2 changed files with 92 additions and 5 deletions

80
bin/PCSX2_keys.ini Normal file
View File

@ -0,0 +1,80 @@
# IMPORTANT: PCSX2 only looks for PCSX2_keys.ini at the inis folder.
# You should first copy PCSX2_keys.ini.default to the inis folder, then
# rename it to PCSX2_keys.ini, and then edit it.
# Important: keys which are defined at the input plugin (LilyPad) will override
# shortcuts at this file.
# IMPORTANT: GSdx has fixed shortcuts. Make sure your shortcuts don't conflict.
# Also, they will affect GSdx also when alt/ctrl/shift are pressed, so it's
# best to completely avoid them at this file. GSdx uses:
# F5 - Deinterlace modes
# F7 - Internal "TV-like" shaders
# PAGE_UP - FXAA antialiasing (HW and SW)
# DELETE - Software Antialiasing (AA1)
# HOME - FX shader
# INSERT - Software mipmapping
# Note: some "normal" keys may not display correctly at the log console message
# but still work correctly (e.g. ']').
# -----------------------------------------------------------------------------
# The KB shortcuts can be a normal key (e.g. f or ] etc) or a combination of
# ALT/SHIFT/CTRL and a key, separated with a - (e.g. m or alt-m or alt-ctrl-m).
# Number (key) pad names start with KP_ (e.g. KP_0 to KP_9, KP_ADD, etc)
# List of special key names (beyond KP_0 to KP_9 and normal keys):
# DEL DELETE BACK INS INSERT ENTER RETURN PGUP PGDN LEFT RIGHT UP DOWN HOME END
# SPACE TAB ESC ESCAPE CANCEL CLEAR MENU PAUSE CAPITAL SELECT PRINT EXECUTE
# SNAPSHOT HELP ADD SEPARATOR SUBTRACT DECIMAL DIVIDE NUM_LOCK SCROLL_LOCK
# PAGEUP PAGEDOWN KP_SPACE KP_TAB KP_ENTER KP_HOME KP_LEFT KP_UP KP_RIGHT
# KP_DOWN KP_PRIOR KP_PAGEUP KP_NEXT KP_PAGEDOWN KP_END KP_BEGIN KP_INSERT
# KP_DELETE KP_EQUAL KP_MULTIPLY KP_ADD KP_SEPARATOR KP_SUBTRACT KP_DECIMAL
# KP_DIVIDE WINDOWS_LEFT WINDOWS_RIGHT WINDOWS_MENU COMMAND
# save state: freeze is save state, defrost is load state.
States_FreezeCurrentSlot = F1
States_DefrostCurrentSlot = F3
States_DefrostCurrentSlotBackup = Shift-F3
States_CycleSlotForward = F2
States_CycleSlotBackward = Shift-F2
Frameskip_Toggle = Shift-F4
Framelimiter_TurboToggle = TAB
Framelimiter_SlomoToggle = Shift-TAB
Framelimiter_MasterToggle = F4
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
# Hardware/software rendering toggle
Sys_RenderswitchToggle = F9
Sys_LoggingToggle = F10
Sys_FreezeGS = F11
Sys_RecordingToggle = F12
GSwindow_CycleAspectRatio = F6
# Whole picture zoom in/out
GSwindow_ZoomIn = Ctrl-KP_ADD
GSwindow_ZoomOut = Ctrl-KP_SUBTRACT
GSwindow_ZoomToggle = Ctrl-KP_MULTIPLY
# Vertical stretch/squash
GSwindow_ZoomInY = Alt-Ctrl-KP_ADD
GSwindow_ZoomOutY = Alt-Ctrl-KP_SUBTRACT
GSwindow_ZoomResetY = Alt-Ctrl-KP_MULTIPLY
# Move the whole image
GSwindow_OffsetYminus = Alt-Ctrl-UP
GSwindow_OffsetYplus = Alt-Ctrl-DOWN
GSwindow_OffsetXminus = Alt-Ctrl-LEFT
GSwindow_OffsetXplus = Alt-Ctrl-RIGHT
GSwindow_OffsetReset = Alt-Ctrl-KP_DIVIDE

View File

@ -530,13 +530,20 @@ void AcceleratorDictionary::Map( const KeyAcceleratorCode& _acode, const char *s
wxFileConfig cfg(L"", L"", L"" , GetUiKeysFilename(), wxCONFIG_USE_GLOBAL_FILE );
if( cfg.Read( wxString::FromUTF8(searchfor), &overrideStr) )
{
overrideStr = wxString(L"\t") + overrideStr;
if( codeParser.FromString( overrideStr ) ) // needs a '\t' prefix (originally used for wxMenu accelerators parsing)...
// needs a '\t' prefix (originally used for wxMenu accelerators parsing)...
if (codeParser.FromString(wxString(L"\t") + overrideStr))
{
//ini file contains alternative parsable key combination for current 'searchfor'.
// ini file contains alternative parsable key combination for current 'searchfor'.
acode = codeParser;
Console.WriteLn(Color_StrongGreen, L"Overriding '%s': assigning %s (instead of %s)",
WX_STR(fromUTF8( searchfor )), WX_STR(acode.ToString()), WX_STR(_acode.ToString()));
if (_acode.ToString() != acode.ToString()) {
Console.WriteLn(Color_StrongGreen, L"Overriding '%s': assigning %s (instead of %s)",
WX_STR(fromUTF8(searchfor)), WX_STR(acode.ToString()), WX_STR(_acode.ToString()));
}
}
else
{
Console.Error(L"Error overriding KB shortcut for '%s': can't understand '%s'",
WX_STR(fromUTF8(searchfor)), WX_STR(overrideStr));
}
}
// End of overrides section