Update kmk/modules/encoder.py

Co-authored-by: Tonasz <27835465+Tonasz@users.noreply.github.com>
This commit is contained in:
René Giovanni Borella 2022-02-14 23:32:13 +01:00 committed by Kyle Brown
parent 8e4ab1d733
commit 7f7eaafbf3

View File

@ -87,11 +87,7 @@ class BaseEncoder:
self._timestamp = new_timestamp
def button_event(self):
new_button_state = self.pin_button.get_value()
if new_button_state != self._button_state:
self._button_state = new_button_state
if self.on_button_do is not None:
self.on_button_do(self.get_state())
raise NotImplementedError('subclasses must override button_event()!')
# return knob velocity as milliseconds between position changes (detents)
# for backwards compatibility