diff cagou/plugins/plugin_wid_chat.py @ 357:4d3a0c4f2430

core: better back key (ESC) management: - back key (which is mapped to esc keycode by SDL2 backend) is now handler with a platform specific method when on root widget (i.e. a default widget is selected, or nothing is selected). Default behaviour is to do nothing, while on Android the app is put to background - CagouWidget now has a default key_input method which go back to default widget.
author Goffi <goffi@goffi.org>
date Sat, 18 Jan 2020 23:12:52 +0100
parents 307c2501d8b2
children abb57182ebfb
line wrap: on
line diff
--- a/cagou/plugins/plugin_wid_chat.py	Fri Jan 17 20:35:57 2020 +0100
+++ b/cagou/plugins/plugin_wid_chat.py	Sat Jan 18 23:12:52 2020 +0100
@@ -886,16 +886,6 @@
             G.host.switchWidget(
                 self, factory(plugin_info, contact_jid, profiles=[self.profile]))
 
-    @property
-    def profiles(self):
-        return [self.profile]
-
-    def key_input(self, window, key, scancode, codepoint, modifier):
-        if key == 27:
-            # we go back to root screen
-            G.host.switchWidget(self)
-            return True
-
 
 PLUGIN_INFO["factory"] = Chat.factory
 quick_widgets.register(quick_chat.QuickChat, Chat)