- Fixed joycons not being properly detached with the new lack of input lag

This commit is contained in:
David Khachaturov 2020-05-17 17:44:12 +01:00
parent 7b722dddb3
commit 5857a44f65
3 changed files with 6 additions and 6 deletions

View file

@ -46,7 +46,6 @@
<!-- Default: false -->
<add key="UseHIDG" value="true" />
<!-- Determines whether or not to enable (experimental - currently default controller to pro) support for 3rd-party controllers. Adds a "Calibrate" button. -->
<!-- When "true", click "Calibrate" button once to get gyro calibrate data. -->
<!-- When enabled, can only calibrate one controller at a time. -->

View file

@ -469,7 +469,7 @@ namespace BetterJoyForCemu {
filterweight = a;
}
public void Detach() {
public void Detach(bool close = false) {
stop_polling = true;
if (xin != null) {
@ -494,7 +494,7 @@ namespace BetterJoyForCemu {
HIDapi.hid_write(handle, a, new UIntPtr(2));
}
}
if (state > state_.DROPPED) {
if (close || state > state_.DROPPED) {
HIDapi.hid_close(handle);
}
state = state_.NOT_ATTACHED;
@ -646,6 +646,7 @@ namespace BetterJoyForCemu {
if ((timestamp - buttons_down_timestamp[powerOffButton]) / 10000 > 2000.0) {
if (other != null)
other.PowerOff();
PowerOff();
return;
}
@ -728,7 +729,7 @@ namespace BetterJoyForCemu {
int a = ReceiveRaw();
if (a > 0) {
if (a > 0 && state > state_.DROPPED) {
state = state_.IMU_DATA_OK;
attempts = 0;

View file

@ -70,7 +70,7 @@ namespace BetterJoyForCemu {
if (v.other != null)
v.other.other = null; // The other of the other is the joycon itself
v.Detach(); rem.Add(v);
v.Detach(true); rem.Add(v);
foreach (Button b in form.con) {
if (b.Enabled & b.Tag == v) {
@ -83,7 +83,7 @@ namespace BetterJoyForCemu {
}
}
form.AppendTextBox("Removed dropped controller to list. Can be reconnected.\r\n");
form.AppendTextBox("Removed dropped controller. Can be reconnected.\r\n");
}
}