summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/lynx/samples/lynx-keymaps
blob: 0a1c321415f98010139967e9574e2963d1fbddf5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# This is a sample key sequence definition file.  It is used by Lynx when
# built with ncurses or slang, to augment the definitions from your terminal's
# termcap or terminfo description.

# (Lynx implements this mechanism only if USE_KEYMAPS is defined during
# compilation, which has nothing to do with the KEYMAP directives in lynx.cfg,
# see source file LYCurses.h.)

# Lines that start with a '#' are comment lines.  Blank lines are ignored.

# The 'setkey' function may be used in two ways:
#
#   1.  setkey ESC-SEQUENCE  KEYSYM
#   2.  setkey ESC-SEQUENCE  KEYSYM_NAME
#
# where KEYSYM is an integer.  A keysym is essentially with the lynx.cfg
# file calls a 'keystroke', but I think that keysym is a more appropriate
# name.  The keysym is an integer and may be expressed in various ways:
#
#       as a decimal integer:  97
#       hexadecimal:           0x61
#       Octal:                 0141
#       as an ASCII character: 'a'
#
# Some keysyms may be expressed symbolically as a keysym name using the
# second form.  The currently recognized symbolic names are:
#
#       UPARROW
#       DNARROW
#       RTARROW
#       LTARROW
#       PGDOWN
#       PGUP
#       HOME
#       END
#       F1
#       DO_KEY
#       FIND_KEY
#       SELECT_KEY
#       INSERT_KEY
#       REMOVE_KEY
#       DO_NOTHING
#
# It does not matter if your keyboard does not have some of the keys
# implied by the above names.  The fact is that lynx uses these keys as an
# an intermediate representation.
#
# The ESC-SEQUENCE should be enclosed in double quotes.  The '^' character
# is special and indicates a control character, e.g., ^K is Ctrl-K.  An ESC
# character (ascii 27) may be represented as ^[.  As an example, many
# terminals have arrow keys that emit 'ESC [ A' for the UP arrow.  This may
# be represented as the escape sequence "^[[A".  The default keymapping is
# given below:
#
setkey "\033[A"		UPARROW
setkey "\033OA"		UPARROW
setkey "\033[B"		DNARROW
setkey "\033OB"		DNARROW
setkey "\033[C"		RTARROW
setkey "\033OC"		RTARROW
setkey "\033[D"		LTARROW
setkey "\033OD"		LTARROW
setkey "\033[1~"	FIND_KEY
setkey "\033[2~"	INSERT_KEY
setkey "\033[3~"	REMOVE_KEY
setkey "\033[4~"	SELECT_KEY
setkey "\033[5~"	PGUP
setkey "\033[6~"	PGDOWN
setkey "\033[8~"	END
setkey "\033[7~"	HOME
setkey "\033[28~"	F1
setkey "\033[29~"	DO_KEY
#
# All other keys map to themselves, e.g,
#
setkey "a"		'a'
#
# Now suppose that your terminal produces different escape sequences for
# HOME and END.  In particular, suppose that the home key produces 'ESC [
# H' and that the end key produces 'ESC [ K'.  Then these may be defined to
# map to lynx HOME and END keys via
#
setkey "^[[H"		HOME
setkey "^[[K"		END
#
# Similarly, we may map emacs-like sequences to these functions:
#
setkey "^[<"		HOME
setkey "^[>"		END
#
# Note that it may be impossible to map several sequences to the same
# keysym (NCURSES only?), in that case the mapping occurring last wins.
#
# The following maps a sequence commonly used for Shift+Tab to the
# corresponding code.  It should not be needed if the terminfo file
# has the correct info for kcbt.
#
setkey "^[[Z"		0x10F
#
# Other special escapes:
#	\a		bell
#	\b		backspace
#	\f		form-feed
#	\n		newline (line-feed)
#	\r		carriage-return
#	\t		tab
#	\v		vertical tab
#	\<number>	octal number, up to 3 digits, e.g., "\033".
#	\d<number>	decimal number, up to 3 digits, e.g., "\d99"
#	\x<number>	hexadecimal number, up to 2 digits, e.g., "\xFF"
#
# For Unix-systems (which have termcap or terminfo) you may also use symbols
# that refer to the termcap/terminfo, by referencing the name bracketed by
# "^(" and ")", e.g.,
setkey "^(cuu1)"	UPARROW
setkey "^(up)"		UPARROW
#
# The following extension, introduced after lynx2.8.2, allows to force
# recognition of meta (ESC) prefixes - especially useful with the
# "Bash-like" lineeditor binding.  Its use is unnecessary in most
# cases if Lynx was built with ncurses, but is probably necessary for
# all keys that should recognize ESC as a prefix if Lynx was built with
# slang.
#
#       setkey ESC-SEQUENCE  Meta-LETTER
#       setkey ESC-SEQUENCE  Meta-KEYSYM
#       setkey ESC-SEQUENCE  Meta-KEYSYM_NAME
#
# for example
#setkey "\033b"          Meta-b
#setkey "\033e"          Meta-'e'
#setkey "\033\033[28~"   Meta-F1
#
# The following extensions, introduced after lynx2.8.2, allow mapping
# escape sequences directly to key commands (lynxactioncodes).
#
#       setkey ESC-SEQUENCE  LAC:LYNX_ACTION
#       setkey ESC-SEQUENCE  LAC:LYNX_ACTION:LYNX_EDITACTION
#
# where LYNX_ACTION is a key command specified as for lynx.cfg KEYMAP
# options and as listed on the KEYMAP ('K') screen, and LYNX_EDITACTION
# is a line-editor action specified as for KEYMAP and as listed in Line
# Editor help pages.  Using this form makes remapping according to user
# preference with KEYMAP impossible, and should thus be used sparingly
# (in general, use KEYMAP with PASS instead, if the goal is to force
# recognition of a key in form text fields).  For example:
#
#setkey "\033e"          LAC:EDITTEXTAREA:PASS