lynx-keymaps 5.1 KB

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