Skip to content

Commit 28a34db

Browse files
author
brentru
committed
update update() logic
1 parent 9791997 commit 28a34db

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

adafruit_cursorcontrol/cursorcontrol_cursormanager.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,10 @@ def update(self):
102102
pressed = self._pad.get_pressed()
103103
self._check_cursor_movement(pressed)
104104
if self._is_clicked:
105-
if not pressed & (self._pad_btns['btn_a']):
106-
self._is_clicked = False
107-
if pressed & self._pad_btns['btn_a']:
105+
self._is_clicked = False
106+
elif pressed & self._pad_btns['btn_a']:
108107
self._is_clicked = True
109108

110-
111109
def _read_joystick_x(self, samples=3):
112110
"""Read the X analog joystick on the PyGamer.
113111
:param int samples: How many samples to read and average.

0 commit comments

Comments
 (0)