home *** CD-ROM | disk | FTP | other *** search
/ Magazyn WWW 1998 October / www_10_1998.iso / prog / w32 / ssh / sshwin.exe / Fsssh.lib / KEYMAP.MAP < prev    next >
Text File  |  1997-08-28  |  29KB  |  1,039 lines

  1. # Author: Tero Kivinen <kivinen@iki.fi>
  2. # Creation          : 22:00 Aug  2 1996 kivinen
  3. # Last Modification : 00:11 Aug 29 1996 kivinen
  4. # Edit time         : 222 min
  5. #
  6. # $Log: keymap.map,v $
  7. # Revision 1.10  1997/06/13 05:06:07  kivinen
  8. #     Fixed typo on comment.
  9. #     Added Caps_Lock/Shift_Lock/Num_Lock entries (X11 uses those
  10. #     versions with underscore).
  11. #
  12. # Revision 1.9  1996/11/03 22:44:29  hannu
  13. #    Cosmetic changes
  14. #
  15. # Revision 1.8  1996/10/02 11:40:24  kivinen
  16. #     Added paste-selection, paste-clipboard, and copy-selection
  17. #     actions. Added mappings for Insert+Control and Insert+Shift.
  18. #
  19. # Revision 1.7  1996/09/09 23:18:21  hannu
  20. #     Added special windows binding for Execute -> TH_KP_Enter. The
  21. #     numpad enter is mapped to VK_EXECUTE by special windows code.
  22. #
  23. # Revision 1.6  1996/09/03  17:40:28  kivinen
  24. #     Added fast-scroll-mapping.
  25. #
  26. # Revision 1.5  1996/08/29 18:24:02  kivinen
  27. #     Added swap-bs-del-key-mapping support. Fixed comments.
  28. #
  29. # Revision 1.4  1996/08/28 21:12:37  kivinen
  30. #     Added map-mod5-to-capslock support. Changed
  31. #     meta-key-to-eight-bit to mod5-key-to-eight-bit.
  32. #     Added map-control-to-capslock support.
  33. #     Fixed bug captial -> capital.
  34. #     Removed mappings from TH_Space (it is now deleted).
  35. #     Added mapping for Space+Control and removed mapping from
  36. #     Space.
  37. #
  38. # Revision 1.3  1996/08/23 00:53:47  kivinen
  39. #     Changed to use window_system switch variable.
  40. #     Added some comment to enable options.
  41. #     Added fi-7-bit-mapping and pf1-4-keys-in-numpad options.
  42. #     Added some windows keycodes to mapping tables.
  43. #
  44. # Revision 1.2  1996/08/15 12:04:44  kivinen
  45. #     Added enable scroll-on-{key,output}-mapping.
  46. #     Fixed special_key to special-key.
  47. #     Commented fi-7-bit-* out.
  48. #
  49. #
  50. #
  51.  
  52. # The switch variable window_system have value "windows", "macintosh" or "x11",
  53. # depending on the system where this file is parsed. 
  54.  
  55. # Select any of following enables. These select some configuration changes
  56. # in keymap file. 
  57.  
  58. ######################################################################
  59. # meta-key-to-eight-bit might not work on every environment, it changes the
  60. # meta key to insert 8-bit version of character instead of normal character.
  61. # Note: In windows you need to map some key to mod5, and you cannot map Alt 
  62. # key to that, because the default windows version don't allow you to map Alt
  63. # to anything (Windows uses it internally, it is enabled only to make AltGr 
  64. # work).
  65. #
  66. # The map-mod5-to-capslock setting will map capslock to be mod5.
  67. #
  68. # enable mod5-key-to-eight-bit
  69. # enable map-mod5-to-capslock
  70.  
  71. ######################################################################
  72. # Scroll-on-key-mapping adds mappings to F1+Control+Shift that will toggle
  73. # the setting of scroll-on-key (does the terminal scroll to bottom of
  74. # history when key is pressed).
  75. #
  76. #enable scroll-on-key-mapping
  77.  
  78. ######################################################################
  79. # Scroll-on-output-mapping adds mappings to F2+Control+Shift that will toggle
  80. # the setting of scroll-on-screen-output (does the terminal scroll to bottom of
  81. # history when something is outputted to screen).
  82. #
  83. # enable scroll-on-output-mapping
  84.  
  85. ######################################################################
  86. # fast-scroll-mapping adds mapping to F3+Control+Shift that will toggle
  87. # the fast-scroll setting (the scrolling is faster, because it will
  88. # scroll several lines at once).
  89. #
  90. # enable fast-scroll-mapping
  91.  
  92. ######################################################################
  93. # fi-7-bit-mapping will add another keymap for Finnish 7-bit versions
  94. # of Σσ÷ ({}|). The F12+Control+Shift will toggle the keymap between normal
  95. # and fi-7-bit keymap.
  96. #
  97. # enable fi-7-bit-mapping
  98.  
  99. ######################################################################
  100. # pf1-4-keys-in-numpad will map PF1-4 keys to numeric pad to NumLock, /, *,
  101. # and - keys. This emulates standard vt100 key placement.
  102. # Note! NumLock will still act as a Numlock for windows, so the keypad
  103. # will either be in numeric or cursor keys mode.
  104. #
  105. # enable pf1-4-keys-in-numpad
  106.  
  107. ######################################################################
  108. # swap-bs-del-key-mapping adds mapping to BackSpace+Control-Shift and
  109. # Delete+Control-Shift that will toggle both BSIsDel and DelIsBS settings.
  110. # It also adds BackSpace+Control+Shift mapping that will toggle only BSIsDel
  111. # setting and Delete+Control+Shift mapping that will toggle only DelIsBS
  112. # setting. Note! The default Vtkeys mapping is Backspace+Shift = del,
  113. # Delete+Shift = bs.
  114. #
  115. # enable swap-bs-del-key-mapping
  116.  
  117. ######################################################################
  118. # map-control-to-capslock will map Capslock key so it will be control
  119. # key instead of capslock.         
  120. #
  121. # enable map-control-to-capslock
  122.  
  123. #
  124. # Grammar
  125. # -------
  126. #
  127. # The grammar for this file is following:
  128. #
  129. # Keymap keymap-struct-name
  130. #    modifiers = modifiers-enviroment-name
  131. #    keys = keys-environment-name
  132. #    chars = chars-environment-name
  133. #    vtkeys = vtkeys-environment-name
  134. # end
  135. #
  136. # Modifiers modifiers-environment-name
  137. #    key = Shift
  138. #    key = Control
  139. #    key = Mod1 | Alt | Meta
  140. #     key = Lock | CapsLock
  141. #    key = ShiftLock
  142. #    key = NumLock
  143. #    key = Mod2 | AltGr | Super
  144. #    key = Mod3 | Hyper
  145. #    key = Mod4
  146. #    key = Mod5
  147. #    ....
  148. # end
  149. #
  150. # Keys keys-environment-name
  151. #    key+modifierstatus = "action"
  152. #    key+modifierstatus = "action"
  153. #    ....
  154. # end
  155. #
  156. # Chars chars-environment-name
  157. #    char = "chars"
  158. #    char = "chars"
  159. #    ....
  160. # end
  161. #
  162. # Vtkeys vtkeys-environment-name
  163. #    TH_Name+vtmodifierstatus+vtstatus = "chars"
  164. #    TH_Name+vtmodifierstatus+vtstatus = "chars"
  165. #    ....
  166. # end
  167. #
  168. # Every name that is used must be defined BEFORE it is used, so
  169. # normally the Keymap-struct is at the end etc..
  170. #
  171. #
  172. # Modifers
  173. # --------
  174. #
  175. # Modifiers-struct contains mappings from key to one modifier. There
  176. # can be several keys mapping to same modifier and the processing of
  177. # that key is finished after that (it is an error to have any other
  178. # mapping for the key after defining it as a modifier (or combination of
  179. # modifiers)).
  180. #
  181. #
  182. # Keycodes / Keysyms / Keys
  183. # -------------------------
  184. #
  185. # Key is one of the following:
  186. #
  187. #    Keycode_xxx    XXX = is the machine dependad numeric keycode
  188. #            for the key. If you use this remember to
  189. #            add it inside "if enabled xxx ... end".
  190. #
  191. #    keysym        keysym of the key, the keysym is one used in the
  192. #            native system with default prefix removed (in
  193. #            windows virtual keysyms without VK_ prefix, in X11
  194. #            X11 Keysyms, without XK_ prefix etc). Keysyms are
  195. #            case insencetive. All keysyms that are unknown are
  196. #            silenty ignored.
  197. #
  198. #    Anykey        special key that matches any key if none of the
  199. #            previous one matched. Note you can still have
  200. #            modifiers match. 
  201. #
  202. #
  203. # Modifiers-status
  204. # ----------------
  205. #
  206. # In the Keys-environment the shift status is added to key. This status is
  207. # combination of +shiftkey and -shiftkey entries added to key. The +shiftkey
  208. # means that the shiftkey must be on and -shiftkey means that the shift must
  209. # be off before that line matches. If some shiftkeys isn't mentioned in the
  210. # line it's value doesn't care.
  211. #
  212. # So the key "Left+Shift-Control" matches in the Keys-environment if the
  213. # Shift is down and Control is up when the cursor left key is pressed.
  214. #
  215. #
  216. # Actions
  217. # -------
  218. #
  219. # Actions is a whitespace separated string of actions. Each action is
  220. # a function taking some arguments (separated with in parenthes). 
  221. #
  222. # Valid actions are:
  223. #
  224. # special-key(TH_Name)            Send special-vtkey keypress to
  225. #                    emulator. This will jump directly
  226. #                    to vtkeys table. Note that Return
  227. #                    F-keys etc must go to vtkeys-table
  228. #                    before they are converted correctly
  229. #                    to vt100 operations. 
  230. #
  231. # string(chars)                Send string of chars to chars
  232. #                    conversion table level. If you need
  233. #                    to have ) in your string, quote it
  234. #                    with two backslash == "\\)". The
  235. #                    second \ is needed to quote the \
  236. #                    from configuration file parser.
  237. #
  238. # bell()                Ring bell.
  239. #
  240. # insert()                Send normal string returned by key.
  241. #
  242. # insert-eight-bit()            Send eight-bit (Meta) version
  243. #                    of string normally returned by key.
  244. #
  245. # insert-selection()            Send selection buffer to forward.
  246. #
  247. # keymap(name)                Change to different keymap-struct.
  248. #
  249. # scroll-back(count, units)        Scroll text window backwards.
  250. #                    Units can be page, halfpage, or line.
  251. #
  252. # scroll-forward(count, units)        Scroll text window forwards.
  253. #
  254. # redraw()                Redraw window.
  255. #
  256. # set-scrollbar(on/off/toggle)        Set emulator flavors. 
  257. # set-reverse-video(on/off/toggle)
  258. # set-autowrap(on/off/toggle)
  259. # set-reverse-autowrap(on/off/toggle)
  260. # set-autolinefeed(on/off/toggle)
  261. # set-application-cursor-keys(on/off/toggle)
  262. # set-application-keypad(on/off/toggle)
  263. # set-scroll-on-key(on/off/toggle)
  264. # set-scroll-on-screen-output(on/off/toggle)
  265. # set-visual-bell(on/off/toggle)
  266. # set-lock-function-keys(on/off/toggle)
  267. # set-show-cursor(on/off/toggle)
  268. # set-smoothscroll(on/off/toggle)
  269. # set-status-line(on/off/toggle)
  270. # set-eight-bit-controls(on/off/toggle)
  271. # set-local-mode(on/off/toggle)
  272. # set-local-echo(on/off/toggle)
  273. # set-interpret-controls(on/off/toggle)
  274. # set-insert-mode(on/off/toggle)
  275. # set-form-feed-after-print-screen(on/off/toggle)
  276. # set-print-screen-full-screen(on/off/toggle)
  277. # set-printer-on(on/off/toggle)
  278. # set-auto-print-on-exit-line(on/off/toggle)
  279. # set-mouse-up-down-events(on/off/toggle)
  280. # set-linux-color-compat(on/off/toggle)
  281. # set-block-cursor(on/off/toggle)
  282. # set-cursor-blinks(on/off/toggle)
  283. # set-backspace-is-delete(on/off/toggle)
  284. # set-delete-is-backspace(on/off/toggle)
  285. #
  286. # foreground(color)            Set foreground color.
  287. #
  288. # background(color)            Set background color.
  289. #
  290. # default-foreground(color)        Set default foreground color.
  291. #
  292. # default-background(color)        Set default background color.
  293. #
  294. # used-mouse-buttons(bitmask)        Tell which mouse buttons to use
  295. #                    when mouse buttons are enabled.
  296. #
  297. # mouse-buttons-enabled(bitmask)    Enable mouse buttons told in bitmask.
  298. #
  299. # window-title(string)            Set window title, see string() for
  300. #                    quoting.
  301. #
  302. # icon-title(string)            Set icon title.
  303. #
  304. # log-file-name(string)            Set log file name.
  305. #
  306. # screen-font(font-name)        Change to font. 
  307. #
  308. # initialize-tab-stops(count)        Set tab stops to every count columns.
  309. #
  310. # soft-reset()                Do soft reset.
  311. #
  312. # hard-reset()                Do hard reset.
  313. #
  314. # clear-saved-lines()            Clear terminal history lines.
  315. #
  316. # history-size(count)            Set history size to count lines.
  317. #
  318. # visible-bell()            Do visible-bell.
  319. #
  320. # paste-selection()            Paste current selection
  321. #
  322. # copy-selection(clipboard)        Copy selection to clipboard.
  323. #
  324. # paste-clipboard(clipboard)        Paste clipboard. 
  325. #
  326. #
  327. # Chars-environment
  328. # -----------------
  329. #
  330. # This table can be used to convert any char to string of chars. In macintosh
  331. # this table is used to convert from 8-bit mac charset to iso-latin1 charset.
  332. # Note that this is the only table that permits you to overwrite existing
  333. # entries in the table. In all other tables it is an error to have two
  334. # identical key-values, but here it is allowed. 
  335. #
  336. #
  337. # vtkeys-environment
  338. # ------------------
  339. #
  340. # This table is used to convert emulator special keys to string of characters
  341. # sent to remote host. The TH_Name is the name if the emualator special
  342. # key (TH_BackSpace TH_Tab TH_Linefeed TH_Clear TH_Return TH_Pause
  343. # TH_Scroll_Lock TH_Sys_Req TH_Escape TH_Delete TH_Multi_key
  344. # TH_Home TH_Left TH_Up TH_Right TH_Down TH_Prior TH_Page_Up TH_Next
  345. # TH_Page_Down TH_End TH_Begin TH_Select TH_Print TH_Execute TH_Insert
  346. # TH_Undo TH_Redo TH_Menu TH_Find TH_Cancel TH_Help TH_Break
  347. # TH_Mode_switch TH_script_switch TH_Num_Lock TH_KP_Space TH_KP_Tab
  348. # TH_KP_Enter TH_KP_F1 TH_KP_F2 TH_KP_F3 TH_KP_F4 TH_KP_Home TH_KP_Left
  349. # TH_KP_Up TH_KP_Right TH_KP_Down TH_KP_Prior TH_KP_Page_Up TH_KP_Next
  350. # TH_KP_Page_Down TH_KP_End TH_KP_Begin TH_KP_Insert TH_KP_Delete
  351. # TH_KP_Equal TH_KP_Multiply TH_KP_Add TH_KP_Separator TH_KP_Subtract
  352. # TH_KP_Decimal TH_KP_Divide TH_KP_0 TH_KP_1 TH_KP_2 TH_KP_3 TH_KP_4
  353. # TH_KP_5 TH_KP_6 TH_KP_7 TH_KP_8 TH_KP_9 TH_F1 TH_F2 TH_F3 TH_F4 TH_F5
  354. # TH_F6 TH_F7 TH_F8 TH_F9 TH_F10 TH_F11 TH_L1 TH_F12 TH_L2 TH_F13 TH_L3
  355. # TH_F14 TH_L4 TH_F15 TH_L5 TH_F16 TH_L6 TH_F17 TH_L7 TH_F18 TH_L8
  356. # TH_F19 TH_L9 TH_F20 TH_L10 TH_F21 TH_R1 TH_F22 TH_R2 TH_F23 TH_R3
  357. # TH_F24 TH_R4 TH_F25 TH_R5 TH_F26 TH_R6 TH_F27 TH_R7 TH_F28 TH_R8
  358. # TH_F29 TH_R9 TH_F30 TH_R10 TH_F31 TH_R11 TH_F32 TH_R12 TH_F33 TH_R13
  359. # TH_F34 TH_R14 TH_F35 TH_R15).
  360. #
  361. #
  362. # Vt modifier status
  363. # ------------------
  364. #
  365. # Vt modifier status is combination of the 'Shift', 'Meta', 'Control'. 
  366. #
  367. #
  368. # Vt status
  369. # --------
  370. #
  371. # Vt status is one of the following 'Crlf', 'Cursor', 'Keypad',
  372. # 'Vt52', 'Vt52app'. The order of entries is significant so that None must
  373. # come first and other modifications for the same TH_Key must come after
  374. # that.
  375. #
  376. # Crlf = autolinefeed mode on
  377. # Cursor = cursor keys in application mode
  378. # Keypad = keypad in application mode
  379. # vt52 = in vt52 mode
  380. # vt52app = in vt52 application mode.
  381. #
  382. #
  383. # chars
  384. # -----
  385. #
  386. # Chars is string of charcters in quotes. It can have normal c-style backslash
  387. # escapes.
  388. #
  389.  
  390. Modifiers default-modifiers
  391.     Shift = Shift
  392.     Shift_L = Shift
  393.     Shift_R = Shift
  394.     Control = Control
  395.     Control_L = Control
  396.     Control_R = Control
  397.     Alt = Alt
  398.     Alt_L = Alt
  399.     Alt_R = Alt
  400.     Meta = Meta
  401.     Meta_L = Meta
  402.     Meta_R = Meta
  403.     Menu = Meta
  404.     if enabled map-control-to-capslock
  405.         Lock = Control
  406.         Lock_L = Control
  407.         Lock_R = Control
  408.         CapsLock = Control
  409.         Capital = Control
  410.         CapsLock_L = Control
  411.         CapsLock_R = Control
  412.         ShiftLock = Control
  413.         ShiftLock_L = Control
  414.         ShiftLock_R = Control
  415.     else
  416.         if enabled map-mod5-to-capslock
  417.             Lock = mod5
  418.             Lock_L = mod5
  419.             Lock_R = mod5
  420.             CapsLock = mod5
  421.             Caps_Lock = mod5
  422.             Capital = mod5
  423.             CapsLock_L = mod5
  424.             Caps_Lock_L = mod5
  425.             CapsLock_R = mod5
  426.             Caps_Lock_R = mod5
  427.             ShiftLock = mod5
  428.             Shift_Lock = mod5
  429.             ShiftLock_L = mod5
  430.             Shift_Lock_L = mod5
  431.             ShiftLock_R = mod5
  432.             Shift_Lock_R = mod5
  433.         else
  434.             Lock = Lock
  435.             Lock_L = Lock
  436.             Lock_R = Lock
  437.             CapsLock = CapsLock
  438.             Caps_Lock = CapsLock
  439.             Capital = CapsLock
  440.             CapsLock_L = CapsLock
  441.             Caps_Lock_L = CapsLock
  442.             CapsLock_R = CapsLock
  443.             Caps_Lock_R = CapsLock
  444.             ShiftLock = ShiftLock
  445.             Shift_Lock = ShiftLock
  446.             ShiftLock_L = ShiftLock
  447.             Shift_Lock_L = ShiftLock
  448.             ShiftLock_R = ShiftLock
  449.             Shift_Lock_R = ShiftLock
  450.         end
  451.     end
  452.     if not enabled pf1-4-keys-in-numpad
  453.         NumLock = NumLock
  454.         Num_Lock = NumLock
  455.         NumLock_L = NumLock
  456.         Num_Lock_L = NumLock
  457.         NumLock_R = NumLock
  458.         Num_Lock_R = NumLock
  459.     end
  460.     AltGr = AltGr
  461.     AltGr_L = AltGr
  462.     AltGr_R = AltGr
  463.     Super = Super
  464.     Super_L = Super
  465.     Super_R = Super
  466.     Hyper = Hyper
  467.     Hyper_L = Hyper
  468.     Hyper_R = Hyper
  469. end
  470.  
  471. Chars default-chars
  472.     switch window_system
  473.     "macintosh" ?
  474.         \x80 = "\xc4"
  475.         \x81 = "\xc5"
  476.         \x82 = "\xc7"
  477.         \x83 = "\xc9"
  478.         \x84 = "\xd1"
  479.         \x85 = "\xd6"
  480.         \x86 = "\xdc"
  481.         \x87 = "\xe1"
  482.         \x88 = "\xe0"
  483.         \x89 = "\xe2"
  484.         \x8a = "\xe4"
  485.         \x8b = "\xe3"
  486.         \x8c = "\xe5"
  487.         \x8d = "\xe7"
  488.         \x8e = "\xe9"
  489.         \x8f = "\xe8"
  490.         \x90 = "\xea"
  491.         \x91 = "\xeb"
  492.         \x92 = "\xed"
  493.         \x93 = "\xec"
  494.         \x94 = "\xee"
  495.         \x95 = "\xef"
  496.         \x96 = "\xf1"
  497.         \x97 = "\xf3"
  498.         \x98 = "\xf2"
  499.         \x99 = "\xf4"
  500.         \x9a = "\xf6"
  501.         \x9b = "\xf5"
  502.         \x9c = "\xfa"
  503.         \x9d = "\xf9"
  504.         \x9e = "\xfb"
  505.         \x9f = "\xfc"
  506.         \xa0 = "\x2f\x2d"
  507.         \xa1 = "\xb0"
  508.         \xa2 = "\xa2"
  509.         \xa3 = "\xa3"
  510.         \xa4 = "\xa7"
  511.         \xa5 = "\x53\x62"
  512.         \xa6 = "\xb6"
  513.         \xa7 = "\xdf"
  514.         \xa8 = "\xae"
  515.         \xa9 = "\xa9"
  516.         \xaa = "\x54\x4d"
  517.         \xab = "\xb4"
  518.         \xac = "\xa8"
  519.         \xad = "\x21\x3d"
  520.         \xae = "\xc6"
  521.         \xaf = "\xd8"
  522.         \xb0 = "\x30\x30"
  523.         \xb1 = "\xb1"
  524.         \xb2 = "\x3d\x3c"
  525.         \xb3 = "\x3e\x3d"
  526.         \xb4 = "\xa5"
  527.         \xb5 = "\xb5"
  528.         \xb6 = "\x64\x50"
  529.         \xb7 = "\x2b\x5a"
  530.         \xb8 = "\x2a\x50"
  531.         \xb9 = "\x70\x2a"
  532.         \xba = "\x49\x6e"
  533.         \xbb = "\xaa"
  534.         \xbc = "\xba"
  535.         \xbd = "\x57\x2a"
  536.         \xbe = "\xe6"
  537.         \xbf = "\xf8"
  538.         \xc0 = "\xbf"
  539.         \xc1 = "\xa1"
  540.         \xc2 = "\xac"
  541.         \xc3 = "\x52\x54"
  542.         \xc4 = "\x46\x6c"
  543.         \xc5 = "\x3f\x32"
  544.         \xc6 = "\x44\x2a"
  545.         \xc7 = "\xab"
  546.         \xc8 = "\xbb"
  547.         \xc9 = "\x2e\x33"
  548.         \xca = "\xa0"
  549.         \xcb = "\xc0"
  550.         \xcc = "\xc3"
  551.         \xcd = "\xd5"
  552.         \xce = "\x4f\x45"
  553.         \xcf = "\x6f\x65"
  554.         \xd0 = "\x2d\x4d"
  555.         \xd1 = "\x2d\x4e"
  556.         \xd2 = "\x22\x36"
  557.         \xd3 = "\x22\x39"
  558.         \xd4 = "\x27\x36"
  559.         \xd5 = "\x27\x39"
  560.         \xd6 = "\xf7"
  561.         \xd7 = "\x4f\x4c"
  562.         \xd8 = "\xff"
  563.         \xd9 = "\x59\x3a"
  564.         \xda = "\x2f\x66"
  565.         \xdb = "\xa4"
  566.         \xdc = "\x3c\x31"
  567.         \xdd = "\x3e\x31"
  568.         \xde = "\x66\x69"
  569.         \xdf = "\x66\x6c"
  570.         \xe0 = "\x2f\x3d"
  571.         \xe1 = "\xb7"
  572.         \xe2 = "\x2e\x39"
  573.         \xe3 = "\x3a\x39"
  574.         \xe4 = "\x25\x30"
  575.         \xe5 = "\xc2"
  576.         \xe6 = "\xca"
  577.         \xe7 = "\xc1"
  578.         \xe8 = "\xcb"
  579.         \xe9 = "\xc8"
  580.         \xea = "\xcd"
  581.         \xeb = "\xce"
  582.         \xec = "\xcf"
  583.         \xed = "\xcc"
  584.         \xee = "\xd3"
  585.         \xef = "\xd4"
  586.         \xf0 = "\x5f"
  587.         \xf1 = "\xd2"
  588.         \xf2 = "\xda"
  589.         \xf3 = "\xdb"
  590.         \xf4 = "\xd9"
  591.         \xf5 = "\x69\x2e"
  592.         \xf6 = "\x5f"
  593.         \xf7 = "\x5f"
  594.         \xf8 = "\xaf"
  595.         \xf9 = "\x27\x28"
  596.         \xfa = "\x27\x2e"
  597.         \xfb = "\x27\x30"
  598.         \xfc = "\xb8"
  599.         \xfd = "\x27\x22"
  600.         \xfe = "\x27\x3b"
  601.         \xff = "\x27\x3c"
  602.         end
  603.     end
  604. end
  605.  
  606. Vtkeys default-vtkeys
  607.  
  608. # Backspace and delete ascii characters are special in such way that the
  609. # settings in the keyboard panel can change them to each other. 
  610.     TH_BackSpace = "\010"
  611.     TH_BackSpace+Shift = "\177"
  612.     TH_Delete = "\177"
  613.     TH_Delete+Shift = "\010"
  614.     TH_KP_Delete = "\177"
  615.     TH_KP_Delete+Shift = "\010"
  616.  
  617.     TH_Tab = "\011"
  618.     TH_Linefeed = "\012"
  619.     TH_Clear = "\014"
  620.     TH_Return = "\015"
  621.     TH_Return+Crlf = "\015\012"
  622.     TH_Return+Shift = "\012"
  623.     TH_Pause = "\023"
  624.     TH_Escape = "\033"
  625.     TH_Up = "\033[A"
  626.     TH_Up+Cursor = "\033OA"
  627.     TH_Up+Vt52 = "\033A"
  628.     TH_Down = "\033[B"
  629.     TH_Down+Cursor = "\033OB"
  630.     TH_Down+Vt52 = "\033B"
  631.     TH_Right = "\033[C"
  632.     TH_Right+Cursor = "\033OC"
  633.     TH_Right+Vt52 = "\033C"
  634.     TH_Left = "\033[D"
  635.     TH_Left+Cursor = "\033OD"
  636.     TH_Left+Vt52 = "\033D"
  637.     TH_KP_Space = " "
  638.     TH_KP_Space+Control = "\000"
  639.     TH_KP_Tab = "\011"
  640.     TH_KP_Enter = "\015"
  641.     TH_KP_Enter+Crlf = "\015\012"
  642.     TH_KP_Enter+Shift = "\012"
  643.     TH_KP_Enter+Keypad = "\033OM"
  644.     TH_KP_Enter+Vt52app = "\033?M"
  645.     TH_KP_F1 = "\033OP"
  646.     TH_KP_F1+Keypad = "\033OP"
  647.     TH_KP_F1+Vt52 = "\033P"
  648.     TH_KP_F1+Vt52app = "\033P"
  649.     TH_KP_F2 = "\033OQ"
  650.     TH_KP_F2+Keypad = "\033OQ"
  651.     TH_KP_F2+Vt52 = "\033Q"
  652.     TH_KP_F2+Vt52app = "\033Q"
  653.     TH_KP_F3 = "\033OR"
  654.     TH_KP_F3+Keypad = "\033OR"
  655.     TH_KP_F3+Vt52 = "\033R"
  656.     TH_KP_F3+Vt52app = "\033R"
  657.     TH_KP_F4 = "\033OS"
  658.     TH_KP_F4+Keypad = "\033OS"
  659.     TH_KP_F4+Vt52 = "\033S"
  660.     TH_KP_F4+Vt52app = "\033S"
  661.     TH_KP_Up = "\033[A"
  662.     TH_KP_Up+Cursor = "\033OA"
  663.     TH_KP_Up+Vt52 = "\033A"
  664.     TH_KP_Down = "\033[B"
  665.     TH_KP_Down+Cursor = "\033OB"
  666.     TH_KP_Down+Vt52 = "\033B"
  667.     TH_KP_Right = "\033[C"
  668.     TH_KP_Right+Cursor = "\033OC"
  669.     TH_KP_Right+Vt52 = "\033C"
  670.     TH_KP_Left = "\033[D"
  671.     TH_KP_Left+Cursor = "\033OD"
  672.     TH_KP_Left+Vt52 = "\033D"
  673.     TH_KP_Separator = ","
  674.     TH_KP_Separator+Keypad = "\033Ol"
  675.     TH_KP_Separator+Vt52app = "\033?l"
  676.     TH_KP_Subtract = "-"
  677.     TH_KP_Subtract+Keypad = "\033Om"
  678.     TH_KP_Subtract+Vt52app = "\033?m"
  679.     TH_KP_Decimal = "."
  680.     TH_KP_Decimal+Keypad = "\033On"
  681.     TH_KP_Decimal+Vt52app = "\033?n"
  682.     TH_KP_0 = "0"
  683.     TH_KP_0+Keypad = "\033Op"
  684.     TH_KP_0+Vt52app = "\033?p"
  685.     TH_KP_1 = "1"
  686.     TH_KP_1+Keypad = "\033Oq"
  687.     TH_KP_1+Vt52app = "\033?q"
  688.     TH_KP_2 = "2"
  689.     TH_KP_2+Keypad = "\033Or"
  690.     TH_KP_2+Vt52app = "\033?r"
  691.     TH_KP_3 = "3"
  692.     TH_KP_3+Keypad = "\033Os"
  693.     TH_KP_3+Vt52app = "\033?s"
  694.     TH_KP_4 = "4"
  695.     TH_KP_4+Keypad = "\033Ot"
  696.     TH_KP_4+Vt52app = "\033?t"
  697.     TH_KP_5 = "5"
  698.     TH_KP_5+Keypad = "\033Ou"
  699.     TH_KP_5+Vt52app = "\033?u"
  700.     TH_KP_6 = "6"
  701.     TH_KP_6+Keypad = "\033Ov"
  702.     TH_KP_6+Vt52app = "\033?v"
  703.     TH_KP_7 = "7"
  704.     TH_KP_7+Keypad = "\033Ow"
  705.     TH_KP_7+Vt52app = "\033?w"
  706.     TH_KP_8 = "8"
  707.     TH_KP_8+Keypad = "\033Ox"
  708.     TH_KP_8+Vt52app = "\033?x"
  709.     TH_KP_9 = "9"
  710.     TH_KP_9+Keypad = "\033Oy"
  711.     TH_KP_9+Vt52app = "\033?y"
  712.     TH_KP_Equal = "="
  713.     TH_KP_Multiply = "*"
  714.     TH_KP_Add = "+"
  715.     TH_KP_Divide = "/"
  716.     TH_Find = "\033[1~"
  717.     TH_Insert = "\033[2~"
  718.     TH_Home = "\033[2~"
  719.     TH_KP_Insert = "\033[2~"
  720.     TH_Select = "\033[4~"
  721.     TH_End = "\033[4~"
  722.     TH_Prior = "\033[5~"
  723.     TH_KP_Prior = "\033[5~"
  724.     TH_Page_Up = "\033[5~"
  725.     TH_KP_Page_Up = "\033[5~"
  726.     TH_Next = "\033[6~"
  727.     TH_KP_Next = "\033[6~"
  728.     TH_Page_Down = "\033[6~"
  729.     TH_KP_Page_Down = "\033[6~"
  730.     TH_F1 = "\033[11~"
  731.     TH_F2 = "\033[12~"
  732.     TH_F3 = "\033[13~"
  733.     TH_F4 = "\033[14~"
  734.     TH_F5 = "\033[15~"
  735.     TH_F6 = "\033[17~"
  736.     TH_F7 = "\033[18~"
  737.     TH_F8 = "\033[19~"
  738.     TH_F9 = "\033[20~"
  739.     TH_F10 = "\033[21~"
  740.     TH_F11 = "\033[23~"
  741.     TH_F12 = "\033[24~"
  742.     TH_F13 = "\033[25~"
  743.     TH_F14 = "\033[26~"
  744.     TH_Help = "\033[28~"
  745.     TH_Execute = "\033[29~"
  746.     TH_F17 = "\033[31~"
  747.     TH_F18 = "\033[32~"
  748.     TH_F19 = "\033[33~"
  749.     TH_F20 = "\033[34~"
  750. end
  751.  
  752. Keys default-keys
  753.     Back = "special-key(TH_BackSpace)"
  754.     BackSpace = "special-key(TH_BackSpace)"
  755.     if enabled swap-bs-del-key-mapping
  756.         Back+Control-Shift = "set-backspace-is-delete(toggle)
  757.                       set-delete-is-backspace(toggle)"
  758.         BackSpace+Control-Shift = "set-backspace-is-delete(toggle)
  759.                        set-delete-is-backspace(toggle)"
  760.         Back+Control+Shift = "set-backspace-is-delete(toggle)"
  761.         BackSpace+Control+Shift = "set-backspace-is-delete(toggle)"
  762.     end
  763.     Tab = "special-key(TH_Tab)"
  764.     Linefeed = "special-key(TH_Linefeed)"
  765.     Clear = "special-key(TH_Clear)"
  766.     Return = "special-key(TH_Return)"
  767.     Pause = "special-key(TH_Pause)"
  768.     Scroll = "special-key(TH_Scroll_Lock)"
  769.     ScrollLock = "special-key(TH_Scroll_Lock)"
  770.     Scroll_Lock = "special-key(TH_Scroll_Lock)"
  771.     Sys_Req = "special-key(TH_Sys_Req)"
  772.     Escape = "special-key(TH_Escape)"
  773.     Space+Control = "string(\000)"
  774.     Delete = "special-key(TH_Delete)"
  775.     if enabled swap-bs-del-key-mapping
  776.         Delete+Control-Shift = "set-backspace-is-delete(toggle)
  777.                     set-delete-is-backspace(toggle)"
  778.         Delete+Control+Shift = "set-delete-is-backspace(toggle)"
  779.     end
  780.     Multi_Key = "special-key(TH_Multi_Key)"
  781.     Home = "special-key(TH_Home)"
  782.     Left = "special-key(TH_Left)"
  783.     Up = "special-key(TH_Up)"
  784.     Right = "special-key(TH_Right)"
  785.     Down = "special-key(TH_Down)"
  786.     Prior = "special-key(TH_Page_Up)"
  787.     Page_Up = "special-key(TH_Page_Up)"
  788.     Next = "special-key(TH_Page_Down)"
  789.     Page_Down = "special-key(TH_Page_Down)"
  790.     End = "special-key(TH_End)"
  791.     Begin = "special-key(TH_Begin)"
  792.     Select = "special-key(TH_Select)"
  793.     Snapshot = "special-key(TH_Print)"
  794.     Print = "special-key(TH_Print)"
  795.     Insert = "special-key(TH_Insert)"
  796.     Insert+Control-Shift = "copy-selection(PRIMARY)"
  797.     Insert-Control+Shift = "paste-clipboard(PRIMARY)"
  798.     Execute = "special-key(TH_Execute)"
  799.     switch window_system
  800.     "windows" ?
  801.         Execute = "special-key(TH_KP_Enter)"
  802.         end
  803.     end
  804.     Undo = "special-key(TH_Undo)"
  805.     Redo = "special-key(TH_Redo)"
  806.  
  807. # We dont want to map menu key to anything as it is used to bring up the menus
  808. # in windows (Alt-key). 
  809. #    Menu = "special-key(TH_Menu)"
  810.  
  811.     Find = "special-key(TH_Find)"
  812.     Cancel = "special-key(TH_Cancel)"
  813.     Help = "special-key(TH_Help)"
  814.     Break = "special-key(TH_Break)"
  815.     Mode_switch = "special-key(TH_Mode_switch)"
  816.     Script_switch = "special-key(TH_Script_switch)"
  817.     KP_Tab = "special-key(TH_KP_Tab)"
  818.     KP_Enter = "special-key(TH_KP_Enter)"
  819.     KP_F1 = "special-key(TH_KP_F1)"
  820.     KP_F2 = "special-key(TH_KP_F2)"
  821.     KP_F3 = "special-key(TH_KP_F3)"
  822.     KP_F4 = "special-key(TH_KP_F4)"
  823.     KP_Home = "special-key(TH_KP_Home)"
  824.     KP_Left = "special-key(TH_KP_Left)"
  825.     KP_Up = "special-key(TH_KP_Up)"
  826.     KP_Right = "special-key(TH_KP_Right)"
  827.     KP_Down = "special-key(TH_KP_Down)"
  828.     KP_Prior = "special-key(TH_KP_Prior)"
  829.     KP_Page_Up = "special-key(TH_KP_Page_Up)"
  830.     KP_Next = "special-key(TH_KP_Next)"
  831.     KP_Page_Down = "special-key(TH_KP_Page_Down)"
  832.     KP_End = "special-key(TH_KP_End)"
  833.     KP_Begin = "special-key(TH_KP_Begin)"
  834.     KP_Insert = "special-key(TH_KP_Insert)"
  835.     KP_Delete = "special-key(TH_KP_Delete)"
  836.     if enabled swap-bs-del-key-mapping
  837.         KP_Delete+Control-Shift = "set-backspace-is-delete(toggle)
  838.                        set-delete-is-backspace(toggle)"
  839.         KP_Delete+Control+Shift = "set-delete-is-backspace(toggle)"
  840.     end
  841.     KP_Equal = "special-key(TH_KP_Equal)"
  842.     if enabled pf1-4-keys-in-numpad
  843.         NumLock = "special-key(TH_KP_F1)"
  844.         Divide = "special-key(TH_KP_F2)"
  845.         Multiply = "special-key(TH_KP_F3)"
  846.         Subtract = "special-key(TH_KP_F4)"
  847.         KP_Divide = "special-key(TH_KP_F2)"
  848.         KP_Multiply = "special-key(TH_KP_F3)"
  849.         KP_Subtract = "special-key(TH_KP_F4)"
  850.     else
  851.         Divide = "special-key(TH_KP_Divide)"
  852.         Multiply = "special-key(TH_KP_Multiply)"
  853.         Subtract = "special-key(TH_KP_Subtract)"
  854.         KP_Divide = "special-key(TH_KP_Divide)"
  855.         KP_Multiply = "special-key(TH_KP_Multiply)"
  856.         KP_Subtract = "special-key(TH_KP_Subtract)"
  857.     end
  858.     Add = "special-key(TH_KP_Add)"
  859.     Separator = "special-key(TH_KP_Separator)"
  860.     Decimal = "special-key(TH_KP_Decimal)"
  861.     Numpad0 = "special-key(TH_KP_0)"
  862.     KP_0 = "special-key(TH_KP_0)"
  863.     Numpad1 = "special-key(TH_KP_1)"
  864.     KP_1 = "special-key(TH_KP_1)"
  865.     Numpad2 = "special-key(TH_KP_2)"
  866.     KP_2 = "special-key(TH_KP_2)"
  867.     Numpad3 = "special-key(TH_KP_3)"
  868.     KP_3 = "special-key(TH_KP_3)"
  869.     Numpad4 = "special-key(TH_KP_4)"
  870.     KP_4 = "special-key(TH_KP_4)"
  871.     Numpad5 = "special-key(TH_KP_5)"
  872.     KP_5 = "special-key(TH_KP_5)"
  873.     Numpad6 = "special-key(TH_KP_6)"
  874.     KP_6 = "special-key(TH_KP_6)"
  875.     Numpad7 = "special-key(TH_KP_7)"
  876.     KP_7 = "special-key(TH_KP_7)"
  877.     Numpad8 = "special-key(TH_KP_8)"
  878.     KP_8 = "special-key(TH_KP_8)"
  879.     Numpad9 = "special-key(TH_KP_9)"
  880.     KP_9 = "special-key(TH_KP_9)"
  881.     F1 = "special-key(TH_F1)"
  882.     F2 = "special-key(TH_F2)"
  883.     F3 = "special-key(TH_F3)"
  884.     F4 = "special-key(TH_F4)"
  885.     F5 = "special-key(TH_F5)"
  886.     F6 = "special-key(TH_F6)"
  887.     F7 = "special-key(TH_F7)"
  888.     F8 = "special-key(TH_F8)"
  889.     F9 = "special-key(TH_F9)"
  890.     F10 = "special-key(TH_F10)"
  891.     F11 = "special-key(TH_F11)"
  892.     L1 = "special-key(TH_L1)"
  893.     F12 = "special-key(TH_F12)"
  894.     L2 = "special-key(TH_L2)"
  895.     F13 = "special-key(TH_F13)"
  896.     L3 = "special-key(TH_L3)"
  897.     F14 = "special-key(TH_F14)"
  898.     L4 = "special-key(TH_L4)"
  899.     F15 = "special-key(TH_F15)"
  900.     L5 = "special-key(TH_L5)"
  901.     F16 = "special-key(TH_F16)"
  902.     L6 = "special-key(TH_L6)"
  903.     F17 = "special-key(TH_F17)"
  904.     L7 = "special-key(TH_L7)"
  905.     F18 = "special-key(TH_F18)"
  906.     L8 = "special-key(TH_L8)"
  907.     F19 = "special-key(TH_F19)"
  908.     L9 = "special-key(TH_L9)"
  909.     F20 = "special-key(TH_F20)"
  910.     L10 = "special-key(TH_L10)"
  911.     F21 = "special-key(TH_F21)"
  912.     R1 = "special-key(TH_R1)"
  913.     F22 = "special-key(TH_F22)"
  914.     R2 = "special-key(TH_R2)"
  915.     F23 = "special-key(TH_F23)"
  916.     R3 = "special-key(TH_R3)"
  917.     F24 = "special-key(TH_F24)"
  918.     R4 = "special-key(TH_R4)"
  919.     F25 = "special-key(TH_F25)"
  920.     R5 = "special-key(TH_R5)"
  921.     F26 = "special-key(TH_F26)"
  922.     R6 = "special-key(TH_R6)"
  923.     F27 = "special-key(TH_F27)"
  924.     R7 = "special-key(TH_R7)"
  925.     F28 = "special-key(TH_F28)"
  926.     R8 = "special-key(TH_R8)"
  927.     F29 = "special-key(TH_F29)"
  928.     R9 = "special-key(TH_R9)"
  929.     F30 = "special-key(TH_F30)"
  930.     R10 = "special-key(TH_R10)"
  931.     F31 = "special-key(TH_F31)"
  932.     R11 = "special-key(TH_R11)"
  933.     F32 = "special-key(TH_F32)"
  934.     R12 = "special-key(TH_R12)"
  935.     F33 = "special-key(TH_F33)"
  936.     R13 = "special-key(TH_R13)"
  937.     F34 = "special-key(TH_F34)"
  938.     R14 = "special-key(TH_R14)"
  939.     F35 = "special-key(TH_F35)"
  940.     R15 = "special-key(TH_R15)"
  941.  
  942.     Prior+Shift-Control = "scroll-back(1, line)"
  943.     Page_Up+Shift-Control = "scroll-back(1, line)"
  944.     Prior-Shift+Control = "scroll-back(1, halfpage)"
  945.     Page_Up-Shift+Control = "scroll-back(1, halfpage)"
  946.  
  947.     Next+Shift-Control = "scroll-forward(1, line)"
  948.     Page_Down+Shift-Control = "scroll-forward(1, line)"
  949.     Next-Shift+Control = "scroll-forward(1, halfpage)"
  950.     Page_Down-Shift+Control = "scroll-forward(1, halfpage)"
  951.  
  952.     if enabled mod5-key-to-eight-bit
  953.         Anykey+mod5 = "insert-eight-bit()"
  954.         AnyKey-mod5 = "insert()"
  955.     else
  956.         AnyKey = "insert()"
  957.     end
  958.     if enabled scroll-on-key-mapping
  959.         F1+Control+Shift = "set-scroll-on-key(toggle)"
  960.     end
  961.     if enabled scroll-on-output-mapping
  962.         F2+Control+Shift = "set-scroll-on-screen-output(toggle)"
  963.     end
  964.     if enabled fast-scroll-mapping
  965.         F3+Control+Shift = "set-fast-scroll(toggle)"
  966.     end
  967.     if enabled fi-7-bit-mapping
  968.          F12+Control+Shift = "keymap(fi-7-bit-keymap)"
  969.     end
  970. end
  971.  
  972. Keymap default-keymap
  973.     modifiers = default-modifiers
  974.     keys = default-keys
  975.     chars = default-chars
  976.     vtkeys = default-vtkeys
  977. end
  978.  
  979.  
  980. # Keymap for 7-bit Finnish chars. You can switch to this keymap by
  981. # binding some key to execute "keymap(fi-7-bit-chars)" command.
  982. # Yoy can get back to default keymap by pressing Ctrl+Shift+F12
  983. #
  984. # This is only here to show you how you can have several keymaps
  985. # and how you can take defaults from some other definition.
  986. #
  987. # We cannot use if enabled to comment out whole section only all mappings
  988. # inside, so if fi-7-bit-mapping is not enabled this will generate an
  989. # empty keymap named fi-7-bit-keymap, and there is no way to change to that
  990. # keymap.
  991. #
  992. # This will also demonstrate how to use anonymous structures and merges.
  993.  
  994. Keymap fi-7-bit-keymap
  995.     if enabled fi-7-bit-mapping
  996.         modifiers = default-modifiers
  997.         keys = Keys
  998.             merge default-keys
  999.             F12+Control+Shift = "keymap(default-keymap)"
  1000.         end
  1001.         chars = Chars
  1002.             merge default-chars
  1003.             switch window_system
  1004.             "macintosh" ?
  1005.                 \x8a = "{"
  1006.                  \x8c = "}"
  1007.                 \x9a = "|"
  1008.                 \x80 = "["
  1009.                 \x81 = "]"
  1010.                 \x85 = "\\"
  1011.                 end
  1012.             "x11" ? 
  1013.                 Σ = "{"
  1014.                  σ = "}"
  1015.                  ÷ = "|"
  1016.                  ─ = "["
  1017.                  ┼ = "]"
  1018.                  ╓ = "\\"
  1019.                 end
  1020.             "windows" ? 
  1021.                 Σ = "{"
  1022.                  σ = "}"
  1023.                  ÷ = "|"
  1024.                  ─ = "["
  1025.                  ┼ = "]"
  1026.                  ╓ = "\\"
  1027.                 end
  1028.             end
  1029.         end
  1030.         vtkeys = default-vtkeys
  1031.     end
  1032. end
  1033.  
  1034. # This will tell the default keymap strcture.
  1035.  
  1036. use default-keymap
  1037.  
  1038.  
  1039.