| 1 |
# $LynxId: lynx-keymaps,v 1.7 2013/10/13 20:40:00 tom Exp $ |
| 2 |
# |
| 3 |
# This is a sample key sequence definition file. It is used by Lynx when |
| 4 |
# built with ncurses or slang, to augment the definitions from your terminal's |
| 5 |
# termcap or terminfo description. |
| 6 |
|
| 7 |
# (Lynx implements this mechanism only if USE_KEYMAPS is defined during |
| 8 |
# compilation, which has nothing to do with the KEYMAP directives in lynx.cfg, |
| 9 |
# see source file LYCurses.h.) |
| 10 |
|
| 11 |
# Lines that start with a '#' are comment lines. Blank lines are ignored. |
| 12 |
|
| 13 |
# The 'setkey' function may be used in two ways: |
| 14 |
# |
| 15 |
# 1. setkey ESC-SEQUENCE KEYSYM |
| 16 |
# 2. setkey ESC-SEQUENCE KEYSYM_NAME |
| 17 |
# |
| 18 |
# where KEYSYM is an integer. A keysym is essentially with the lynx.cfg |
| 19 |
# file calls a 'keystroke', but I think that keysym is a more appropriate |
| 20 |
# name. The keysym is an integer and may be expressed in various ways: |
| 21 |
# |
| 22 |
# as a decimal integer: 97 |
| 23 |
# hexadecimal: 0x61 |
| 24 |
# Octal: 0141 |
| 25 |
# as an ASCII character: 'a' |
| 26 |
# |
| 27 |
# Some keysyms may be expressed symbolically as a keysym name using the |
| 28 |
# second form. The currently recognized symbolic names are: |
| 29 |
# |
| 30 |
# UPARROW |
| 31 |
# DNARROW |
| 32 |
# RTARROW |
| 33 |
# LTARROW |
| 34 |
# PGDOWN |
| 35 |
# PGUP |
| 36 |
# HOME |
| 37 |
# END |
| 38 |
# F1 |
| 39 |
# F2 |
| 40 |
# F3 |
| 41 |
# F4 |
| 42 |
# F5 |
| 43 |
# F6 |
| 44 |
# F7 |
| 45 |
# F8 |
| 46 |
# F9 |
| 47 |
# F10 |
| 48 |
# F11 |
| 49 |
# F12 |
| 50 |
# DO_KEY |
| 51 |
# FIND_KEY |
| 52 |
# SELECT_KEY |
| 53 |
# INSERT_KEY |
| 54 |
# REMOVE_KEY |
| 55 |
# DO_NOTHING |
| 56 |
# |
| 57 |
# It does not matter if your keyboard does not have some of the keys |
| 58 |
# implied by the above names. The fact is that lynx uses these keys as an |
| 59 |
# an intermediate representation. |
| 60 |
# |
| 61 |
# The ESC-SEQUENCE should be enclosed in double quotes. The '^' character |
| 62 |
# is special and indicates a control character, e.g., ^K is Ctrl-K. An ESC |
| 63 |
# character (ascii 27) may be represented as ^[. As an example, many |
| 64 |
# terminals have arrow keys that emit 'ESC [ A' for the UP arrow. This may |
| 65 |
# be represented as the escape sequence "^[[A". The default keymapping is |
| 66 |
# given below: |
| 67 |
# |
| 68 |
setkey "\033[A" UPARROW |
| 69 |
setkey "\033OA" UPARROW |
| 70 |
setkey "\033[B" DNARROW |
| 71 |
setkey "\033OB" DNARROW |
| 72 |
setkey "\033[C" RTARROW |
| 73 |
setkey "\033OC" RTARROW |
| 74 |
setkey "\033[D" LTARROW |
| 75 |
setkey "\033OD" LTARROW |
| 76 |
setkey "\033[1~" FIND_KEY |
| 77 |
setkey "\033[2~" INSERT_KEY |
| 78 |
setkey "\033[3~" REMOVE_KEY |
| 79 |
setkey "\033[4~" SELECT_KEY |
| 80 |
setkey "\033[5~" PGUP |
| 81 |
setkey "\033[6~" PGDOWN |
| 82 |
setkey "\033[8~" END |
| 83 |
setkey "\033[7~" HOME |
| 84 |
setkey "\033[28~" F1 |
| 85 |
setkey "\033[29~" DO_KEY |
| 86 |
# |
| 87 |
# All other keys map to themselves, e.g, |
| 88 |
# |
| 89 |
setkey "a" 'a' |
| 90 |
# |
| 91 |
# Now suppose that your terminal produces different escape sequences for |
| 92 |
# HOME and END. In particular, suppose that the home key produces 'ESC [ |
| 93 |
# H' and that the end key produces 'ESC [ K'. Then these may be defined to |
| 94 |
# map to lynx HOME and END keys via |
| 95 |
# |
| 96 |
setkey "^[[H" HOME |
| 97 |
setkey "^[[K" END |
| 98 |
# |
| 99 |
# Similarly, we may map emacs-like sequences to these functions: |
| 100 |
# |
| 101 |
setkey "^[<" HOME |
| 102 |
setkey "^[>" END |
| 103 |
# |
| 104 |
# Note that it may be impossible to map several sequences to the same |
| 105 |
# keysym (NCURSES only?), in that case the mapping occurring last wins. |
| 106 |
# |
| 107 |
# The following maps a sequence commonly used for Shift+Tab to the |
| 108 |
# corresponding code. It should not be needed if the terminfo file |
| 109 |
# has the correct info for kcbt. |
| 110 |
# |
| 111 |
setkey "^[[Z" 0x10F |
| 112 |
# |
| 113 |
# Other special escapes: |
| 114 |
# \a bell |
| 115 |
# \b backspace |
| 116 |
# \f form-feed |
| 117 |
# \n newline (line-feed) |
| 118 |
# \r carriage-return |
| 119 |
# \t tab |
| 120 |
# \v vertical tab |
| 121 |
# \<number> octal number, up to 3 digits, e.g., "\033". |
| 122 |
# \d<number> decimal number, up to 3 digits, e.g., "\d99" |
| 123 |
# \x<number> hexadecimal number, up to 2 digits, e.g., "\xFF" |
| 124 |
# |
| 125 |
# For Unix-systems (which have termcap or terminfo) you may also use symbols |
| 126 |
# that refer to the termcap/terminfo, by referencing the name bracketed by |
| 127 |
# "^(" and ")", e.g., |
| 128 |
setkey "^(cuu1)" UPARROW |
| 129 |
setkey "^(up)" UPARROW |
| 130 |
# |
| 131 |
# The following extension, introduced after lynx2.8.2, allows to force |
| 132 |
# recognition of meta (ESC) prefixes - especially useful with the |
| 133 |
# "Bash-like" lineeditor binding. Its use is unnecessary in most |
| 134 |
# cases if Lynx was built with ncurses, but is probably necessary for |
| 135 |
# all keys that should recognize ESC as a prefix if Lynx was built with |
| 136 |
# slang. |
| 137 |
# |
| 138 |
# setkey ESC-SEQUENCE Meta-LETTER |
| 139 |
# setkey ESC-SEQUENCE Meta-KEYSYM |
| 140 |
# setkey ESC-SEQUENCE Meta-KEYSYM_NAME |
| 141 |
# |
| 142 |
# for example |
| 143 |
#setkey "\033b" Meta-b |
| 144 |
#setkey "\033e" Meta-'e' |
| 145 |
#setkey "\033\033[28~" Meta-F1 |
| 146 |
# |
| 147 |
# The following extensions, introduced after lynx2.8.2, allow mapping |
| 148 |
# escape sequences directly to key commands (lynxactioncodes). |
| 149 |
# |
| 150 |
# setkey ESC-SEQUENCE LAC:LYNX_ACTION |
| 151 |
# setkey ESC-SEQUENCE LAC:LYNX_ACTION:LYNX_EDITACTION |
| 152 |
# |
| 153 |
# where LYNX_ACTION is a key command specified as for lynx.cfg KEYMAP |
| 154 |
# options and as listed on the KEYMAP ('K') screen, and LYNX_EDITACTION |
| 155 |
# is a line-editor action specified as for KEYMAP and as listed in Line |
| 156 |
# Editor help pages. Using this form makes remapping according to user |
| 157 |
# preference with KEYMAP impossible, and should thus be used sparingly |
| 158 |
# (in general, use KEYMAP with PASS instead, if the goal is to force |
| 159 |
# recognition of a key in form text fields). For example: |
| 160 |
# |
| 161 |
#setkey "\033e" LAC:EDITTEXTAREA:PASS |