[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Mouse menu key bindings
From: |
Stefan Monnier |
Subject: |
Re: Mouse menu key bindings |
Date: |
Tue, 29 Apr 2003 16:06:16 -0400 |
> The `C-<mouse-2>' mouse menu display some weird "key bindings" --
> stuff like:
>
> isearch (<C-down-mouse-2><fc><isearch>)
> Indent More (<C-down-mouse-2><in><increase-left-margin>)
Hmm... I see what's going on. Here is what happens:
When the event C-down-mouse-2 is built, apply_modifiers sets up
the event's info correctly, marking the event as being derived
from `mouse-2' with the C- and the down- modifiers applied to it.
OTOH, if parse_modifiers is called on the `C-down-mouse-2' symbol
before such an event is built, the event's info is computed from
the symbol name an in that case the `down-' part is not recognized.
The patch below fixes the above problem, but I'm not sure if it's
the right thing to do because I'm not sure if `C-down-f8' should
be parsed as (control down f8) or as (control down-f8).
Stefan
--- keyboard.c.~1.734.~ Fri Apr 11 19:43:50 2003
+++ keyboard.c Tue Apr 29 15:56:45 2003
@@ -5839,6 +5839,26 @@
break;
#undef SINGLE_LETTER_MOD
+
+#define MULTI_LETTER_MOD(BIT, NAME, LEN) \
+ if (i + LEN + 1 <= SBYTES (name) \
+ && ! strncmp (SDATA (name) + i, NAME, LEN)) \
+ { \
+ this_mod_end = i + LEN; \
+ this_mod = BIT; \
+ }
+
+ case 'd':
+ MULTI_LETTER_MOD (drag_modifier, "drag", 4);
+ MULTI_LETTER_MOD (down_modifier, "down", 4);
+ MULTI_LETTER_MOD (double_modifier, "double", 6);
+ break;
+
+ case 't':
+ MULTI_LETTER_MOD (triple_modifier, "triple", 6);
+ break;
+#undef MULTI_LETTER_MOD
+
}
/* If we found no modifier, stop looking for them. */