Merge pull request #8864 from german77/toggle_analog

input_common: Add support for analog toggle
This commit is contained in:
bunnei 2022-09-09 20:54:01 -07:00 committed by GitHub
commit 7dc3d49135
4 changed files with 23 additions and 7 deletions

View file

@ -824,6 +824,7 @@ std::unique_ptr<Common::Input::InputDevice> InputFactory::CreateAnalogDevice(
.threshold = std::clamp(params.Get("threshold", 0.5f), 0.0f, 1.0f),
.offset = std::clamp(params.Get("offset", 0.0f), -1.0f, 1.0f),
.inverted = params.Get("invert", "+") == "-",
.toggle = static_cast<bool>(params.Get("toggle", false)),
};
input_engine->PreSetController(identifier);
input_engine->PreSetAxis(identifier, axis);