commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnue] r9600 - trunk/gnue-forms/src/uidrivers/qt3/widgets


From: johannes
Subject: [gnue] r9600 - trunk/gnue-forms/src/uidrivers/qt3/widgets
Date: Tue, 22 May 2007 03:09:44 -0500 (CDT)

Author: johannes
Date: 2007-05-22 03:09:44 -0500 (Tue, 22 May 2007)
New Revision: 9600

Modified:
   trunk/gnue-forms/src/uidrivers/qt3/widgets/entry.py
Log:
Only pass Tab- and Return-Keys to the Keymapper


Modified: trunk/gnue-forms/src/uidrivers/qt3/widgets/entry.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/qt3/widgets/entry.py 2007-05-22 07:30:43 UTC 
(rev 9599)
+++ trunk/gnue-forms/src/uidrivers/qt3/widgets/entry.py 2007-05-22 08:09:44 UTC 
(rev 9600)
@@ -366,17 +366,22 @@
         keycode = event.key()
         state = event.state()
 
-        (command, args) = GFKeyMapper.KeyMapper.getEvent(keycode,
-                state & qt.QKeyEvent.ShiftButton > 0,
-                state & qt.QKeyEvent.ControlButton > 0,
-                state & qt.QKeyEvent.AltButton > 0)
+        # We will ask the Key-Mapper for a command only for Tab- and
+        # Return-Keys.  Everything else should be handled by the widget
+        is_cmd = keycode in [qt.Qt.Key_Tab, qt.Qt.Key_Return]
 
-        if command:
-            if command == 'NEWLINE':
-                self.ui_widget._request(command, text = '\n')
-            else:
-                self.ui_widget._request(command, triggerName = args)
+        if is_cmd:
+            (command, args) = GFKeyMapper.KeyMapper.getEvent(keycode,
+                    state & qt.QKeyEvent.ShiftButton > 0,
+                    state & qt.QKeyEvent.ControlButton > 0,
+                    state & qt.QKeyEvent.AltButton > 0)
 
+            if command is not None:
+                if command == 'NEWLINE':
+                    self.ui_widget._request(command, text = '\n')
+                else:
+                    self.ui_widget._request(command, triggerName = args)
+
         else:
             # TODO: is there another way to find the qt widget class which
             # is implemented by the class of this Mixin ?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]