From 2c834fb35bbe69c629333796a58b98b18c13007b Mon Sep 17 00:00:00 2001 From: Karl Heuer Date: Fri, 9 Jun 1995 19:15:55 +0000 Subject: [PATCH] (modify_event_symbol): Mask out high bits here, and only for certain purposes. table_size now unsigned. (modify_event_symbol) [HAVE_X_WINDOWS]: Use x_get_keysym_name. (make_lispy_event): Don't mask high bits here. Supply -1 as table_size for system-specific keys. --- src/keyboard.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/keyboard.c b/src/keyboard.c index 6e4485b1460..45890ee9944 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -440,6 +440,8 @@ Lisp_Object recursive_edit_unwind (), command_loop (); Lisp_Object Fthis_command_keys (); Lisp_Object Qextended_command_history; +extern char *x_get_keysym_name (); + Lisp_Object Qpolling_period; extern Lisp_Object Vprint_level, Vprint_length; @@ -3003,11 +3005,11 @@ make_lispy_event (event) since we can't make a vector long enuf. */ if (NILP (system_key_syms)) system_key_syms = Fcons (Qnil, Qnil); - return modify_event_symbol (event->code & 0xffffff, + return modify_event_symbol (event->code, event->modifiers, Qfunction_key, current_kboard->Vsystem_key_alist, - 0, &system_key_syms, 0xffffff); + 0, &system_key_syms, (unsigned)-1); } return modify_event_symbol (event->code - 0xff00, @@ -3722,12 +3724,13 @@ modify_event_symbol (symbol_num, modifiers, symbol_kind, name_alist, Lisp_Object name_alist; char **name_table; Lisp_Object *symbol_table; - int table_size; + unsigned int table_size; { Lisp_Object value; Lisp_Object symbol_int; - XSETINT (symbol_int, symbol_num); + /* Get rid of the "vendor-specific" bit here. */ + XSETINT (symbol_int, symbol_num & 0xffffff); /* Is this a request for a valid symbol? */ if (symbol_num < 0 || symbol_num >= table_size) @@ -3763,6 +3766,15 @@ modify_event_symbol (symbol_num, modifiers, symbol_kind, name_alist, else if (name_table[symbol_num]) value = intern (name_table[symbol_num]); +#ifdef HAVE_X_WINDOWS + if (NILP (value)) + { + char *name = x_get_keysym_name (symbol_num); + if (name) + value = intern (name); + } +#endif + if (NILP (value)) { char buf[20]; -- 2.39.2