mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-13 03:28:02 -05:00
input_common: Map sticks correctly when mapped sideways
This commit is contained in:
@ -471,6 +471,25 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i
|
||||
[=, this](const Common::ParamPackage& params) {
|
||||
Common::ParamPackage param = emulated_controller->GetStickParam(analog_id);
|
||||
SetAnalogParam(params, param, analog_sub_buttons[sub_button_id]);
|
||||
// Correct axis direction for inverted sticks
|
||||
if (input_subsystem->IsStickInverted(param)) {
|
||||
switch (analog_id) {
|
||||
case Settings::NativeAnalog::LStick: {
|
||||
const bool invert_value = param.Get("invert_x", "+") == "-";
|
||||
const std::string invert_str = invert_value ? "+" : "-";
|
||||
param.Set("invert_x", invert_str);
|
||||
break;
|
||||
}
|
||||
case Settings::NativeAnalog::RStick: {
|
||||
const bool invert_value = param.Get("invert_y", "+") == "-";
|
||||
const std::string invert_str = invert_value ? "+" : "-";
|
||||
param.Set("invert_y", invert_str);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
emulated_controller->SetStickParam(analog_id, param);
|
||||
},
|
||||
InputCommon::Polling::InputType::Stick);
|
||||
|
Reference in New Issue
Block a user