about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2013-10-15 09:08:42 -0400
committerThomas E. Dickey <dickey@invisible-island.net>2013-10-15 09:08:42 -0400
commit519f8ac966b9073b86a37d0283c7258ea07a911c (patch)
tree7f1d55c55b348d265f2b896e2bdcca254d719fe9
parented46d3cc0121dbce87345bbbb119cd4080c247c7 (diff)
downloadlynx-snapshots-519f8ac966b9073b86a37d0283c7258ea07a911c.tar.gz
snapshot of project "lynx", label v2-8-8dev_16r
-rw-r--r--CHANGES6
-rw-r--r--lynx.cfg84
-rw-r--r--src/LYIcon.rc10
-rw-r--r--src/LYKeymap.c18
-rw-r--r--src/LYStrings.c12
-rw-r--r--src/LYStrings.h5
6 files changed, 78 insertions, 57 deletions
diff --git a/CHANGES b/CHANGES
index f900e113..b0582818 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,9 +1,11 @@
--- $LynxId: CHANGES,v 1.682 2013/10/13 23:09:45 tom Exp $
+-- $LynxId: CHANGES,v 1.683 2013/10/15 08:32:47 tom Exp $
 ===============================================================================
 Changes since Lynx 2.8 release
 ===============================================================================
 
-2013-10-13 (2.8.8dev.17)
+2013-10-15 (2.8.8dev.17)
+* modify logic in lkcstring_to_lkc() to allow named keys, e.g., from curses,
+  to be used consistently in a KEYMAP directive -TD
 * add version-info to LYIcon.rc -TD
 * add symbols in Keysym_Strings[] and table in setup_vtXXX_keymap() for
   function keys 2-12, to improve keymap-configurability -TD
diff --git a/lynx.cfg b/lynx.cfg
index f7dd53d3..ec54e985 100644
--- a/lynx.cfg
+++ b/lynx.cfg
@@ -1,4 +1,4 @@
-# $LynxId: lynx.cfg,v 1.227 2013/10/09 12:31:35 tom Exp $
+# $LynxId: lynx.cfg,v 1.228 2013/10/15 08:58:09 tom Exp $
 # lynx.cfg file.
 # The default placement for this file is /usr/local/lib/lynx.cfg (Unix)
 #                                     or Lynx_Dir:lynx.cfg (VMS)
@@ -2412,27 +2412,37 @@ MINIMAL_COMMENTS:TRUE
 # so you are responsible for possible deviations
 # when you are changing any KEYMAP below).
 .nf
-#
-# Keystrokes for special keys are represented by the following codes:
-#         Up Arrow: 0x100
-#       Down Arrow: 0x101
-#      Right Arrow: 0x102
-#       Left Arrow: 0x103
-#        Page Down: 0x104
-#          Page Up: 0x105
-#      Keypad Home: 0x106 (see also 0x10A)
-#       Keypad End: 0x107 (see also 0x10B)
-#   Function key 1: 0x108
-# vt100   Help Key: 0x108
-# vt100     Do Key: 0x109
-# vt100   Find Key: 0x10A (The key with label "Home" may be treated as Find)
-# vt100 Select Key: 0x10B (The key with label "End" may be treated as Select)
-#       Insert Key: 0x10C
-# Remove (Del) Key: 0x10D
-#      ignored key  0x10E (reserved for internal use, DO_NOTHING)
-# Back (Shift) Tab: 0x10F
-#    reserved code  0x11D (reserved for internal use with -use_mouse)
-#    reserved code  0x290 (reserved for internal use with -use_mouse)
+# Lynx accepts special keys either by name, or by lynx-specific codes.  These
+# names and codes are listed below, with a brief description:
+#
+#         UPARROW: 0x100 (Up Arrow)
+#         DNARROW: 0x101 (Down Arrow)
+#         RTARROW: 0x102 (Right Arrow)
+#         LTARROW: 0x103 (Left Arrow)
+#          PGDOWN: 0x104 (Page Down)
+#            PGUP: 0x105 (Page Up)
+#            HOME: 0x106 (Keypad Home)
+#             END: 0x107 (Keypad End)
+#              F1: 0x108 (VT220 Function-key 1, also Help Key)
+#          DO_KEY: 0x109 (VT220 Function key 16, also "Do" Key)
+#        FIND_KEY: 0x10A (VT220 key with label "Home" may be treated as Find)
+#      SELECT_KEY: 0x10B (VT220 key with label "End" may be treated as Select)
+#      INSERT_KEY: 0x10C (VT220 Insert Key)
+#      REMOVE_KEY: 0x10D (VT220 Remove (DEL) Key)
+#      DO_NOTHING: 0x10E (reserved for internal use, DO_NOTHING)
+#     BACKTAB_KEY: 0x10F (Back Tab, e.g., using Shift)
+#              F2: 0x110 (VT220 Function-key 2)
+#              F3: 0x111 (VT220 Function-key 3)
+#              F4: 0x112 (VT220 Function-key 4)
+#              F5: 0x113 (VT220 Function-key 5)
+#              F6: 0x114 (VT220 Function-key 6)
+#              F7: 0x115 (VT220 Function-key 7)
+#              F8: 0x116 (VT220 Function-key 8)
+#              F9: 0x117 (VT220 Function-key 9)
+#             F10: 0x118 (VT220 Function-key 10)
+#             F11: 0x119 (VT220 Function-key 11)
+#             F12: 0x11A (VT220 Function-key 12)
+#           MOUSE: 0x11D (reserved for internal use with -use_mouse)
 #
 .fi
 # Other codes not listed above may be available for additional keys,
@@ -2457,21 +2467,21 @@ MINIMAL_COMMENTS:TRUE
 #KEYMAP:0x20:NEXT_PAGE		# Move down to next page
 #KEYMAP:-:PREV_PAGE		# Move up to previous page
 #KEYMAP:^P:UP_TWO		# Move display up two lines
-#KEYMAP:0x10C:UP_TWO		# Function key Insert - Move display up two lines
+#KEYMAP:INSERT_KEY:UP_TWO	# Function key Insert - Move display up two lines
 #KEYMAP:^N:DOWN_TWO		# Move display down two lines
-#KEYMAP:0x10D:DOWN_TWO		# Function key Remove - Move display down two lines
+#KEYMAP:REMOVE_KEY:DOWN_TWO	# Function key Remove - Move display down two lines
 #KEYMAP:(:UP_HALF		# Move display up half a page
 #KEYMAP:):DOWN_HALF		# Move display down half a page
 #KEYMAP:^W:REFRESH		# Refresh the screen
 #KEYMAP:^A:HOME			# Go to top of current document
-#KEYMAP:0x106:HOME		# Keypad Home - Go to top of current document
-#KEYMAP:0x10A:HOME		# Function key Find - Go to top of current document
+#KEYMAP:HOME:HOME		# Keypad Home - Go to top of current document
+#KEYMAP:FIND_KEY:HOME		# Function key Find - Go to top of current document
 #KEYMAP:^E:END			# Go to bottom of current document
-#KEYMAP:0x107:END		# Keypad End - Go to bottom of current document
-#KEYMAP:0x10B:END		# Function key Select - Go to bottom of current document
-#KEYMAP:0x100:PREV_LINK		# Move to the previous link or page
-#KEYMAP:0x101:NEXT_LINK		# Move to the next link or page
-#KEYMAP:0x10F:FASTBACKW_LINK 	# Back Tab - Move to previous link or text area
+#KEYMAP:END:END			# Keypad End - Go to bottom of current document
+#KEYMAP:SELECT_KEY:END		# Function key Select - Go to bottom of current document
+#KEYMAP:UPARROW:PREV_LINK	# Move to the previous link or page
+#KEYMAP:DNARROW:NEXT_LINK	# Move to the next link or page
+#KEYMAP:BACKTAB_KEY:FASTBACKW_LINK 	# Back Tab - Move to previous link or text area
 #KEYMAP:^I:FASTFORW_LINK	# Tab key - Move always to next link or text area
 #KEYMAP:^:FIRST_LINK		# Move to the first link on line
 #KEYMAP:$:LAST_LINK		# Move to the last link on line
@@ -2479,13 +2489,13 @@ MINIMAL_COMMENTS:TRUE
 #KEYMAP:>:DOWN_LINK		# Move to the link below
 #KEYMAP:0x7F:HISTORY		# Show the history list
 #KEYMAP:0x08:HISTORY		# Show the history list
-#KEYMAP:0x103:PREV_DOC		# Return to the previous document in history stack
-#KEYMAP:0x102:ACTIVATE		# Select the current link
-#KEYMAP:0x109:ACTIVATE		# Function key Do - Select the current link
+#KEYMAP:LTARROW:PREV_DOC	# Return to the previous document in history stack
+#KEYMAP:RTARROW:ACTIVATE	# Select the current link
+#KEYMAP:DO_KEY:ACTIVATE		# Function key Do - Select the current link
 #KEYMAP:g:GOTO			# Goto a random URL
 #KEYMAP:G:ECGOTO		# Edit the current document's URL and go to it
 #KEYMAP:H:HELP			# Show default help screen
-#KEYMAP:0x108:DWIMHELP		# Function key Help - Show a help screen
+#KEYMAP:F1:DWIMHELP		# Function key Help - Show a help screen
 #KEYMAP:i:INDEX			# Show default index
 #*** Edit FORM_LINK_* messages in LYMessages_en.h if you change NOCACHE ***
 #KEYMAP:x:NOCACHE		# Force submission of form or link with no-cache
@@ -2522,7 +2532,7 @@ MINIMAL_COMMENTS:TRUE
 #*** Escaping from text input fields with ^V is independent from this: ***
 #KEYMAP:^V:SWITCH_DTD		# Toggle between SortaSGML and TagSoup HTML parsing
 #KEYMAP:0x00:DO_NOTHING		# Does nothing (ignore this key)
-#KEYMAP:0x10E:DO_NOTHING	# Does nothing (ignore this key)
+#KEYMAP:DO_NOTHING:DO_NOTHING	# Does nothing (ignore this key)
 #KEYMAP:{:SHIFT_LEFT		# shift the screen left
 #KEYMAP:}:SHIFT_RIGHT		# shift the screen right
 #KEYMAP:|:LINEWRAP_TOGGLE	# toggle linewrap on/off, for shift-commands
@@ -2652,7 +2662,7 @@ MINIMAL_COMMENTS:TRUE
 # field it is passed by the built-in line-editor to normal KEYMAP handling,
 # i.e. this flag acts like an implied ^V escape (always overrides line-editor
 # behavior of the key).  For example,
-#KEYMAP:0x10C:UP_TWO:PASS # Function key Insert - Move display up two lines
+#KEYMAP:INSERT_KEY:UP_TWO:PASS # Function key Insert - Move display up two lines
 #
 # Other examples (repeating built-in bindings)
 #KEYMAP:^V::LKCMD	# set (only) line-edit action for ^V
diff --git a/src/LYIcon.rc b/src/LYIcon.rc
index 7f243447..6fce1ec5 100644
--- a/src/LYIcon.rc
+++ b/src/LYIcon.rc
@@ -1,12 +1,12 @@
-// $LynxId: LYIcon.rc,v 1.3 2013/10/13 23:03:48 tom Exp $
+// $LynxId: LYIcon.rc,v 1.4 2013/10/14 23:34:13 tom Exp $
 
 #include <windows.h>
 
 100	ICON	"../samples/lynx.ico"
 
 VS_VERSION_INFO VERSIONINFO
-FILEVERSION    2,8,8,17
-PRODUCTVERSION 2,8,8,17
+FILEVERSION    2,8,8,1017
+PRODUCTVERSION 2,8,8,1017
 FILEFLAGSMASK  VS_FFI_FILEFLAGSMASK
 FILEFLAGS      0
 FILEOS         VOS_NT_WINDOWS32
@@ -19,12 +19,12 @@ BEGIN
     BEGIN
       VALUE "CompanyName",      "http://lynx.isc.org"
       VALUE "FileDescription",  "Lynx - web browser"
-      VALUE "FileVersion",      "2.8.8.17"
+      VALUE "FileVersion",      "2.8.8.1017"
       VALUE "InternalName",     "Lynx"
       VALUE "LegalCopyright",   "©1997-2013 Thomas E. Dickey"
       VALUE "OriginalFilename", "lynx.exe"
       VALUE "ProductName",      "Lynx - web browser"
-      VALUE "ProductVersion",   "2.8.8.17"
+      VALUE "ProductVersion",   "2.8.8.1017"
     END
   END
   BLOCK "VarFileInfo"
diff --git a/src/LYKeymap.c b/src/LYKeymap.c
index e3e4cd9b..f7b59ecf 100644
--- a/src/LYKeymap.c
+++ b/src/LYKeymap.c
@@ -1,4 +1,4 @@
-/* $LynxId: LYKeymap.c,v 1.95 2013/10/13 20:23:07 tom Exp $ */
+/* $LynxId: LYKeymap.c,v 1.97 2013/10/15 08:16:40 tom Exp $ */
 #include <HTUtils.h>
 #include <LYUtils.h>
 #include <LYGlobalDefs.h>
@@ -1014,6 +1014,17 @@ static const struct {
     { HOME_KEY,		"Home" },
     { END_KEY,		"End" },
     { F1_KEY,		"F1" },
+    { F2_KEY,		"F2" },
+    { F3_KEY,		"F3" },
+    { F4_KEY,		"F4" },
+    { F5_KEY,		"F5" },
+    { F6_KEY,		"F6" },
+    { F7_KEY,		"F7" },
+    { F8_KEY,		"F8" },
+    { F9_KEY,		"F9" },
+    { F10_KEY,		"F10" },
+    { F11_KEY,		"F11" },
+    { F12_KEY,		"F12" },
     { DO_KEY,		"Do key" },
     { FIND_KEY,		"Find key" },
     { SELECT_KEY,	"Select key" },
@@ -1414,9 +1425,8 @@ int lkcstring_to_lkc(const char *src)
 	map_string_to_keysym(src, &c);
 #ifndef USE_SLANG
 	if (c >= 0) {
-	    if ((c & LKC_MASK) > 255 && !(c & LKC_ISLKC))
-		c = (-1);	/* Don't accept untranslated curses KEY_* */
-	    else
+	    /* make curses-keys mapped from Keysym_Strings[] available here */
+	    if ((c & LKC_MASK) > 255)
 		c &= ~LKC_ISLKC;
 	}
 #endif
diff --git a/src/LYStrings.c b/src/LYStrings.c
index 66acf897..351d7c41 100644
--- a/src/LYStrings.c
+++ b/src/LYStrings.c
@@ -1,4 +1,4 @@
-/* $LynxId: LYStrings.c,v 1.253 2013/10/13 20:47:25 tom Exp $ */
+/* $LynxId: LYStrings.c,v 1.255 2013/10/15 09:08:42 tom Exp $ */
 #include <HTUtils.h>
 #include <HTCJK.h>
 #include <UCAux.h>
@@ -980,7 +980,7 @@ static Keysym_String_List Keysym_Strings [] =
     INTERN_KEY( "INSERT_KEY",	INSERT_KEY,	KEY_IC ),
     INTERN_KEY( "REMOVE_KEY",	REMOVE_KEY,	KEY_DC ),
     INTERN_KEY( "DO_NOTHING",	DO_NOTHING,	DO_NOTHING|LKC_ISLKC ),
-    INTERN_KEY( NULL,		-1,		ERR )
+    INTERN_KEY( NULL,		UNKNOWN_KEY,	ERR )
 };
 /* *INDENT-ON* */
 
@@ -1214,8 +1214,7 @@ int map_string_to_keysym(const char *str, int *keysym)
 	    *keysym = LAC_TO_LKC0(*keysym);
 	    return (*keysym);
 	}
-    }
-    if (strncasecomp(str, "Meta-", 5) == 0) {
+    } else if (strncasecomp(str, "Meta-", 5) == 0) {
 	str += 5;
 	modifier = LKC_MOD2;
 	if (*str) {
@@ -1242,8 +1241,7 @@ int map_string_to_keysym(const char *str, int *keysym)
 		    return (*keysym = (UCH(buf[0])) | modifier);
 	    }
 	}
-    }
-    if (*str == SQUOTE) {
+    } else if (*str == SQUOTE) {
 	unescaped_char(str, keysym);
     } else if (isdigit(UCH(*str))) {
 	char *tmp;
@@ -1272,7 +1270,7 @@ int map_string_to_keysym(const char *str, int *keysym)
 LYExtraKeys LYnameToExtraKeys(const char *name)
 {
     Keysym_String_List *k = lookupKeysymByName(name);
-    LYExtraKeys result = -1;
+    LYExtraKeys result = UNKNOWN_KEY;
 
     if (k != 0)
 	result = k->internal;
diff --git a/src/LYStrings.h b/src/LYStrings.h
index 906c59a0..972f65a3 100644
--- a/src/LYStrings.h
+++ b/src/LYStrings.h
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYStrings.h,v 1.110 2013/10/13 20:30:39 tom Exp $
+ * $LynxId: LYStrings.h,v 1.111 2013/10/15 09:07:48 tom Exp $
  */
 #ifndef LYSTRINGS_H
 #define LYSTRINGS_H
@@ -144,7 +144,8 @@ extern "C" {
      * These are "extra" keys which do not fit into a single byte.
      */
     typedef enum {
-	UPARROW_KEY = 256
+	UNKNOWN_KEY = -1
+	,UPARROW_KEY = 256
 	,DNARROW_KEY
 	,RTARROW_KEY
 	,LTARROW_KEY