From 20ba48b623ae4fe7a84895692ba636995b0092e5 Mon Sep 17 00:00:00 2001 From: xs5871 Date: Wed, 15 Mar 2023 23:00:49 +0000 Subject: [PATCH] Fix oneshot as combo result getting stuck --- kmk/modules/combos.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/kmk/modules/combos.py b/kmk/modules/combos.py index d44d031..b012d2a 100644 --- a/kmk/modules/combos.py +++ b/kmk/modules/combos.py @@ -8,6 +8,9 @@ import kmk.handlers.stock as handlers from kmk.keys import Key, make_key from kmk.kmk_keyboard import KMKKeyboard from kmk.modules import Module +from kmk.utils import Debug + +debug = Debug(__name__) class _ComboState: @@ -214,7 +217,7 @@ class Combos(Module): combo.insert(key, int_coord) combo._state = _ComboState.MATCHING - key = combo.result + key = None break else: @@ -301,10 +304,14 @@ class Combos(Module): keyboard.resume_process_key(self, key, is_pressed, int_coord) def activate(self, keyboard, combo): + if debug.enabled: + debug('activate', combo) combo.result.on_press(keyboard) combo._state = _ComboState.ACTIVE def deactivate(self, keyboard, combo): + if debug.enabled: + debug('deactivate', combo) combo.result.on_release(keyboard) combo._state = _ComboState.IDLE