diff --git a/pcsx2/PAD/Host/PAD.cpp b/pcsx2/PAD/Host/PAD.cpp index 10e7a15ea6..f3cc04c036 100644 --- a/pcsx2/PAD/Host/PAD.cpp +++ b/pcsx2/PAD/Host/PAD.cpp @@ -176,6 +176,56 @@ void PAD::LoadConfig(const SettingsInterface& si) } } +void PAD::SetDefaultConfig(SettingsInterface& si) +{ + si.ClearSection("InputSources"); + + for (u32 i = 0; i < GAMEPAD_NUMBER; i++) + si.ClearSection(StringUtil::StdStringFromFormat("Pad%u", i + 1).c_str()); + + si.ClearSection("Hotkeys"); + + si.SetBoolValue("InputSources", "SDL", true); + si.SetBoolValue("InputSources", "SDLControllerEnhancedMode", false); + si.SetBoolValue("InputSources", "XInput", false); + + si.SetStringValue("Pad1", "Type", "DualShock2"); + si.SetStringValue("Pad1", "Up", "Keyboard/Up"); + si.SetStringValue("Pad1", "Right", "Keyboard/Right"); + si.SetStringValue("Pad1", "Down", "Keyboard/Down"); + si.SetStringValue("Pad1", "Left", "Keyboard/Left"); + si.SetStringValue("Pad1", "LUp", "Keyboard/W"); + si.SetStringValue("Pad1", "LRight", "Keyboard/D"); + si.SetStringValue("Pad1", "LDown", "Keyboard/S"); + si.SetStringValue("Pad1", "LLeft", "Keyboard/A"); + si.SetStringValue("Pad1", "RUp", "Keyboard/T"); + si.SetStringValue("Pad1", "RRight", "Keyboard/H"); + si.SetStringValue("Pad1", "RDown", "Keyboard/G"); + si.SetStringValue("Pad1", "RLeft", "Keyboard/F"); + si.SetStringValue("Pad1", "Triangle", "Keyboard/I"); + si.SetStringValue("Pad1", "Circle", "Keyboard/L"); + si.SetStringValue("Pad1", "Cross", "Keyboard/K"); + si.SetStringValue("Pad1", "Square", "Keyboard/J"); + si.SetStringValue("Pad1", "L1", "Keyboard/Q"); + si.SetStringValue("Pad1", "L2", "Keyboard/1"); + si.SetStringValue("Pad1", "L3", "Keyboard/2"); + si.SetStringValue("Pad1", "R1", "Keyboard/E"); + si.SetStringValue("Pad1", "R2", "Keyboard/3"); + si.SetStringValue("Pad1", "R3", "Keyboard/4"); + si.SetStringValue("Pad1", "Start", "Keyboard/Return"); + si.SetStringValue("Pad1", "Select", "Keyboard/Backspace"); + + si.SetStringValue("Hotkeys", "ToggleTurbo", "Keyboard/Tab"); + si.SetStringValue("Hotkeys", "ToggleFrameLimit", "Keyboard/F4"); + si.SetStringValue("Hotkeys", "ToggleSoftwareRendering", "Keyboard/F9"); + si.SetStringValue("Hotkeys", "TogglePause", "Keyboard/Space"); + si.SetStringValue("Hotkeys", "ToggleFullscreen", "Keyboard/Alt & Keyboard/Return"); + si.SetStringValue("Hotkeys", "Screenshot", "Keyboard/F8"); + si.SetStringValue("Hotkeys", "SaveStateToSlot", "Keyboard/F1"); + si.SetStringValue("Hotkeys", "NextSaveStateSlot", "Keyboard/F2"); + si.SetStringValue("Hotkeys", "LoadStateFromSlot", "Keyboard/F3"); +} + void PAD::Update() { Pad::rumble_all(); diff --git a/pcsx2/PAD/Host/PAD.h b/pcsx2/PAD/Host/PAD.h index 04243da511..202ffc245a 100644 --- a/pcsx2/PAD/Host/PAD.h +++ b/pcsx2/PAD/Host/PAD.h @@ -46,6 +46,9 @@ namespace PAD /// Reloads configuration. void LoadConfig(const SettingsInterface& si); + /// Restores default configuration. + void SetDefaultConfig(SettingsInterface& si); + /// Updates vibration and other internal state. Called at the *end* of a frame. void Update();