comparison src/console-x.c @ 3142:77f5a5135b3a

[xemacs-hg @ 2005-12-17 19:46:57 by aidan] Fix self-insert-command with X11 input methods. Addresses Zhang Wei's problem of 871x118lc4.fsf@gmail.com.
author aidan
date Sat, 17 Dec 2005 19:47:03 +0000
parents c1ec282bb160
children 374186f156d5
comparison
equal deleted inserted replaced
3141:66c42fc5d26b 3142:77f5a5135b3a
347 347
348 LISP_STRING_TO_EXTERNAL (key_name, keysym_ext, Qctext); 348 LISP_STRING_TO_EXTERNAL (key_name, keysym_ext, Qctext);
349 xkeysym = XStringToKeysym(keysym_ext); 349 xkeysym = XStringToKeysym(keysym_ext);
350 if (NoSymbol == xkeysym) 350 if (NoSymbol == xkeysym)
351 { 351 {
352 /* Keysym is NoSymbol; this may mean the key event passed to us came
353 from an input method, which stored the actual character intended to
354 be inserted in the key name, and didn't trouble itself to set the
355 keycode to anything useful. Thus, if the key name is a single
356 character, and the keysym is NoSymbol, give it a default binding,
357 if that is possible. */
358 Lisp_Object keychar;
359
360 if (1 != string_char_length(key_name))
361 {
362 /* Don't let them pass us more than one character. */
363 return Qnil;
364 }
365 keychar = make_char(itext_ichar(XSTRING_DATA(key_name)));
366 if (NILP (Flookup_key (Vcurrent_global_map, keychar, Qnil)))
367 {
368 Fdefine_key (Vcurrent_global_map, keychar, Qself_insert_command);
369 Fputhash (keychar, Qt, DEVICE_X_KEYSYM_MAP_HASH_TABLE (d));
370 return Qt;
371 }
352 return Qnil; 372 return Qnil;
353 } 373 }
354 374
355 x_has_keysym(xkeysym, DEVICE_X_KEYSYM_MAP_HASH_TABLE (d), 0); 375 x_has_keysym(xkeysym, DEVICE_X_KEYSYM_MAP_HASH_TABLE (d), 0);
356 376