aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--helpers/mapping.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/helpers/mapping.py b/helpers/mapping.py
index 4a1cd98..66d860d 100644
--- a/helpers/mapping.py
+++ b/helpers/mapping.py
@@ -5,6 +5,7 @@ from kivy.core.window import Window
5import threading 5import threading
6import pygame 6import pygame
7import yaml 7import yaml
8import sys
8 9
9from .lock import * 10from .lock import *
10from .music_file import * 11from .music_file import *
@@ -29,8 +30,16 @@ class Mapping(RelativeLayout):
29 30
30 def _on_keyboard_down(self, keyboard, keycode, text, modifiers): 31 def _on_keyboard_down(self, keyboard, keycode, text, modifiers):
31 key = self.find_by_key_code(keycode) 32 key = self.find_by_key_code(keycode)
32 if key is not None: 33 if len(modifiers) == 0 and key is not None:
33 threading.Thread(name = "MSKeyAction", target=key.do_actions).start() 34 threading.Thread(name = "MSKeyAction", target=key.do_actions).start()
35 elif 'ctrl' in modifiers and (keycode[0] == 113 or keycode[0] == '99'):
36 for thread in threading.enumerate():
37 if thread.getName()[0:2] != "MS":
38 continue
39 thread.join()
40
41 pygame.quit()
42 sys.exit()
34 return True 43 return True
35 44
36 def find_by_key_code(self, key_code): 45 def find_by_key_code(self, key_code):