]> git.eshelyaron.com Git - emacs.git/commitdiff
(make_lispy_event): Handle unknown keysyms together
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 3 Apr 2002 04:50:28 +0000 (04:50 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 3 Apr 2002 04:50:28 +0000 (04:50 +0000)
with system-specific keysyms.  Use it also for unknown function keys.

src/ChangeLog
src/keyboard.c

index d8ae770d63e1c0c7b839839d1b5ea8602aa9fe40..4d4eee2dbcc4eb78a28745a4a92749145a65fa16 100644 (file)
@@ -1,5 +1,8 @@
 2002-04-02  Stefan Monnier  <monnier@cs.yale.edu>
 
+       * keyboard.c (make_lispy_event): Handle unknown keysyms together
+       with system-specific keysyms.  Use it also for unknown function keys.
+
        * doc.c (reread_doc_file): Return whether reload was attempted.
        (Fdocumentation, Fdocumentation_property): Don't try to reload
        if the doc is 0 and only ask once.
index 3e263395fe862b4e6ea1f0e7f6a7b08db8dbeaff..3a20949f11253db071174152ae8688b6913f76c1 100644 (file)
@@ -4762,21 +4762,6 @@ make_lispy_event (event)
                                      (sizeof (lispy_accent_keys)
                                       / sizeof (lispy_accent_keys[0])));
 
-      /* Handle system-specific keysyms.  */
-      if (event->code & (1 << 28))
-       {
-         /* We need to use an alist rather than a vector as the cache
-            since we can't make a vector long enuf.  */
-         if (NILP (current_kboard->system_key_syms))
-           current_kboard->system_key_syms = Fcons (Qnil, Qnil);
-         return modify_event_symbol (event->code,
-                                     event->modifiers,
-                                     Qfunction_key,
-                                     current_kboard->Vsystem_key_alist,
-                                     0, &current_kboard->system_key_syms,
-                                     (unsigned) -1);
-       }
-
 #ifdef XK_kana_A
       if (event->code >= 0x400 && event->code < 0x500)
        return modify_event_symbol (event->code - 0x400,
@@ -4796,30 +4781,26 @@ make_lispy_event (event)
                                    iso_lispy_function_keys, &func_key_syms,
                                    (sizeof (iso_lispy_function_keys)
                                     / sizeof (iso_lispy_function_keys[0])));
-      else
 #endif
 
-#ifdef HAVE_X_WINDOWS
-      if (event->code - FUNCTION_KEY_OFFSET < 0
+      /* Handle system-specific or unknown keysyms.  */
+      if (event->code & (1 << 28)
+         || event->code - FUNCTION_KEY_OFFSET < 0
          || (event->code - FUNCTION_KEY_OFFSET
-             >= sizeof lispy_function_keys / sizeof *lispy_function_keys))
+             >= sizeof lispy_function_keys / sizeof *lispy_function_keys)
+         || !lispy_function_keys[event->code - FUNCTION_KEY_OFFSET])
        {
-         /* EVENT->code is an unknown keysym, for example someone
-            assigned `ccaron' to a key in a locale where
-            XmbLookupString doesn't return a translation for it.  */
-         char *name;
-         Lisp_Object symbol;
-         
-         BLOCK_INPUT;
-         /* This returns a pointer to a static area.  Don't free it.  */
-         name = XKeysymToString (event->code);
-         symbol = name ? intern (name) : Qnil;
-         UNBLOCK_INPUT;
-         
-         if (!NILP (symbol))
-           return apply_modifiers (event->modifiers, symbol);
+         /* We need to use an alist rather than a vector as the cache
+            since we can't make a vector long enuf.  */
+         if (NILP (current_kboard->system_key_syms))
+           current_kboard->system_key_syms = Fcons (Qnil, Qnil);
+         return modify_event_symbol (event->code,
+                                     event->modifiers,
+                                     Qfunction_key,
+                                     current_kboard->Vsystem_key_alist,
+                                     0, &current_kboard->system_key_syms,
+                                     (unsigned) -1);
        }
-#endif /* HAVE_X_WINDOWS */
 
       return modify_event_symbol (event->code - FUNCTION_KEY_OFFSET,
                                  event->modifiers,