changeset 199:3fa4ab9146dd

Implement three phase user input handling First the state is able to filter keys. Afterwards the MainLoop widget is allowed to act on keypress. At last the state is allowed to react on keys.
author Björn Ricks <bjoern.ricks@intevation.de>
date Fri, 05 Apr 2013 19:29:33 +0200
parents 9f85ffa0a2f6
children 2987c6991005
files getan/controller.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/getan/controller.py	Fri Apr 05 19:18:24 2013 +0200
+++ b/getan/controller.py	Fri Apr 05 19:29:33 2013 +0200
@@ -52,7 +52,9 @@
             self.view.loop.screen_size = None
             self.view.loop.draw_screen()
         else:
-            self.state = self.state.keypress(input)
+            input = self.state.input_filter(input, raw_input)
+            self.loop.process_input(input)
+            self.state.handle_input(input)
 
     def load_projects(self):
         projects = self.backend.load_projects()
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)