reformatted for black
This commit is contained in:
parent
3c4e74d50e
commit
f02ff1463a
@ -9,6 +9,7 @@ import traceback
|
||||
|
||||
from kmk.modules import Module
|
||||
|
||||
|
||||
class Encoder:
|
||||
|
||||
VELOCITY_MODE = False # not really for detents
|
||||
@ -92,6 +93,7 @@ class Encoder:
|
||||
def vel_report(self):
|
||||
return self._velocity
|
||||
|
||||
|
||||
class EncoderHandler(Module):
|
||||
def __init__(self):
|
||||
self.encoders = []
|
||||
@ -109,8 +111,12 @@ class EncoderHandler(Module):
|
||||
for idx, definition in enumerate(self.i2c):
|
||||
new_encoder = Encoder(*definition)
|
||||
# In our case, we need to define keybord and encoder_id for callbacks
|
||||
new_encoder.on_move_do = lambda x, bound_idx = idx: self.on_move_do(keyboard, bound_idx, x)
|
||||
new_encoder.on_button_do = lambda x, bound_idx = idx: self.on_button_do(keyboard, bound_idx, x)
|
||||
new_encoder.on_move_do = lambda x, bound_idx=idx: self.on_move_do(
|
||||
keyboard, bound_idx, x
|
||||
)
|
||||
new_encoder.on_button_do = lambda x, bound_idx=idx: self.on_button_do(
|
||||
keyboard, bound_idx, x
|
||||
)
|
||||
self.encoders.append(new_encoder)
|
||||
return
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user