From d424fa8cd7909dc0b0b6f70a7696fe7bde245f62 Mon Sep 17 00:00:00 2001 From: "Derek J. Clark" Date: Tue, 20 Feb 2024 11:18:43 -0800 Subject: [PATCH] fix(ayan_gen2): Allow for key-up of button 2 when long pressed. --- src/handycon/handhelds/aya_gen2.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/handycon/handhelds/aya_gen2.py b/src/handycon/handhelds/aya_gen2.py index af6a92f..7ee3684 100755 --- a/src/handycon/handhelds/aya_gen2.py +++ b/src/handycon/handhelds/aya_gen2.py @@ -38,7 +38,8 @@ async def process_event(seed_event, active_keys): # BUTTON 2 (Default: QAM) Small Button Short Press if active_keys in [[40, 133], [32, 125]] and button_on == 1 and button2 not in handycon.event_queue: await handycon.handle_key_down(seed_event, button2) - elif active_keys == [] and seed_event.code in [32, 40, 125, 133] and button_on == 0 and button2 in handycon.event_queue: + # We need to account for long press as well or the button will get stuck on and everything will break. + elif active_keys == [] and seed_event.code in [32, 40, 97, 100, 111, 125, 133] and button_on == 0 and button2 in handycon.event_queue: await handycon.handle_key_up(seed_event, button2) # BUTTON 4 (Default: OSK) Small button Long Press