input_common: Map sticks correctly when mapped sideways
This commit is contained in:
parent
82ac66f8a4
commit
ee532e5c01
10 changed files with 127 additions and 0 deletions
|
@ -524,4 +524,20 @@ Common::Input::ButtonNames GCAdapter::GetUIName(const Common::ParamPackage& para
|
|||
return Common::Input::ButtonNames::Invalid;
|
||||
}
|
||||
|
||||
bool GCAdapter::IsStickInverted(const Common::ParamPackage& params) {
|
||||
if (!params.Has("port")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const auto x_axis = static_cast<PadAxes>(params.Get("axis_x", 0));
|
||||
const auto y_axis = static_cast<PadAxes>(params.Get("axis_y", 0));
|
||||
if (x_axis != PadAxes::StickY && x_axis != PadAxes::SubstickY) {
|
||||
return false;
|
||||
}
|
||||
if (y_axis != PadAxes::StickX && y_axis != PadAxes::SubstickX) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace InputCommon
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue