aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c40
1 files changed, 25 insertions, 15 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 07d14959f7f..2c9ae41764b 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -385,7 +385,7 @@ extern Lisp_Object Vcommand_line_args, Vsystem_name;
385 385
386extern Lisp_Object Vx_no_window_manager; 386extern Lisp_Object Vx_no_window_manager;
387 387
388extern Lisp_Object Qface, Qmouse_face; 388extern Lisp_Object Qface, Qmouse_face, Qeql;
389 389
390extern int errno; 390extern int errno;
391 391
@@ -396,6 +396,7 @@ extern int extra_keyboard_modifiers;
396/* The keysyms to use for the various modifiers. */ 396/* The keysyms to use for the various modifiers. */
397 397
398Lisp_Object Vx_alt_keysym, Vx_hyper_keysym, Vx_meta_keysym, Vx_super_keysym; 398Lisp_Object Vx_alt_keysym, Vx_hyper_keysym, Vx_meta_keysym, Vx_super_keysym;
399Lisp_Object Vx_keysym_table;
399static Lisp_Object Qalt, Qhyper, Qmeta, Qsuper, Qmodifier_value; 400static Lisp_Object Qalt, Qhyper, Qmeta, Qsuper, Qmodifier_value;
400 401
401static Lisp_Object Qvendor_specific_keysyms; 402static Lisp_Object Qvendor_specific_keysyms;
@@ -10641,11 +10642,25 @@ XTread_socket (sd, bufp, numchars, expected)
10641#endif /* not HAVE_X11R5 */ 10642#endif /* not HAVE_X11R5 */
10642 )) 10643 ))
10643 { 10644 {
10645 Lisp_Object c;
10646
10644 if (temp_index == sizeof temp_buffer / sizeof (short)) 10647 if (temp_index == sizeof temp_buffer / sizeof (short))
10645 temp_index = 0; 10648 temp_index = 0;
10646 temp_buffer[temp_index++] = keysym; 10649 temp_buffer[temp_index++] = keysym;
10647 bufp->kind = non_ascii_keystroke; 10650 if (! EQ ((c = Fgethash (make_number (keysym),
10648 bufp->code = keysym; 10651 Vx_keysym_table, Qnil)),
10652 Qnil))
10653 {
10654 bufp->kind = (ASCII_CHAR_P (c)
10655 ? ascii_keystroke
10656 : multibyte_char_keystroke);
10657 bufp->code = c;
10658 }
10659 else
10660 {
10661 bufp->kind = non_ascii_keystroke;
10662 bufp->code = keysym;
10663 }
10649 XSETFRAME (bufp->frame_or_window, f); 10664 XSETFRAME (bufp->frame_or_window, f);
10650 bufp->arg = Qnil; 10665 bufp->arg = Qnil;
10651 bufp->modifiers 10666 bufp->modifiers
@@ -10670,18 +10685,8 @@ XTread_socket (sd, bufp, numchars, expected)
10670 temp_buffer[temp_index++] = copy_bufptr[i]; 10685 temp_buffer[temp_index++] = copy_bufptr[i];
10671 } 10686 }
10672 10687
10673 if (/* If the event is not from XIM, */
10674 event.xkey.keycode != 0
10675 /* or the current locale doesn't request
10676 decoding of the input data, ... */
10677 || ! CODING_REQUIRE_DECODING (&coding))
10678 {
10679 /* ... we can use the input data as is. */
10680 nchars = nbytes;
10681 }
10682 else
10683 { 10688 {
10684 /* We have to decode the input data. */ 10689 /* Decode the input data. */
10685 coding.destination 10690 coding.destination
10686 = (unsigned char *) malloc (nbytes); 10691 = (unsigned char *) malloc (nbytes);
10687 if (! coding.destination) 10692 if (! coding.destination)
@@ -14490,7 +14495,6 @@ x_get_font_repertory (f, font_info)
14490 struct font_info *font_info; 14495 struct font_info *font_info;
14491{ 14496{
14492 XFontStruct *font = (XFontStruct *) font_info->font; 14497 XFontStruct *font = (XFontStruct *) font_info->font;
14493 struct charset *charset = CHARSET_FROM_ID (font_info->charset);
14494 Lisp_Object table; 14498 Lisp_Object table;
14495 int min_byte1, max_byte1, min_byte2, max_byte2; 14499 int min_byte1, max_byte1, min_byte2, max_byte2;
14496 14500
@@ -15295,6 +15299,12 @@ For example, `super' means use the Super_L and Super_R keysyms. The
15295default is nil, which is the same as `super'. */); 15299default is nil, which is the same as `super'. */);
15296 Vx_super_keysym = Qnil; 15300 Vx_super_keysym = Qnil;
15297 15301
15302 DEFVAR_LISP ("x-keysym-table", &Vx_keysym_table,
15303 doc: /* Hash table of character codes indexed by X keysym codes. */);
15304 Vx_keysym_table = make_hash_table (Qeql, make_number (800),
15305 make_number (DEFAULT_REHASH_SIZE),
15306 make_number (DEFAULT_REHASH_THRESHOLD),
15307 Qnil, Qnil, Qnil);
15298} 15308}
15299 15309
15300#endif /* HAVE_X_WINDOWS */ 15310#endif /* HAVE_X_WINDOWS */