Skip to content

Commit

Permalink
Update Input.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Karojen authored Aug 30, 2022
1 parent 645cd0d commit 2b15192
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Source/Core/DolphinLibretro/Input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,13 @@ void retro_set_controller_port_device(unsigned port, unsigned device)
wmTilt->SetControlExpression(2, "`" + devAnalog + ":X1-`"); // Left
wmTilt->SetControlExpression(3, "`" + devAnalog + ":X1+`"); // Right
}
if (Libretro::Options::irMode != 3 && Libretro::Options::irMode != 4)
{
wmTilt->SetControlExpression(0, "`" + devAnalog + ":Y0-`"); // Forward
wmTilt->SetControlExpression(1, "`" + devAnalog + ":Y0+`"); // Backward
wmTilt->SetControlExpression(2, "`" + devAnalog + ":X0-`"); // Left
wmTilt->SetControlExpression(3, "`" + devAnalog + ":X0+`"); // Right
}
}
else
{
Expand Down Expand Up @@ -798,6 +805,18 @@ void retro_set_controller_port_device(unsigned port, unsigned device)
static_cast<ControllerEmu::NumericSetting<bool>*>(wmIR->numeric_settings[5].get())
->SetValue(true); // Auto hide
}
else if (Libretro::Options::irMode == 3 || Libretro::Options::irMode == 4)
{
// Set left stick to control the IR
wmIR->SetControlExpression(0, "`" + devAnalog + ":Y0-`"); // Up
wmIR->SetControlExpression(1, "`" + devAnalog + ":Y0+`"); // Down
wmIR->SetControlExpression(2, "`" + devAnalog + ":X0-`"); // Left
wmIR->SetControlExpression(3, "`" + devAnalog + ":X0+`"); // Right
static_cast<ControllerEmu::NumericSetting<bool>*>(wmIR->numeric_settings[4].get())
->SetValue(Libretro::Options::irMode == 3); // Relative input
static_cast<ControllerEmu::NumericSetting<bool>*>(wmIR->numeric_settings[5].get())
->SetValue(true); // Auto hide
}
else
{
// Mouse controls IR
Expand Down

0 comments on commit 2b15192

Please sign in to comment.