import threading
import pygame
import yaml
+import sys
from .lock import *
from .music_file import *
def _on_keyboard_down(self, keyboard, keycode, text, modifiers):
key = self.find_by_key_code(keycode)
- if key is not None:
+ if len(modifiers) == 0 and key is not None:
threading.Thread(name = "MSKeyAction", target=key.do_actions).start()
+ elif 'ctrl' in modifiers and (keycode[0] == 113 or keycode[0] == '99'):
+ for thread in threading.enumerate():
+ if thread.getName()[0:2] != "MS":
+ continue
+ thread.join()
+
+ pygame.quit()
+ sys.exit()
return True
def find_by_key_code(self, key_code):