# HG changeset patch # User Stefan Monnier # Date 1053787930 0 # Node ID 52ab727d168b210714bd95c78668c8d09475a0ba # Parent 4f760005cf14d2f0c41962db16de428c17225677 (read_key_sequence): Adjust fkey and keytran when dropping `down' events. diff -r 4f760005cf14 -r 52ab727d168b src/keyboard.c --- a/src/keyboard.c Sat May 24 14:10:53 2003 +0000 +++ b/src/keyboard.c Sat May 24 14:52:10 2003 +0000 @@ -9138,6 +9138,27 @@ 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;