case MULTIBYTE_CHAR_KEYSTROKE_EVENT:
{
Lisp_Object lispy_c;
+ int c = event->code;
- XSETFASTINT (lispy_c, event->code);
+ /* Add in the other modifier bits. We took care of ctrl_modifier
+ just above, and the shift key was taken care of by the X code,
+ and applied to control characters by make_ctrl_char. */
+ c |= (event->modifiers
+ & (meta_modifier | alt_modifier
+ | hyper_modifier | super_modifier | ctrl_modifier));
+ /* What about the `shift' modifier ? */
+ button_down_time = 0;
+ XSETFASTINT (lispy_c, c);
return lispy_c;
}
such as Vfunction_key_map and Vkey_translation_map. */
typedef struct keyremap
{
- Lisp_Object map;
+ Lisp_Object map, parent;
int start, end;
} keyremap;
The return value is non-zero if the remapping actually took place. */
static int
-keyremap_step (keybuf, bufsize, fkey, input, doit, diff, parent, prompt)
- Lisp_Object *keybuf, prompt, parent;
+keyremap_step (keybuf, bufsize, fkey, input, doit, diff, prompt)
+ Lisp_Object *keybuf, prompt;
keyremap *fkey;
int input, doit, *diff, bufsize;
{
= Faref (next, make_number (i));
fkey->start = fkey->end += *diff;
- fkey->map = parent;
+ fkey->map = fkey->parent;
return 1;
}
if (!CONSP (fkey->map))
{
fkey->end = ++fkey->start;
- fkey->map = parent;
+ fkey->map = fkey->parent;
}
return 0;
}
last_nonmenu_event = Qnil;
delayed_switch_frame = Qnil;
- fkey.map = Vfunction_key_map;
- keytran.map = Vkey_translation_map;
+ fkey.map = fkey.parent = Vfunction_key_map;
+ keytran.map = keytran.parent = Vkey_translation_map;
/* If there is no translation-map, turn off scanning. */
fkey.start = fkey.end = KEYMAPP (fkey.map) ? 0 : bufsize + 1;
keytran.start = keytran.end = KEYMAPP (keytran.map) ? 0 : bufsize + 1;
keybuf[i - first_unbound - 1] = keybuf[i];
mock_input = t - first_unbound - 1;
fkey.end = fkey.start -= first_unbound + 1;
- fkey.map = Vfunction_key_map;
+ fkey.map = fkey.parent;
keytran.end = keytran.start -= first_unbound + 1;
- keytran.map = Vkey_translation_map;
+ keytran.map = keytran.parent;
goto replay_sequence;
}
invariant that keytran.end <= fkey.start). */
{
if (fkey.start < t)
- (fkey.start = fkey.end = t, fkey.map = Vfunction_key_map);
+ (fkey.start = fkey.end = t, fkey.map = fkey.parent);
}
else
/* If the sequence is unbound, see if we can hang a function key
first_binding >= nmaps) we don't want
to apply this function-key-mapping. */
fkey.end + 1 == t && first_binding >= nmaps,
- &diff, Vfunction_key_map, prompt);
+ &diff, prompt);
UNGCPRO;
if (done)
{
GCPRO3 (fkey.map, keytran.map, delayed_switch_frame);
done = keyremap_step (keybuf, bufsize, &keytran, max (t, mock_input),
- 1, &diff, Vkey_translation_map, prompt);
+ 1, &diff, prompt);
UNGCPRO;
if (done)
{