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