Make sure the pen tracking process is terminated on remarkable on exit

Could not figure out a better way, for some reason just closing the client
does not make the `cat /dev/input/event0` process stop.
Suggestions welcome.
This commit is contained in:
Emanuele 2020-05-25 15:23:53 +01:00
parent d2e2921a78
commit ab5c81129f

View file

@ -112,11 +112,13 @@ class PointerWorker(QRunnable):
self.signals = PWSignals()
def stop(self):
self._penkill.write('\n')
self._stop = True
@pyqtSlot()
def run(self):
_, penstream, _ = self.ssh.exec_command('cat /dev/input/event0')
penkill, penstream, _ = self.ssh.exec_command('cat /dev/input/event0 & { read ; kill %1; }')
self._penkill = penkill
new_x = new_y = False
state = LIFTED