Blame samples/lynx-keymaps

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