fix: extend inactivity detection to all primary inputs

Upstream only checks left stick X axis, so pressing buttons, using
the d-pad, or moving the right stick won't prevent disconnection.

Extends the same dead zone pattern to cover both sticks (all 4 axes),
both button bytes, and d-pad/misc bytes.
This commit is contained in:
dereckhall
2026-05-13 18:43:11 -04:00
parent 595a3e6b34
commit 4b4fc8fe1c
+7 -1
View File
@@ -340,7 +340,13 @@ static void l2cap_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t
if (get_config().disable_inactive_disconnect) {
return;
}
if (packet[3] < 120 || packet[3] > 140) {
if (packet[3] < 120 || packet[3] > 140 ||
packet[4] < 120 || packet[4] > 140 ||
packet[5] < 120 || packet[5] > 140 ||
packet[6] < 120 || packet[6] > 140 ||
packet[7] > 0 || packet[8] > 0 ||
packet[10] != 0x08 || packet[11] != 0x00 ||
packet[12] != 0x00) {
inactive_time = get_absolute_time();
} else if (absolute_time_diff_us(inactive_time, get_absolute_time()) >
static_cast<int64_t>(get_config().inactive_time) * 60 * 1000 * 1000) {