428
|
1 ;;; linux.el --- define function key sequences for the Linux console
|
|
2
|
|
3 ;; Author: Ben Wing
|
|
4 ;; Keywords: terminals
|
|
5
|
|
6 ;; Copyright (C) 1996 Ben Wing.
|
|
7 ;; This file is part of XEmacs.
|
|
8
|
|
9 ;; XEmacs is free software; you can redistribute it and/or modify it
|
|
10 ;; under the terms of the GNU General Public License as published by
|
|
11 ;; the Free Software Foundation; either version 2, or (at your option)
|
|
12 ;; any later version.
|
|
13
|
|
14 ;; XEmacs is distributed in the hope that it will be useful, but
|
|
15 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
17 ;; General Public License for more details.
|
|
18
|
|
19 ;; You should have received a copy of the GNU General Public License
|
|
20 ;; along with XEmacs; see the file COPYING. If not, write to the Free
|
|
21 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
22 ;; 02111-1307, USA.
|
|
23
|
622
|
24 ;;; Synched up with: FSF 21.0.103.
|
|
25 ;;; (All the define-keys are our own.)
|
|
26
|
|
27 ;;; Commentary:
|
|
28
|
|
29 ;;; Code:
|
|
30
|
|
31 ;; The Linux console handles Latin-1 by default.
|
|
32
|
|
33 (if-fboundp 'set-terminal-coding-system
|
|
34 (unless (declare-fboundp (terminal-coding-system))
|
|
35 (set-terminal-coding-system 'iso-8859-1)))
|
428
|
36
|
622
|
37 ;; Make Latin-1 input characters work, too.
|
|
38 ;; Meta will continue to work, because the kernel
|
|
39 ;; turns that into Escape.
|
|
40
|
|
41 (let ((value (current-input-mode)))
|
|
42 ;; The third arg only matters in that it is not t or nil.
|
1904
|
43 (set-input-mode (nth 0 value) (nth 1 value) 'iso-8859-1 (nth 3 value)))
|
622
|
44
|
|
45 ;; The defines below seem to get automatically set in recent Termcaps.
|
|
46 ;; It was probably the case that in 1996, there was no good Linux termcap,
|
|
47 ;; which is why such a file was needed.
|
|
48
|
|
49 ; ;; Termcap or terminfo should set these next four?
|
|
50 ; (define-key function-key-map "\e[A" [up])
|
|
51 ; (define-key function-key-map "\e[B" [down])
|
|
52 ; (define-key function-key-map "\e[C" [right])
|
|
53 ; (define-key function-key-map "\e[D" [left])
|
428
|
54
|
622
|
55 ; (define-key function-key-map "\e[[A" [f1])
|
|
56 ; (define-key function-key-map "\e[[B" [f2])
|
|
57 ; (define-key function-key-map "\e[[C" [f3])
|
|
58 ; (define-key function-key-map "\e[[D" [f4])
|
|
59 ; (define-key function-key-map "\e[[E" [f5])
|
|
60 ; (define-key function-key-map "\e[17~" [f6])
|
|
61 ; (define-key function-key-map "\e[18~" [f7])
|
|
62 ; (define-key function-key-map "\e[19~" [f8])
|
|
63 ; (define-key function-key-map "\e[20~" [f9])
|
|
64 ; (define-key function-key-map "\e[21~" [f10])
|
|
65 ; (define-key function-key-map "\e[23~" [f11])
|
|
66 ; (define-key function-key-map "\e[24~" [f12])
|
|
67 ; (define-key function-key-map "\e[25~" [f13])
|
|
68 ; (define-key function-key-map "\e[26~" [f14])
|
|
69 ; (define-key function-key-map "\e[28~" [f15])
|
|
70 ; (define-key function-key-map "\e[29~" [f16])
|
|
71 ; (define-key function-key-map "\e[31~" [f17])
|
|
72 ; (define-key function-key-map "\e[32~" [f18])
|
|
73 ; (define-key function-key-map "\e[33~" [f19])
|
|
74 ; (define-key function-key-map "\e[34~" [f20])
|
|
75
|
|
76 ;; But they come out f13-f20 (see above), which are not what we
|
|
77 ;; normally call the shifted function keys. F11 = Shift-F1, F2 =
|
|
78 ;; Shift-F2. What a mess, see below.
|
|
79 (define-key function-key-map "\e[25~" [(shift f3)])
|
|
80 (define-key function-key-map "\e[26~" [(shift f4)])
|
|
81 (define-key function-key-map "\e[28~" [(shift f5)])
|
|
82 (define-key function-key-map "\e[29~" [(shift f6)])
|
|
83 (define-key function-key-map "\e[31~" [(shift f7)])
|
|
84 (define-key function-key-map "\e[32~" [(shift f8)])
|
|
85 (define-key function-key-map "\e[33~" [(shift f9)])
|
|
86 (define-key function-key-map "\e[34~" [(shift f10)])
|
428
|
87
|
622
|
88 ;; I potentially considered these. They would make people's Shift-F1 and
|
|
89 ;; Shift-F2 bindings work -- but of course they would fail to work if the
|
|
90 ;; person also put F11 and F12 bindings. It might also be confusing because
|
|
91 ;; the person with no bindings who hits f11 gets "error shift-f1 unbound".
|
|
92 ;; #### If only there were a proper way around this.
|
|
93 ;(define-key global-map 'f11 [(shift f1)])
|
|
94 ;(define-key global-map 'f12 [(shift f2)])
|
|
95
|
|
96 ; (define-key function-key-map "\e[1~" [home])
|
|
97 ;; seems to not get handled correctly automatically
|
|
98 (define-key function-key-map "\e[2~" [insert])
|
|
99 ; (define-key function-key-map "\e[3~" [delete])
|
|
100 ; (define-key function-key-map "\e[4~" [end])
|
|
101 ; (define-key function-key-map "\e[5~" [prior])
|
|
102 ; (define-key function-key-map "\e[6~" [next])
|
|
103 ; (define-key function-key-map "\e[G" [kp-5])
|
428
|
104
|
622
|
105 ; (define-key function-key-map "\eOp" [kp-0])
|
|
106 ; (define-key function-key-map "\eOq" [kp-1])
|
|
107 ; (define-key function-key-map "\eOr" [kp-2])
|
|
108 ; (define-key function-key-map "\eOs" [kp-3])
|
|
109 ; (define-key function-key-map "\eOt" [kp-4])
|
|
110 ; (define-key function-key-map "\eOu" [kp-5])
|
|
111 ; (define-key function-key-map "\eOv" [kp-6])
|
|
112 ; (define-key function-key-map "\eOw" [kp-7])
|
|
113 ; (define-key function-key-map "\eOx" [kp-8])
|
|
114 ; (define-key function-key-map "\eOy" [kp-9])
|
428
|
115
|
622
|
116 ; (define-key function-key-map "\eOl" [kp-add])
|
|
117 ; (define-key function-key-map "\eOS" [kp-subtract])
|
|
118 ; (define-key function-key-map "\eOM" [kp-enter])
|
|
119 ; (define-key function-key-map "\eOR" [kp-multiply])
|
|
120 ; (define-key function-key-map "\eOQ" [kp-divide])
|
|
121 ; (define-key function-key-map "\eOn" [kp-decimal])
|
|
122 ; (define-key function-key-map "\eOP" [kp-numlock])
|
428
|
123
|
|
124 ;;; linux.el ends here
|
|
125
|