lynx-keymaps 4.9 KB

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