fix hold-tap key interrupted by other hold-tap key
This commit is contained in:
parent
f30206c7d5
commit
7573556f33
@ -1,7 +1,6 @@
|
|||||||
from micropython import const
|
from micropython import const
|
||||||
|
|
||||||
from kmk.modules import Module
|
from kmk.modules import Module
|
||||||
from kmk.types import ModTapKeyMeta
|
|
||||||
|
|
||||||
|
|
||||||
class ActivationType:
|
class ActivationType:
|
||||||
@ -36,8 +35,10 @@ class HoldTap(Module):
|
|||||||
def process_key(self, keyboard, key, is_pressed):
|
def process_key(self, keyboard, key, is_pressed):
|
||||||
'''Before other key down decide to send tap kc down.'''
|
'''Before other key down decide to send tap kc down.'''
|
||||||
current_key = key
|
current_key = key
|
||||||
if is_pressed and not isinstance(key.meta, ModTapKeyMeta):
|
for key, state in self.key_states.items():
|
||||||
for key, state in self.key_states.items():
|
if key == current_key:
|
||||||
|
continue
|
||||||
|
if is_pressed:
|
||||||
if state.activated == ActivationType.NOT_ACTIVATED:
|
if state.activated == ActivationType.NOT_ACTIVATED:
|
||||||
# press tap because interrupted by other key
|
# press tap because interrupted by other key
|
||||||
self.key_states[key].activated = ActivationType.INTERRUPTED
|
self.key_states[key].activated = ActivationType.INTERRUPTED
|
||||||
|
Loading…
x
Reference in New Issue
Block a user