mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-20 08:42:11 +08:00
@@ -2,6 +2,8 @@ import atexit
|
||||
import cffi
|
||||
import os
|
||||
import time
|
||||
import signal
|
||||
import sys
|
||||
import pyray as rl
|
||||
import threading
|
||||
from collections.abc import Callable
|
||||
@@ -154,7 +156,11 @@ class GuiApplication:
|
||||
self._window_close_requested = True
|
||||
|
||||
def init_window(self, title: str, fps: int = _DEFAULT_FPS):
|
||||
atexit.register(self.close) # Automatically call close() on exit
|
||||
def _close(sig, frame):
|
||||
self.close()
|
||||
sys.exit(0)
|
||||
signal.signal(signal.SIGINT, _close)
|
||||
atexit.register(self.close)
|
||||
|
||||
HARDWARE.set_display_power(True)
|
||||
HARDWARE.set_screen_brightness(65)
|
||||
|
||||
Reference in New Issue
Block a user