# HG changeset patch # User Goffi # Date 1579283075 -3600 # Node ID 33244f944bd8b0bd4fb2fe3d5917557a76c81584 # Parent 38fd457b2158b2a080ceaee15e395b111bc63808 core: "key_input" method is now checked and used if suitable in selected widget. diff -r 38fd457b2158 -r 33244f944bd8 cagou/core/cagou_main.py --- a/cagou/core/cagou_main.py Fri Jan 17 18:44:32 2020 +0100 +++ b/cagou/core/cagou_main.py Fri Jan 17 18:44:35 2020 +0100 @@ -342,6 +342,14 @@ return local_platform.on_stop() def key_input(self, window, key, scancode, codepoint, modifier): + + # we first check if selected widget handles the key + if ((self.host.selected_widget is not None + and hasattr(self.host.selected_widget, 'key_input') + and self.host.selected_widget.key_input(window, key, scancode, codepoint, + modifier))): + return True + if key == 27: # we disable [esc] handling, because default action is to quit app return True diff -r 38fd457b2158 -r 33244f944bd8 cagou/plugins/plugin_wid_remote.py --- a/cagou/plugins/plugin_wid_remote.py Fri Jan 17 18:44:32 2020 +0100 +++ b/cagou/plugins/plugin_wid_remote.py Fri Jan 17 18:44:35 2020 +0100 @@ -34,7 +34,6 @@ from kivy.uix.label import Label from kivy.uix.boxlayout import BoxLayout from kivy.uix.floatlayout import FloatLayout -from kivy.core.window import Window from cagou import G from functools import partial @@ -187,7 +186,6 @@ cagou_widget.CagouWidget.__init__(self) FilterBehavior.__init__(self) TouchMenuBehaviour.__init__(self) - Window.bind(on_keyboard=self.key_input) self.stack_layout = None self.showRootWidget()