]> git.eshelyaron.com Git - emacs.git/commitdiff
(read_key_sequence): Adjust fkey and keytran when dropping `down' events.
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 24 May 2003 14:52:10 +0000 (14:52 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 24 May 2003 14:52:10 +0000 (14:52 +0000)
src/keyboard.c

index dd8b751c8d5d358a7b986ea38c1b25c929c31099..c8780867bb0cdca91f31a980635746886273570b 100644 (file)
@@ -9138,6 +9138,27 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
                             xterm-mouse-mode.  -stef
 
                             Isn't this just the most wonderful code ever?  */
+
+                         /* If mock_input > t + 1, the above simplification
+                            will actually end up dropping keys on the floor.
+                            This is probably OK for now, but even
+                            if mock_input <= t + 1, we need to adjust fkey
+                            and keytran.
+                            Typical case [header-line down-mouse-N]:
+                            mock_input = 2, t = 1, fkey.end = 1,
+                            last_real_key_start = 0.  */
+                         if (fkey.end > last_real_key_start)
+                           {
+                             fkey.end = fkey.start
+                               = min (last_real_key_start, fkey.start);
+                             fkey.map = fkey.parent;
+                             if (keytran.end > last_real_key_start)
+                               {
+                                 keytran.end = keytran.start
+                                   = min (last_real_key_start, keytran.start);
+                                 keytran.map = keytran.parent;
+                               }
+                           }
                          if (t == last_real_key_start)
                            {
                              mock_input = 0;