- Fixed gyro and reset_mouse not working when set to left joycon's buttons

This commit is contained in:
David Khachaturov 2020-04-14 08:43:41 +01:00
parent 18a117d3d2
commit 4b49cc305f

View file

@ -610,11 +610,12 @@ namespace BetterJoyForCemu {
// TODO // TODO
} else if (extraGyroFeature == "mouse" && (isPro || (other == null) || (other != null && (Boolean.Parse(ConfigurationManager.AppSettings["GyroMouseLeftHanded"]) ? isLeft : !isLeft)))) { } else if (extraGyroFeature == "mouse" && (isPro || (other == null) || (other != null && (Boolean.Parse(ConfigurationManager.AppSettings["GyroMouseLeftHanded"]) ? isLeft : !isLeft)))) {
string res_val = Config.Value("active_gyro"); string res_val = Config.Value("active_gyro");
if (res_val.StartsWith("joy_")) if (res_val.StartsWith("joy_")){
if (buttons_down[Int32.Parse(res_val.Substring(4))]) if (buttons_down[Int32.Parse(res_val.Substring(4))] || (other != null && other.buttons_down[Int32.Parse(res_val.Substring(4))]))
active_gyro = true; active_gyro = true;
else if (buttons_up[Int32.Parse(res_val.Substring(4))]) else if (buttons_up[Int32.Parse(res_val.Substring(4))] || (other != null && other.buttons_up[Int32.Parse(res_val.Substring(4))]))
active_gyro = false; active_gyro = false;
}
float dt = 0.015f; // 15ms float dt = 0.015f; // 15ms
@ -629,7 +630,7 @@ namespace BetterJoyForCemu {
// reset mouse position to centre of primary monitor // reset mouse position to centre of primary monitor
res_val = Config.Value("reset_mouse"); res_val = Config.Value("reset_mouse");
if (res_val.StartsWith("joy_")) if (res_val.StartsWith("joy_"))
if (buttons_down[Int32.Parse(res_val.Substring(4))]) if (buttons_down[Int32.Parse(res_val.Substring(4))] || (other != null && other.buttons_down[Int32.Parse(res_val.Substring(4))]))
WindowsInput.Simulate.Events().MoveTo(Screen.PrimaryScreen.Bounds.Width / 2, Screen.PrimaryScreen.Bounds.Height / 2).Invoke(); WindowsInput.Simulate.Events().MoveTo(Screen.PrimaryScreen.Bounds.Width / 2, Screen.PrimaryScreen.Bounds.Height / 2).Invoke();
} }
} }