refactor handling of key processing resume to KMKKeyboard

This commit is contained in:
xs5871 2022-08-05 19:22:04 +00:00 committed by Kyle Brown
parent e71d1fcb6e
commit c95efbe8ea
3 changed files with 6 additions and 2 deletions

View File

@ -191,6 +191,10 @@ class KMKKeyboard:
return self
def resume_process_key(self, key, is_pressed, int_coord, module):
index = self.modules.index(module) + 1
self.pre_process_key(key, is_pressed, int_coord, index)
def remove_key(self, keycode):
self.keys_pressed.discard(keycode)
return self.process_key(keycode, False)

View File

@ -266,7 +266,7 @@ class Combos(Module):
if new_key is None:
new_key = keyboard._find_key_in_map(int_coord)
keyboard.pre_process_key(new_key, is_pressed, int_coord, self._next_module)
keyboard.resume_process_key(new_key, is_pressed, int_coord, self)
keyboard._send_hid()
def activate(self, keyboard, combo):

View File

@ -178,7 +178,7 @@ class HoldTap(Module):
def send_key_buffer(self, keyboard):
for (int_coord, key) in self.key_buffer:
new_key = keyboard._find_key_in_map(int_coord)
keyboard.pre_process_key(new_key, True, int_coord, self._next_module)
keyboard.resume_process_key(new_key, True, int_coord, self)
keyboard._send_hid()
self.key_buffer.clear()