texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[5863] hard code recognition of cursor key byte sequences


From: Gavin D. Smith
Subject: [5863] hard code recognition of cursor key byte sequences
Date: Mon, 06 Oct 2014 16:32:33 +0000

Revision: 5863
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5863
Author:   gavin
Date:     2014-10-06 16:32:31 +0000 (Mon, 06 Oct 2014)
Log Message:
-----------
hard code recognition of cursor key byte sequences

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/info/terminal.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2014-10-06 13:44:57 UTC (rev 5862)
+++ trunk/ChangeLog     2014-10-06 16:32:31 UTC (rev 5863)
@@ -9,6 +9,11 @@
        menu of matches (this is what happened before).
        * info/t/all-only.sh: New test.
 
+       * info/terminal.c (initialize_byte_map): Add byte sequences 
+       beginning ESC [ and ESC O representing cursor keys.  Previously 
+       these byte sequences were present in 
+       default_emacs_like_info_keys before changes on 2014-06-28.
+
 2014-10-06  Ken Brown  <address@hidden> (tiny change)
 
        * system.h [O_BINARY && !__MSDOS__]: Don't redefine setmode if 

Modified: trunk/info/terminal.c
===================================================================
--- trunk/info/terminal.c       2014-10-06 13:44:57 UTC (rev 5862)
+++ trunk/info/terminal.c       2014-10-06 16:32:31 UTC (rev 5863)
@@ -639,6 +639,22 @@
       KEY_BACK_TAB, &term_kB
   };
 
+  /* Recognize arrow key sequences with both of the usual prefixes in case 
they 
+     are missing in the termcap entry. */
+  static struct special_keys2 {
+      int key_id;
+      char *byte_seq;
+  } keys2[] = {
+      KEY_RIGHT_ARROW, "\033[C",
+      KEY_RIGHT_ARROW, "\033OC",
+      KEY_LEFT_ARROW, "\033[D",
+      KEY_LEFT_ARROW, "\033OD",
+      KEY_UP_ARROW, "\033[A",
+      KEY_UP_ARROW, "\033OA",
+      KEY_DOWN_ARROW, "\033[B",
+      KEY_DOWN_ARROW, "\033OB"
+  };
+
   byte_seq_to_key = xmalloc (256 * sizeof (BYTEMAP_ENTRY));
 
   /* Make each byte represent itself by default. */
@@ -672,6 +688,12 @@
       add_seq_to_byte_map (keys[i].key_id, *keys[i].byte_seq);
     }
 
+  /* Hard-coded byte sequences. */
+  for (i = 0; i < sizeof (keys2) / sizeof (*keys2); i++)
+    {
+      add_seq_to_byte_map (keys2[i].key_id, keys2[i].byte_seq);
+    }
+
   if (term_Km)
     add_seq_to_byte_map (KEY_MOUSE, term_Km);
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]