@@ -76,19 +76,23 @@ def handle(self, keyboard, trackball, x, y, switch, state):
76
76
77
77
78
78
class PointingHandler (TrackballHandler ):
79
+ def __init__ (self , on_press = KC .MB_LMB ):
80
+ self .on_press = on_press
81
+
79
82
def handle (self , keyboard , trackball , x , y , switch , state ):
80
83
if x :
81
84
AX .X .move (keyboard , x )
82
85
if y :
83
86
AX .Y .move (keyboard , y )
84
87
85
88
if switch == 1 : # Button changed state
86
- keyboard .pre_process_key (KC . MB_LMB , is_pressed = state )
89
+ keyboard .pre_process_key (self . on_press , is_pressed = state )
87
90
88
91
89
92
class ScrollHandler (TrackballHandler ):
90
- def __init__ (self , scroll_direction = ScrollDirection .NATURAL ):
93
+ def __init__ (self , scroll_direction = ScrollDirection .NATURAL , on_press = KC . MB_LMB ):
91
94
self .scroll_direction = scroll_direction
95
+ self .on_press = on_press
92
96
93
97
def handle (self , keyboard , trackball , x , y , switch , state ):
94
98
if self .scroll_direction == ScrollDirection .REVERSE :
@@ -98,7 +102,7 @@ def handle(self, keyboard, trackball, x, y, switch, state):
98
102
AX .W .move (keyboard , y )
99
103
100
104
if switch == 1 : # Button changed state
101
- keyboard .pre_process_key (KC . MB_LMB , is_pressed = state )
105
+ keyboard .pre_process_key (self . on_press , is_pressed = state )
102
106
103
107
104
108
class KeyHandler (TrackballHandler ):
0 commit comments