From 43fa992c6cda0e4f160bfd465a3244095c1827a2 Mon Sep 17 00:00:00 2001 From: bleck9999 <55853712+bleck9999@users.noreply.github.com> Date: Sat, 19 Aug 2023 10:05:11 +0100 Subject: [PATCH] make power and volume work even with the joycons connected --- source/hid/hid.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/source/hid/hid.c b/source/hid/hid.c index f709919..83fc7d4 100644 --- a/source/hid/hid.c +++ b/source/hid/hid.c @@ -50,8 +50,8 @@ Input_t *hidRead(){ LbaseY = controller->lstick_y; } - inputs.up = (controller->up || (controller->lstick_y > LbaseY + 500)) ? 1 : 0; - inputs.down = (controller->down || (controller->lstick_y < LbaseY - 500)) ? 1 : 0; + inputs.up = (controller->up || inputs.volp || (controller->lstick_y > LbaseY + 500)) ? 1 : 0; + inputs.down = (controller->down || inputs.volm || (controller->lstick_y < LbaseY - 500)) ? 1 : 0; inputs.left = (controller->left || (controller->lstick_x < LbaseX - 500)) ? 1 : 0; inputs.right = (controller->right || (controller->lstick_x > LbaseX + 500)) ? 1 : 0; } @@ -71,8 +71,7 @@ Input_t *hidRead(){ inputs.rLeft = (controller->rstick_x < RbaseX - 500) ? 1 : 0; inputs.rRight = (controller->rstick_x > RbaseX + 500) ? 1 : 0; } - else - inputs.a = inputs.power; + inputs.a = inputs.a || inputs.power; return &inputs; } @@ -104,4 +103,4 @@ Input_t *hidWait(){ bool hidConnected(){ jc_gamepad_rpt_t *controller = joycon_poll(); return (controller->conn_l && controller->conn_r) ? 1 : 0; -} \ No newline at end of file +}