Resolve issues with leader mode, allow single-key targets (HID or internal)

This commit is contained in:
Josh Klar
2018-12-29 16:52:06 -08:00
parent ea63c888d6
commit 0878538f42
3 changed files with 18 additions and 2 deletions

View File

@@ -182,7 +182,9 @@ class Firmware:
new_key = tuple(KC[c] for c in k)
self.leader_dictionary[new_key] = v
del self.leader_dictionary[k]
for k, v in self.leader_dictionary.items():
if not isinstance(k, tuple):
del self.leader_dictionary[k]
if self.debug_enabled:
print("Firin' lazers. Keyboard is booted.")
@@ -216,6 +218,9 @@ class Firmware:
if old_timeouts_len != new_timeouts_len:
state_changed = True
if self._state.hid_pending:
self._send_hid()
if self.debug_enabled and state_changed:
print('New State: {}'.format(self._state._to_dict()))