From 235560bf72db765e30519aab37a7582992227d89 Mon Sep 17 00:00:00 2001 From: Yoichiro Tanaka Date: Fri, 15 Oct 2021 20:18:33 +0900 Subject: [PATCH] Fix the issue #256 by changing the timing to set True fo the hid_pending flag. --- docs/split_keyboards.md | 1 + kmk/modules/modtap.py | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/split_keyboards.md b/docs/split_keyboards.md index a2e0581..5d3f969 100644 --- a/docs/split_keyboards.md +++ b/docs/split_keyboards.md @@ -2,6 +2,7 @@ Split keyboards are mostly the same as unsplit. Wired UART is fully supported, and testing of bluetooth splits, though we don't currently offer support for this. +Notice that this Split module must be added after the ModTap module to the keyboard.modules. ## Wired UART Wired connections can use UART over 1 or 2 wires. With 2 wires, you will be able diff --git a/kmk/modules/modtap.py b/kmk/modules/modtap.py index 6b31a73..cbbbf32 100644 --- a/kmk/modules/modtap.py +++ b/kmk/modules/modtap.py @@ -13,18 +13,17 @@ class ModTap(HoldTap): on_release=self.ht_released, ) - def ht_activate_hold(self, key, keyboard, *args, **kwargs): + def before_hid_send(self, keyboard): keyboard.hid_pending = True + + def ht_activate_hold(self, key, keyboard, *args, **kwargs): keyboard.keys_pressed.add(key.meta.mods) def ht_deactivate_hold(self, key, keyboard, *args, **kwargs): - keyboard.hid_pending = True keyboard.keys_pressed.discard(key.meta.mods) def ht_activate_tap(self, key, keyboard, *args, **kwargs): - keyboard.hid_pending = True keyboard.keys_pressed.add(key.meta.kc) def ht_deactivate_tap(self, key, keyboard, *args, **kwargs): - keyboard.hid_pending = True keyboard.keys_pressed.discard(key.meta.kc)