fix trackball module forcing reports to zero
This commit is contained in:
parent
b676afe075
commit
5d2a42d9a9
@ -78,15 +78,18 @@ class TrackballHandler:
|
||||
|
||||
class PointingHandler(TrackballHandler):
|
||||
def handle(self, keyboard, trackball, x, y, switch, state):
|
||||
if x >= 0:
|
||||
if x > 0:
|
||||
trackball.pointing_device.report_x[0] = x
|
||||
else:
|
||||
elif x < 0:
|
||||
trackball.pointing_device.report_x[0] = 0xFF & x
|
||||
if y >= 0:
|
||||
if y > 0:
|
||||
trackball.pointing_device.report_y[0] = y
|
||||
else:
|
||||
elif y < 0:
|
||||
trackball.pointing_device.report_y[0] = 0xFF & y
|
||||
trackball.pointing_device.hid_pending = x != 0 or y != 0
|
||||
|
||||
if x != 0 or y != 0:
|
||||
trackball.pointing_device.hid_pending = True
|
||||
|
||||
if switch == 1: # Button pressed
|
||||
trackball.pointing_device.button_status[
|
||||
0
|
||||
@ -110,9 +113,10 @@ class ScrollHandler(TrackballHandler):
|
||||
if self.scroll_direction == ScrollDirection.REVERSE:
|
||||
y = -y
|
||||
|
||||
pointing_device = trackball.pointing_device
|
||||
pointing_device.report_w[0] = 0xFF & y
|
||||
pointing_device.hid_pending = y != 0
|
||||
if y != 0:
|
||||
pointing_device = trackball.pointing_device
|
||||
pointing_device.report_w[0] = 0xFF & y
|
||||
pointing_device.hid_pending = True
|
||||
|
||||
if switch == 1: # Button pressed
|
||||
pointing_device.button_status[0] |= pointing_device.MB_LMB
|
||||
|
Loading…
Reference in New Issue
Block a user