Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update pimoroni_trackball.py
Browse files Browse the repository at this point in the history
Change variable names
regicidalplutophage authored Jul 26, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
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
@@ -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:
@@ -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:
@@ -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):

0 comments on commit eaeddd3

Please sign in to comment.