Fix.
authorRadek Brich <radek.brich@devl.cz>
Wed, 23 Jan 2013 00:59:21 +0100
changeset 66 824a9837bbb3
parent 65 5f0697950f15
child 67 71f60bf6ebb7
Fix.
tuikit/driver_curses.py
--- a/tuikit/driver_curses.py	Wed Jan 23 00:50:23 2013 +0100
+++ b/tuikit/driver_curses.py	Wed Jan 23 00:59:21 2013 +0100
@@ -19,6 +19,7 @@
         (0x1b,0x4f,0x52,            'f3'            ),  # xterm
         (0x1b,0x4f,0x53,            'f4'            ),  # xterm
         (0x1b,0x5b,                 'CSI'           ),  # see csi_codes
+        (0x1b,0x5b,0x4d,            'mouse'         ),
     )
 
     # http://en.wikipedia.org/wiki/ANSI_escape_code
@@ -44,7 +45,6 @@
         (0x44,              1,      'left'          ),
         (0x46,              1,      'end'           ),  # xterm
         (0x48,              1,      'home'          ),  # xterm
-        (0x4d,              None,   'mouse'         ),
         (0x5b,0x41,         1,      'f1'            ),  # linux
         (0x5b,0x42,         1,      'f2'            ),  # linux
         (0x5b,0x43,         1,      'f3'            ),  # linux
@@ -384,6 +384,9 @@
                 ','.join(['0x%x'%x for x in consumed]))
             return [('keypress', 'Unknown', None)]
 
+        if keyname == 'mouse':
+            return self.process_xterm_mouse()
+
         if keyname == 'CSI':
             return self.process_control_sequence()
 
@@ -483,9 +486,6 @@
 
         keyname = matching_codes[0][1]
 
-        if keyname == 'mouse':
-            return self.process_xterm_mouse()
-
         # modifiers
         mod = 0
         if len(params) > 1: