Fix some old holdtap inconsistencies
This commit is contained in:
@@ -268,8 +268,9 @@ class KMKKeyboard:
|
||||
key: Key,
|
||||
is_pressed: bool,
|
||||
int_coord: Optional[int] = None,
|
||||
reprocess: Optional[bool] = False,
|
||||
) -> None:
|
||||
index = self.modules.index(module) + 1
|
||||
index = self.modules.index(module) + (0 if reprocess else 1)
|
||||
ksf = KeyBufferFrame(
|
||||
key=key, is_pressed=is_pressed, int_coord=int_coord, index=index
|
||||
)
|
||||
|
@@ -98,15 +98,12 @@ class HoldTap(Module):
|
||||
self.ht_activate_on_interrupt(
|
||||
key, keyboard, *state.args, **state.kwargs
|
||||
)
|
||||
append_buffer = True
|
||||
send_buffer = True
|
||||
|
||||
# if interrupt on release: store interrupting keys until one of them
|
||||
# is released.
|
||||
if (
|
||||
key.meta.tap_interrupted
|
||||
and is_pressed
|
||||
and not isinstance(current_key.meta, HoldTapKeyMeta)
|
||||
):
|
||||
if key.meta.tap_interrupted and is_pressed:
|
||||
append_buffer = True
|
||||
|
||||
# apply changes with 'side-effects' on key_states or the loop behaviour
|
||||
@@ -115,10 +112,8 @@ class HoldTap(Module):
|
||||
self.key_buffer.append((int_coord, current_key, is_pressed))
|
||||
current_key = None
|
||||
|
||||
elif send_buffer:
|
||||
if send_buffer:
|
||||
self.send_key_buffer(keyboard)
|
||||
keyboard.resume_process_key(self, current_key, is_pressed, int_coord)
|
||||
current_key = None
|
||||
|
||||
return current_key
|
||||
|
||||
@@ -226,8 +221,11 @@ class HoldTap(Module):
|
||||
if not self.key_buffer:
|
||||
return
|
||||
|
||||
reprocess = False
|
||||
for (int_coord, key, is_pressed) in self.key_buffer:
|
||||
keyboard.resume_process_key(self, key, is_pressed, int_coord)
|
||||
keyboard.resume_process_key(self, key, is_pressed, int_coord, reprocess)
|
||||
if isinstance(key.meta, HoldTapKeyMeta):
|
||||
reprocess = True
|
||||
|
||||
self.key_buffer.clear()
|
||||
|
||||
|
Reference in New Issue
Block a user