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

[email protected]
Newsgroups gmane.comp.cms.gnue.cvs
Message-ID <[email protected]>
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 ?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.