remove keyboard.current_key (never actually used)
This commit is contained in:
parent
e04a01c25e
commit
642790b2e7
@ -42,7 +42,6 @@ class KMKKeyboard:
|
||||
_hid_helper = None
|
||||
_hid_send_enabled = False
|
||||
hid_pending = False
|
||||
current_key = None
|
||||
matrix_update = None
|
||||
secondary_matrix_update = None
|
||||
matrix_update_queue = []
|
||||
@ -147,43 +146,42 @@ class KMKKeyboard:
|
||||
if self.debug_enabled:
|
||||
print('MatrixChange(ic={} pressed={})'.format(int_coord, is_pressed))
|
||||
|
||||
key = None
|
||||
if not is_pressed:
|
||||
try:
|
||||
self.current_key = self._coordkeys_pressed[int_coord]
|
||||
key = self._coordkeys_pressed[int_coord]
|
||||
except KeyError:
|
||||
print(f'KeyNotPressed(ic={int_coord})')
|
||||
if self.debug_enabled:
|
||||
print('PressedKeyResolution(key={})'.format(self.current_key))
|
||||
print('PressedKeyResolution(key={})'.format(key))
|
||||
|
||||
if self.current_key is None:
|
||||
self.current_key = self._find_key_in_map(int_coord)
|
||||
if key is None:
|
||||
key = self._find_key_in_map(int_coord)
|
||||
|
||||
if self.current_key is None:
|
||||
if key is None:
|
||||
print('MatrixUndefinedCoordinate(ic={})'.format(int_coord))
|
||||
return self
|
||||
|
||||
self.pre_process_key(self.current_key, is_pressed, int_coord)
|
||||
self.pre_process_key(key, is_pressed, int_coord)
|
||||
|
||||
def pre_process_key(self, key, is_pressed, int_coord=None):
|
||||
self.current_key = key
|
||||
for module in self.modules:
|
||||
try:
|
||||
self.current_key = module.process_key(
|
||||
self, self.current_key, is_pressed, int_coord
|
||||
)
|
||||
if self.current_key is None:
|
||||
key = module.process_key(self, key, is_pressed, int_coord)
|
||||
if key is None:
|
||||
break
|
||||
except Exception as err:
|
||||
if self.debug_enabled:
|
||||
print('Failed to run process_key function in module: ', err, module)
|
||||
|
||||
if int_coord is not None:
|
||||
if is_pressed:
|
||||
self._coordkeys_pressed[int_coord] = self.current_key
|
||||
self._coordkeys_pressed[int_coord] = key
|
||||
else:
|
||||
del self._coordkeys_pressed[int_coord]
|
||||
|
||||
if self.current_key:
|
||||
self.process_key(self.current_key, is_pressed, int_coord)
|
||||
if key:
|
||||
self.process_key(key, is_pressed, int_coord)
|
||||
|
||||
return self
|
||||
|
||||
@ -452,7 +450,6 @@ class KMKKeyboard:
|
||||
self._print_debug_cycle(init=True)
|
||||
|
||||
def _main_loop(self):
|
||||
self.current_key = None
|
||||
self.state_changed = False
|
||||
self.sandbox.active_layers = self.active_layers.copy()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user