Remapping: Documentation and defaults update + add option to use a unified config (#2302)

* Add a toggle to use unified or per-game configs, and add a deadzone example to the default config

* Add a checkbox to toggle config type

* clang
This commit is contained in:
kalaposfos13 2025-01-31 17:41:11 +01:00 committed by GitHub
parent c4bfaa6031
commit 9aa6c5b951
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 36 additions and 6 deletions

View file

@ -68,6 +68,7 @@ static bool vkGuestMarkers = false;
static bool rdocEnable = false;
static s16 cursorState = HideCursorState::Idle;
static int cursorHideTimeout = 5; // 5 seconds (default)
static bool useUnifiedInputConfig = true;
static bool separateupdatefolder = false;
static bool compatibilityData = false;
static bool checkCompatibilityOnStartup = false;
@ -98,6 +99,14 @@ std::string emulator_language = "en";
// Language
u32 m_language = 1; // english
bool GetUseUnifiedInputConfig() {
return useUnifiedInputConfig;
}
void SetUseUnifiedInputConfig(bool use) {
useUnifiedInputConfig = use;
}
std::string getTrophyKey() {
return trophyKey;
}
@ -657,6 +666,7 @@ void load(const std::filesystem::path& path) {
useSpecialPad = toml::find_or<bool>(input, "useSpecialPad", false);
specialPadClass = toml::find_or<int>(input, "specialPadClass", 1);
isMotionControlsEnabled = toml::find_or<bool>(input, "isMotionControlsEnabled", true);
useUnifiedInputConfig = toml::find_or<bool>(input, "useUnifiedInputConfig", true);
}
if (data.contains("GPU")) {
@ -779,6 +789,7 @@ void save(const std::filesystem::path& path) {
data["Input"]["useSpecialPad"] = useSpecialPad;
data["Input"]["specialPadClass"] = specialPadClass;
data["Input"]["isMotionControlsEnabled"] = isMotionControlsEnabled;
data["Input"]["useUnifiedInputConfig"] = useUnifiedInputConfig;
data["GPU"]["screenWidth"] = screenWidth;
data["GPU"]["screenHeight"] = screenHeight;
data["GPU"]["nullGpu"] = isNullGpu;
@ -969,9 +980,12 @@ touchpad = back
axis_left_x = axis_left_x
axis_left_y = axis_left_y
axis_right_x = axis_right_x
axis_right_y = axis_right_y
# Range of deadzones: 1 (almost none) to 127 (max)
analog_deadzone = leftjoystick, 2
analog_deadzone = rightjoystick, 2
)";
}
std::filesystem::path GetFoolproofKbmConfigFile(const std::string& game_id) {

View file

@ -43,6 +43,8 @@ std::string getBackButtonBehavior();
bool getUseSpecialPad();
int getSpecialPadClass();
bool getIsMotionControlsEnabled();
bool GetUseUnifiedInputConfig();
void SetUseUnifiedInputConfig(bool use);
u32 getScreenWidth();
u32 getScreenHeight();