Exit on window close

This commit is contained in:
simondlevy
2018-06-30 19:20:28 -04:00
parent 46d2d49392
commit 189a2dcc8d
2 changed files with 6 additions and 6 deletions

View File

@@ -59,8 +59,7 @@ if __name__ == '__main__':
display.setPose(x, y, theta) display.setPose(x, y, theta)
# Exit on ESCape # Exit on window close
key = display.refresh() if not display.refresh():
if key != None and (key&0x1A):
exit(0) exit(0)

View File

@@ -30,6 +30,8 @@ from xvlidar import XVLidar as Lidar
from pltslamshow import SlamShow from pltslamshow import SlamShow
from sys import stdout
if __name__ == '__main__': if __name__ == '__main__':
# Connect to Lidar unit # Connect to Lidar unit
@@ -62,8 +64,7 @@ if __name__ == '__main__':
display.setPose(x, y, theta) display.setPose(x, y, theta)
# Exit on ESCape # Exit on window close
key = display.refresh() if not display.refresh():
if key != None and (key&0x1A):
exit(0) exit(0)