@@ -145,11 +145,10 @@ def _read_joystick_y(self, samples=3):
145
145
reading -= JOY_Y_CTR
146
146
return reading
147
147
148
- def _check_cursor_movement (self , pressed = None , variance = 100 ):
148
+ def _check_cursor_movement (self , pressed = None ):
149
149
"""Checks the PyBadge D-Pad or the PyGamer's Joystick for movement.
150
150
:param int pressed: 8-bit number with bits that correspond to buttons
151
151
which have been pressed down since the last call to get_pressed().
152
- :param int variance: Drift amount, defaults to 100. Adjust for lower sensitivity.
153
152
"""
154
153
if hasattr (board , "BUTTON_CLOCK" ) and not hasattr (board , "JOYSTICK_X" ):
155
154
if pressed & self ._pad_btns ["btn_right" ]:
@@ -163,13 +162,13 @@ def _check_cursor_movement(self, pressed=None, variance = 100):
163
162
elif hasattr (board , "JOYSTICK_X" ):
164
163
joy_x = self ._read_joystick_x ()
165
164
joy_y = self ._read_joystick_y ()
166
- if joy_x > self ._center_x + variance :
165
+ if joy_x > self ._center_x + 100 :
167
166
self ._cursor .x += self ._cursor .speed
168
- elif joy_x < self ._center_x - variance :
167
+ elif joy_x < self ._center_x - 100 :
169
168
self ._cursor .x -= self ._cursor .speed
170
- if joy_y > self ._center_y + variance :
169
+ if joy_y > self ._center_y + 100 :
171
170
self ._cursor .y += self ._cursor .speed
172
- elif joy_y < self ._center_y - variance :
171
+ elif joy_y < self ._center_y - 100 :
173
172
self ._cursor .y -= self ._cursor .speed
174
173
else :
175
174
raise AttributeError (
0 commit comments