changeset 143:05d602be0120

core: [esc] key handling is disabled (for now)
author Goffi <goffi@goffi.org>
date Fri, 13 Apr 2018 19:29:35 +0200
parents d276cfec38e8
children ae58f84fe4e6
files cagou/core/cagou_main.py
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/cagou/core/cagou_main.py	Fri Apr 13 19:23:59 2018 +0200
+++ b/cagou/core/cagou_main.py	Fri Apr 13 19:29:35 2018 +0200
@@ -227,6 +227,7 @@
     """Kivy App for Cagou"""
 
     def build(self):
+        Window.bind(on_keyboard=self.key_input)
         return CagouRootWidget(Label(text=u"Loading please wait"))
 
     def showWidget(self):
@@ -272,6 +273,13 @@
             self.cagou_status.flush()
             self.cagou_status_fd.close()
 
+    def key_input(self, window, key, scancode, codepoint, modifier):
+        # we disable [esc] handling, because default action is to quit app
+        if key == 27:
+            return True
+        else:
+            return False
+
 
 class Cagou(QuickApp):
     MB_HANDLE = False