diff --git a/runtime/include/runtime_config.h b/runtime/include/runtime_config.h index ea5a12b94..939c4c40d 100644 --- a/runtime/include/runtime_config.h +++ b/runtime/include/runtime_config.h @@ -90,6 +90,10 @@ struct RuntimeUserConfig { // comma-separated SDL-style physical button names ("south", or // "dpad_up,left_shoulder") as values; pressing either bound button counts. std::array, 12> controllerButtons; + // Per-port overrides of controllerButtons ("a_1" .. "right_4", the suffix is port + 1). + // A port falls back to the shared controllerButtons entry while its override is unset, so + // configs written before per-port bindings keep applying to every port unchanged. + std::array, 12>, 4> controllerPortButtons; std::optional rumbleEnabled; // Shake a motion controller to press the D-pad, like shaking a Wii Remote. std::optional motionTrick; @@ -413,6 +417,21 @@ inline RuntimeUserConfig ParseConfigDocument(const toml::value& document) { for (const auto& [key, value] : section->as_table()) { if (key.rfind("expr_", 0) == 0 && value.is_string()) { config.controllerExpressions[key] = value.as_string(); + continue; + } + // "