lk201.el 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. ;; -*- no-byte-compile: t -*-
  2. ;; Define function key sequences for DEC terminals.
  3. (defvar lk201-function-map
  4. (let ((map (make-sparse-keymap)))
  5. ;; Termcap or terminfo should set these.
  6. ;; (define-key map "\e[A" [up])
  7. ;; (define-key map "\e[B" [down])
  8. ;; (define-key map "\e[C" [right])
  9. ;; (define-key map "\e[D" [left])
  10. (define-key map "\e[1~" [find])
  11. (define-key map "\e[2~" [insert])
  12. (define-key map "\e[3~" [delete])
  13. (define-key map "\e[4~" [select])
  14. (define-key map "\e[5~" [prior])
  15. (define-key map "\e[6~" [next])
  16. (define-key map "\e[11~" [f1])
  17. (define-key map "\e[12~" [f2])
  18. (define-key map "\e[13~" [f3])
  19. (define-key map "\e[14~" [f4])
  20. (define-key map "\e[15~" [f5])
  21. (define-key map "\e[17~" [f6])
  22. (define-key map "\e[18~" [f7])
  23. (define-key map "\e[19~" [f8])
  24. (define-key map "\e[20~" [f9])
  25. (define-key map "\e[21~" [f10])
  26. ;; Customarily F11 is used as the ESC key.
  27. ;; The file that includes this one, takes care of that.
  28. (define-key map "\e[23~" [f11])
  29. (define-key map "\e[24~" [f12])
  30. (define-key map "\e[25~" [f13])
  31. (define-key map "\e[26~" [f14])
  32. (define-key map "\e[28~" [help])
  33. (define-key map "\e[29~" [menu])
  34. (define-key map "\e[31~" [f17])
  35. (define-key map "\e[32~" [f18])
  36. (define-key map "\e[33~" [f19])
  37. (define-key map "\e[34~" [f20])
  38. ;; Termcap or terminfo should set these.
  39. ;; (define-key map "\eOA" [up])
  40. ;; (define-key map "\eOB" [down])
  41. ;; (define-key map "\eOC" [right])
  42. ;; (define-key map "\eOD" [left])
  43. ;; Termcap or terminfo should set these, but doesn't properly.
  44. ;; Termcap sets these to k1-k4, which get mapped to f1-f4 in term.c
  45. (define-key map "\eOP" [kp-f1])
  46. (define-key map "\eOQ" [kp-f2])
  47. (define-key map "\eOR" [kp-f3])
  48. (define-key map "\eOS" [kp-f4])
  49. (define-key map "\eOI" [kp-tab])
  50. (define-key map "\eOj" [kp-multiply])
  51. (define-key map "\eOk" [kp-add])
  52. (define-key map "\eOl" [kp-separator])
  53. (define-key map "\eOM" [kp-enter])
  54. (define-key map "\eOm" [kp-subtract])
  55. (define-key map "\eOn" [kp-decimal])
  56. (define-key map "\eOo" [kp-divide])
  57. (define-key map "\eOp" [kp-0])
  58. (define-key map "\eOq" [kp-1])
  59. (define-key map "\eOr" [kp-2])
  60. (define-key map "\eOs" [kp-3])
  61. (define-key map "\eOt" [kp-4])
  62. (define-key map "\eOu" [kp-5])
  63. (define-key map "\eOv" [kp-6])
  64. (define-key map "\eOw" [kp-7])
  65. (define-key map "\eOx" [kp-8])
  66. (define-key map "\eOy" [kp-9])
  67. map)
  68. "Function key definitions for DEC terminals.")
  69. (defun terminal-init-lk201 ()
  70. ;; Use inheritance to let the main keymap override these defaults.
  71. ;; This way we don't override terminfo-derived settings or settings
  72. ;; made in the .emacs file.
  73. (let ((m (copy-keymap lk201-function-map)))
  74. (set-keymap-parent m (keymap-parent input-decode-map))
  75. (set-keymap-parent input-decode-map m)))
  76. ;;; lk201.el ends here