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