Mercurial > libervia-desktop-kivy
comparison cagou/core/cagou_main.py @ 349:33244f944bd8
core: "key_input" method is now checked and used if suitable in selected widget.
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 17 Jan 2020 18:44:35 +0100 |
parents | 7b9a0e57df53 |
children | 1ac40d3121f6 |
comparison
equal
deleted
inserted
replaced
348:38fd457b2158 | 349:33244f944bd8 |
---|---|
340 | 340 |
341 def on_stop(self): | 341 def on_stop(self): |
342 return local_platform.on_stop() | 342 return local_platform.on_stop() |
343 | 343 |
344 def key_input(self, window, key, scancode, codepoint, modifier): | 344 def key_input(self, window, key, scancode, codepoint, modifier): |
345 | |
346 # we first check if selected widget handles the key | |
347 if ((self.host.selected_widget is not None | |
348 and hasattr(self.host.selected_widget, 'key_input') | |
349 and self.host.selected_widget.key_input(window, key, scancode, codepoint, | |
350 modifier))): | |
351 return True | |
352 | |
345 if key == 27: | 353 if key == 27: |
346 # we disable [esc] handling, because default action is to quit app | 354 # we disable [esc] handling, because default action is to quit app |
347 return True | 355 return True |
348 elif key == 292: | 356 elif key == 292: |
349 # F11: full screen | 357 # F11: full screen |