static Lisp_Object
kbd_buffer_get_event_1 (Lisp_Object arg)
{
- return code_convert_string (arg, Vlocale_coding_system,
+ Lisp_Object coding_system = Fget_text_property (make_fixnum (0),
+ Qcoding, arg);
+
+ return code_convert_string (arg, (!NILP (coding_system)
+ ? coding_system
+ : Vlocale_coding_system),
Qnil, 0, false, 0);
}
DEFSYM (Qtouchscreen_end, "touchscreen-end");
DEFSYM (Qtouchscreen_update, "touchscreen-update");
DEFSYM (Qpinch, "pinch");
+
+ DEFSYM (Qcoding, "coding");
+
Fset (Qecho_area_clear_hook, Qnil);
DEFVAR_LISP ("lucid-menu-bar-dirty-flag", Vlucid_menu_bar_dirty_flag,
decoded and the decoded
string's characters will be
used as .code
- individually. */
+ individually.
+
+ The string can have a
+ property `coding', which
+ should be a symbol
+ describing a coding system
+ to use to decode the string.
+
+ If it is nil, then the
+ locale coding system will
+ be used. */
NON_ASCII_KEYSTROKE_EVENT, /* .code is a number identifying the
function key. A code N represents
a key whose name is
static XComposeStatus compose_status;
XEvent configureEvent;
XEvent next_event;
+ Lisp_Object coding;
*finish = X_EVENT_NORMAL;
case KeyPress:
x_display_set_last_user_time (dpyinfo, event->xkey.time);
ignore_next_mouse_click_timeout = 0;
+ coding = Qlatin_1;
#if defined (USE_X_TOOLKIT) || defined (USE_GTK)
/* Dispatch KeyPress events when in menu. */
&xkey, (char *) copy_bufptr,
copy_bufsiz, &keysym,
&status_return);
+ coding = Qnil;
if (status_return == XBufferOverflow)
{
copy_bufsiz = nbytes + 1;
inev.ie.kind = MULTIBYTE_CHAR_KEYSTROKE_EVENT;
inev.ie.arg = make_unibyte_string ((char *) copy_bufptr, nbytes);
+ Fput_text_property (make_fixnum (0), make_fixnum (nbytes),
+ Qcoding, coding, inev.ie.arg);
+
if (keysym == NoSymbol)
break;
}
ptrdiff_t i;
struct xi_device_t *device;
+ coding = Qlatin_1;
+
device = xi_device_from_id (dpyinfo, xev->deviceid);
if (!device || !device->master_p)
&xkey, (char *) copy_bufptr,
copy_bufsiz, &keysym,
&status_return);
+ coding = Qnil;
if (status_return == XBufferOverflow)
{
if (overflow)
nbytes = 0;
}
+
+ coding = Qnil;
}
else
#endif
inev.ie.kind = MULTIBYTE_CHAR_KEYSTROKE_EVENT;
inev.ie.arg = make_unibyte_string (copy_bufptr, nbytes);
+
+ Fput_text_property (make_fixnum (0), make_fixnum (nbytes),
+ Qcoding, coding, inev.ie.arg);
goto xi_done_keysym;
}