Merge pull request #6240 from pal1000/work

Have control mapper override the default shortcut keys for save states related commands. Fixes #6214 .
This commit is contained in:
Henrik Rydgård 2014-06-06 20:43:28 +02:00
commit 986d54039c
4 changed files with 106 additions and 70 deletions

View File

@ -66,11 +66,11 @@ static const DefMappingStruct defaultQwertyKeyboardKeyMap[] = {
{VIRTKEY_AXIS_Y_MIN, NKCODE_K},
{VIRTKEY_AXIS_X_MIN, NKCODE_J},
{VIRTKEY_AXIS_X_MAX, NKCODE_L},
{VIRTKEY_RAPID_FIRE , NKCODE_SHIFT_LEFT},
{VIRTKEY_UNTHROTTLE , NKCODE_TAB},
{VIRTKEY_RAPID_FIRE, NKCODE_SHIFT_LEFT},
{VIRTKEY_UNTHROTTLE, NKCODE_TAB},
{VIRTKEY_SPEED_TOGGLE, NKCODE_GRAVE},
{VIRTKEY_PAUSE , NKCODE_ESCAPE},
{VIRTKEY_REWIND , NKCODE_DEL},
{VIRTKEY_PAUSE, NKCODE_ESCAPE},
{VIRTKEY_REWIND, NKCODE_DEL},
};
static const DefMappingStruct defaultAzertyKeyboardKeyMap[] = {
@ -95,11 +95,11 @@ static const DefMappingStruct defaultAzertyKeyboardKeyMap[] = {
{VIRTKEY_AXIS_Y_MIN, NKCODE_K},
{VIRTKEY_AXIS_X_MIN, NKCODE_J},
{VIRTKEY_AXIS_X_MAX, NKCODE_L},
{VIRTKEY_RAPID_FIRE , NKCODE_SHIFT_LEFT},
{VIRTKEY_UNTHROTTLE , NKCODE_TAB},
{VIRTKEY_RAPID_FIRE, NKCODE_SHIFT_LEFT},
{VIRTKEY_UNTHROTTLE, NKCODE_TAB},
{VIRTKEY_SPEED_TOGGLE, NKCODE_GRAVE},
{VIRTKEY_PAUSE , NKCODE_ESCAPE},
{VIRTKEY_REWIND , NKCODE_DEL},
{VIRTKEY_PAUSE, NKCODE_ESCAPE},
{VIRTKEY_REWIND, NKCODE_DEL},
};
static const DefMappingStruct defaultQwertzKeyboardKeyMap[] = {
@ -124,11 +124,11 @@ static const DefMappingStruct defaultQwertzKeyboardKeyMap[] = {
{VIRTKEY_AXIS_Y_MIN, NKCODE_K},
{VIRTKEY_AXIS_X_MIN, NKCODE_J},
{VIRTKEY_AXIS_X_MAX, NKCODE_L},
{VIRTKEY_RAPID_FIRE , NKCODE_SHIFT_LEFT},
{VIRTKEY_UNTHROTTLE , NKCODE_TAB},
{VIRTKEY_RAPID_FIRE, NKCODE_SHIFT_LEFT},
{VIRTKEY_UNTHROTTLE, NKCODE_TAB},
{VIRTKEY_SPEED_TOGGLE, NKCODE_GRAVE},
{VIRTKEY_PAUSE , NKCODE_ESCAPE},
{VIRTKEY_REWIND , NKCODE_DEL},
{VIRTKEY_PAUSE, NKCODE_ESCAPE},
{VIRTKEY_REWIND, NKCODE_DEL},
};
static const DefMappingStruct default360KeyMap[] = {

View File

@ -19,6 +19,7 @@
// It's improving slowly, though. :)
#include "Common/CommonWindows.h"
#include "Common/KeyMap.h"
#include <map>
#include <string>
@ -1163,6 +1164,15 @@ namespace MainWindow {
break;
}
case ID_FILE_SAVESTATE_NEXT_SLOT_HC:
{
if (KeyMap::g_controllerMap[VIRTKEY_NEXT_SLOT].begin() == KeyMap::g_controllerMap[VIRTKEY_NEXT_SLOT].end())
{
SaveState::NextSlot();
}
break;
}
case ID_FILE_SAVESTATE_SLOT_1: g_Config.iCurrentStateSlot = 0; break;
case ID_FILE_SAVESTATE_SLOT_2: g_Config.iCurrentStateSlot = 1; break;
case ID_FILE_SAVESTATE_SLOT_3: g_Config.iCurrentStateSlot = 2; break;
@ -1170,14 +1180,37 @@ namespace MainWindow {
case ID_FILE_SAVESTATE_SLOT_5: g_Config.iCurrentStateSlot = 4; break;
case ID_FILE_QUICKLOADSTATE:
{
SetCursor(LoadCursor(0, IDC_WAIT));
SaveState::LoadSlot(g_Config.iCurrentStateSlot, SaveStateActionFinished);
break;
}
case ID_FILE_QUICKLOADSTATE_HC:
{
if (KeyMap::g_controllerMap[VIRTKEY_LOAD_STATE].begin() == KeyMap::g_controllerMap[VIRTKEY_LOAD_STATE].end())
{
SetCursor(LoadCursor(0, IDC_WAIT));
SaveState::LoadSlot(g_Config.iCurrentStateSlot, SaveStateActionFinished);
}
break;
}
case ID_FILE_QUICKSAVESTATE:
{
SetCursor(LoadCursor(0, IDC_WAIT));
SaveState::SaveSlot(g_Config.iCurrentStateSlot, SaveStateActionFinished);
break;
}
case ID_FILE_QUICKSAVESTATE_HC:
{
if (KeyMap::g_controllerMap[VIRTKEY_SAVE_STATE].begin() == KeyMap::g_controllerMap[VIRTKEY_SAVE_STATE].end())
{
SetCursor(LoadCursor(0, IDC_WAIT));
SaveState::SaveSlot(g_Config.iCurrentStateSlot, SaveStateActionFinished);
break;
}
}
case ID_OPTIONS_LANGUAGE:
NativeMessageReceived("language screen", "");

View File

@ -73,9 +73,9 @@ BEGIN
"L", ID_DEBUG_LOG, VIRTKEY, CONTROL, NOINVERT
"M", ID_DEBUG_MEMORYVIEW, VIRTKEY, CONTROL, NOINVERT
"R", ID_DEBUG_REGISTERS, VIRTKEY, CONTROL, NOINVERT
VK_F3, ID_FILE_SAVESTATE_NEXT_SLOT, VIRTKEY, NOINVERT
VK_F2, ID_FILE_QUICKSAVESTATE, VIRTKEY, NOINVERT
VK_F4, ID_FILE_QUICKLOADSTATE, VIRTKEY, NOINVERT
VK_F3, ID_FILE_SAVESTATE_NEXT_SLOT_HC, VIRTKEY, NOINVERT
VK_F2, ID_FILE_QUICKSAVESTATE_HC, VIRTKEY, NOINVERT
VK_F4, ID_FILE_QUICKLOADSTATE_HC, VIRTKEY, NOINVERT
"1", ID_OPTIONS_RESOLUTIONDUMMY, VIRTKEY, CONTROL, NOINVERT
VK_F5, ID_OPTIONS_BUFFEREDRENDERINGDUMMY, VIRTKEY, NOINVERT
VK_F7, ID_OPTIONS_FRAMESKIPDUMMY, VIRTKEY, NOINVERT

View File

@ -199,61 +199,64 @@
#define ID_OPTIONS_LINEARFILTERING 40033
#define ID_FILE_QUICKSAVESTATE 40034
#define ID_FILE_QUICKLOADSTATE 40035
#define ID_OPTIONS_CONTROLS 40036
#define ID_DEBUG_RUNONLOAD 40037
#define ID_DEBUG_DUMPNEXTFRAME 40038
#define ID_OPTIONS_VERTEXCACHE 40040
#define ID_OPTIONS_SHOWFPS 40041
#define ID_OPTIONS_STRETCHDISPLAY 40042
#define ID_OPTIONS_FRAMESKIP 40043
#define IDC_MEMCHECK 40044
#define ID_FILE_MEMSTICK 40045
#define ID_FILE_LOAD_MEMSTICK 40046
#define ID_EMULATION_SOUND 40047
#define ID_OPTIONS_MIPMAP 40048
#define ID_TEXTURESCALING_OFF 40049
#define ID_TEXTURESCALING_XBRZ 40050
#define ID_TEXTURESCALING_HYBRID 40051
#define ID_TEXTURESCALING_2X 40052
#define ID_TEXTURESCALING_3X 40053
#define ID_TEXTURESCALING_4X 40054
#define ID_TEXTURESCALING_5X 40055
#define ID_TEXTURESCALING_DEPOSTERIZE 40056
#define ID_TEXTURESCALING_BICUBIC 40057
#define ID_TEXTURESCALING_HYBRID_BICUBIC 40058
#define IDB_IMAGE_PSP 40059
#define IDC_STATIC_IMAGE_PSP 40060
#define ID_CONTROLS_KEY_DISABLE 40061
#define ID_OPTIONS_TOPMOST 40062
#define ID_HELP_OPENFORUM 40063
#define ID_OPTIONS_VSYNC 40064
#define ID_DEBUG_TAKESCREENSHOT 40065
#define ID_OPTIONS_TEXTUREFILTERING_AUTO 40066
#define ID_OPTIONS_NEARESTFILTERING 40067
#define ID_DISASM_DISASSEMBLETOFILE 40068
#define ID_OPTIONS_LINEARFILTERING_CG 40069
#define ID_DISASM_DISABLEBREAKPOINT 40070
#define ID_DISASM_THREAD_FORCERUN 40071
#define ID_DISASM_THREAD_KILL 40072
#define ID_FILE_SAVESTATE_NEXT_SLOT 40073
#define ID_OPTIONS_READFBOTOMEMORYGPU 40074
#define ID_OPTIONS_READFBOTOMEMORYCPU 40075
#define ID_OPTIONS_NONBUFFEREDRENDERING 40076
#define ID_OPTIONS_FRAMESKIP_0 40077
#define ID_OPTIONS_FRAMESKIP_1 40078
#define ID_OPTIONS_FRAMESKIP_2 40079
#define ID_OPTIONS_FRAMESKIP_3 40080
#define ID_OPTIONS_FRAMESKIP_4 40081
#define ID_OPTIONS_FRAMESKIP_5 40082
#define ID_OPTIONS_FRAMESKIP_6 40083
#define ID_OPTIONS_FRAMESKIP_7 40084
#define ID_OPTIONS_FRAMESKIP_8 40085
#define ID_OPTIONS_FRAMESKIP_AUTO 40087
#define ID_OPTIONS_FRAMESKIPDUMMY 40088
#define ID_OPTIONS_RESOLUTIONDUMMY 40089
#define ID_DISASM_ASSEMBLE 40090
#define ID_DISASM_ADDNEWBREAKPOINT 40091
#define ID_DISASM_EDITBREAKPOINT 40092
#define ID_FILE_QUICKSAVESTATE_HC 40036
#define ID_FILE_QUICKLOADSTATE_HC 40037
#define ID_OPTIONS_CONTROLS 40038
#define ID_DEBUG_RUNONLOAD 40039
#define ID_DEBUG_DUMPNEXTFRAME 40040
#define ID_OPTIONS_VERTEXCACHE 40041
#define ID_OPTIONS_SHOWFPS 40042
#define ID_OPTIONS_STRETCHDISPLAY 40043
#define ID_OPTIONS_FRAMESKIP 40044
#define IDC_MEMCHECK 40045
#define ID_FILE_MEMSTICK 40046
#define ID_FILE_LOAD_MEMSTICK 40047
#define ID_EMULATION_SOUND 40048
#define ID_OPTIONS_MIPMAP 40049
#define ID_TEXTURESCALING_OFF 40050
#define ID_TEXTURESCALING_XBRZ 40051
#define ID_TEXTURESCALING_HYBRID 40052
#define ID_TEXTURESCALING_2X 40053
#define ID_TEXTURESCALING_3X 40054
#define ID_TEXTURESCALING_4X 40055
#define ID_TEXTURESCALING_5X 40056
#define ID_TEXTURESCALING_DEPOSTERIZE 40057
#define ID_TEXTURESCALING_BICUBIC 40058
#define ID_TEXTURESCALING_HYBRID_BICUBIC 40059
#define IDB_IMAGE_PSP 40060
#define IDC_STATIC_IMAGE_PSP 40061
#define ID_CONTROLS_KEY_DISABLE 40062
#define ID_OPTIONS_TOPMOST 40063
#define ID_HELP_OPENFORUM 40064
#define ID_OPTIONS_VSYNC 40065
#define ID_DEBUG_TAKESCREENSHOT 40066
#define ID_OPTIONS_TEXTUREFILTERING_AUTO 40067
#define ID_OPTIONS_NEARESTFILTERING 40068
#define ID_DISASM_DISASSEMBLETOFILE 40069
#define ID_OPTIONS_LINEARFILTERING_CG 40070
#define ID_DISASM_DISABLEBREAKPOINT 40071
#define ID_DISASM_THREAD_FORCERUN 40072
#define ID_DISASM_THREAD_KILL 40073
#define ID_FILE_SAVESTATE_NEXT_SLOT 40074
#define ID_FILE_SAVESTATE_NEXT_SLOT_HC 40075
#define ID_OPTIONS_READFBOTOMEMORYGPU 40076
#define ID_OPTIONS_READFBOTOMEMORYCPU 40077
#define ID_OPTIONS_NONBUFFEREDRENDERING 40078
#define ID_OPTIONS_FRAMESKIP_0 40079
#define ID_OPTIONS_FRAMESKIP_1 40080
#define ID_OPTIONS_FRAMESKIP_2 40081
#define ID_OPTIONS_FRAMESKIP_3 40082
#define ID_OPTIONS_FRAMESKIP_4 40083
#define ID_OPTIONS_FRAMESKIP_5 40084
#define ID_OPTIONS_FRAMESKIP_6 40085
#define ID_OPTIONS_FRAMESKIP_7 40086
#define ID_OPTIONS_FRAMESKIP_8 40087
#define ID_OPTIONS_FRAMESKIP_AUTO 40088
#define ID_OPTIONS_FRAMESKIPDUMMY 40089
#define ID_OPTIONS_RESOLUTIONDUMMY 40090
#define ID_DISASM_ASSEMBLE 40091
#define ID_DISASM_ADDNEWBREAKPOINT 40092
#define ID_DISASM_EDITBREAKPOINT 40093
#define ID_EMULATION_CHEATS 40096
#define ID_HELP_CHINESE_FORUM 40097
#define ID_OPTIONS_MORE_SETTINGS 40098