Skip to content

Commit

Permalink
Update pimoroni_trackball.py
Browse files Browse the repository at this point in the history
Change variable names
  • Loading branch information
regicidalplutophage authored Jul 26, 2024
1 parent 8c3cab9 commit eaeddd3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions kmk/modules/pimoroni_trackball.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ def handle(self, keyboard, trackball, x, y, switch, state):


class PointingHandler(TrackballHandler):
def __init__(self, press=KC.MB_LMB):
self.press = press
def __init__(self, on_press=KC.MB_LMB):
self.on_press = on_press

def handle(self, keyboard, trackball, x, y, switch, state):
if x:
Expand All @@ -86,13 +86,13 @@ def handle(self, keyboard, trackball, x, y, switch, state):
AX.Y.move(keyboard, y)

if switch == 1: # Button changed state
keyboard.pre_process_key(self.press, is_pressed=state)
keyboard.pre_process_key(self.on_press, is_pressed=state)


class ScrollHandler(TrackballHandler):
def __init__(self, scroll_direction=ScrollDirection.NATURAL, press=KC.MB_LMB):
def __init__(self, scroll_direction=ScrollDirection.NATURAL, on_press=KC.MB_LMB):
self.scroll_direction = scroll_direction
self.press = press
self.on_press = on_press

def handle(self, keyboard, trackball, x, y, switch, state):
if self.scroll_direction == ScrollDirection.REVERSE:
Expand All @@ -102,7 +102,7 @@ def handle(self, keyboard, trackball, x, y, switch, state):
AX.W.move(keyboard, y)

if switch == 1: # Button changed state
keyboard.pre_process_key(self.press, is_pressed=state)
keyboard.pre_process_key(self.on_press, is_pressed=state)


class KeyHandler(TrackballHandler):
Expand Down

0 comments on commit eaeddd3

Please sign in to comment.