I am trying to build a program whose first part is saving user clicks for calibration purposes.
I am using PyUserInput for this (on Python 3.5.2) and following your tutorial on GitHub. Currently, this is my code:
from pymouse import PyMouseEvent
positions = []
class Click(PyMouseEvent):
def __init__(self):
PyMouseEvent.__init__(self)
def click(self, x, y, button, press):
if button == 1:
if press:
print('Click! X=%d - Y=%d' % (x, y))
positions.append((x, y))
print(positions)
if len(positions) >= 4:
self.stop()
C = Click()
C.run()
print('Calibrated')
The problem I'm running into is that, even after the PyMouseEvent stops (when position reaches 4 values), I cannot run anything after it (i.e. 'Calibrated' does not print).
How can I continue to run scripts after calling stop() on PyMouseEvent?
I am trying to build a program whose first part is saving user clicks for calibration purposes.
I am using PyUserInput for this (on Python 3.5.2) and following your tutorial on GitHub. Currently, this is my code:
The problem I'm running into is that, even after the PyMouseEvent stops (when position reaches 4 values), I cannot run anything after it (i.e. 'Calibrated' does not print).
How can I continue to run scripts after calling stop() on PyMouseEvent?
I appreciate any help.