/[cmucl]/src/hemlock/keysym-defs.lisp
ViewVC logotype

Contents of /src/hemlock/keysym-defs.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations)
Mon Oct 31 04:50:12 1994 UTC (19 years, 5 months ago) by ram
Branch: MAIN
CVS Tags: sparc-tramp-assem-base, double-double-array-base, post-merge-intl-branch, release-19b-pre1, release-19b-pre2, merged-unicode-utf16-extfmt-2009-06-11, double-double-init-sparc-2, unicode-utf16-extfmt-2009-03-27, double-double-base, snapshot-2007-09, snapshot-2007-08, snapshot-2008-08, snapshot-2008-09, ppc_gencgc_snap_2006-01-06, sse2-packed-2008-11-12, snapshot-2008-05, snapshot-2008-06, snapshot-2008-07, snapshot-2007-05, snapshot-2008-01, snapshot-2008-02, snapshot-2008-03, intl-branch-working-2010-02-19-1000, snapshot-2006-11, snapshot-2006-10, double-double-init-sparc, snapshot-2006-12, unicode-string-buffer-impl-base, sse2-base, release-20b-pre1, release-20b-pre2, unicode-string-buffer-base, RELEASE_18d, sse2-packed-base, sparc-tramp-assem-2010-07-19, amd64-dd-start, snapshot-2003-10, snapshot-2004-10, release-18e-base, release-19f-pre1, snapshot-2008-12, snapshot-2008-11, intl-2-branch-base, snapshot-2004-08, snapshot-2004-09, remove_negative_zero_not_zero, snapshot-2007-01, snapshot-2007-02, snapshot-2004-05, snapshot-2004-06, snapshot-2004-07, release-19e, release-19d, GIT-CONVERSION, double-double-init-ppc, release-19c, dynamic-extent-base, unicode-utf16-sync-2008-12, LINKAGE_TABLE, release-19c-base, cross-sol-x86-merged, label-2009-03-16, release-19f-base, PRE_LINKAGE_TABLE, merge-sse2-packed, mod-arith-base, sparc_gencgc_merge, merge-with-19f, snapshot-2004-12, snapshot-2004-11, intl-branch-working-2010-02-11-1000, RELEASE_18a, RELEASE_18b, RELEASE_18c, unicode-snapshot-2009-05, unicode-snapshot-2009-06, amd64-merge-start, ppc_gencgc_snap_2005-12-17, double-double-init-%make-sparc, unicode-utf16-sync-2008-07, release-18e-pre2, unicode-utf16-sync-2008-09, unicode-utf16-extfmts-sync-2008-12, prm-before-macosx-merge-tag, cold-pcl-base, RELEASE_20b, snapshot-2008-04, snapshot-2003-11, snapshot-2005-07, unicode-utf16-sync-label-2009-03-16, RELEASE_19f, snapshot-2007-03, release-20a-base, cross-sol-x86-base, unicode-utf16-char-support-2009-03-26, unicode-utf16-char-support-2009-03-25, release-19a-base, unicode-utf16-extfmts-pre-sync-2008-11, snapshot-2008-10, sparc_gencgc, snapshot-2007-04, snapshot-2010-12, snapshot-2010-11, unicode-utf16-sync-2008-11, snapshot-2007-07, snapshot-2011-09, snapshot-2011-06, snapshot-2011-07, snapshot-2011-04, snapshot-2007-06, snapshot-2011-02, snapshot-2011-03, snapshot-2011-01, snapshot-2003-12, release-19a-pre1, release-19a-pre3, release-19a-pre2, pre-merge-intl-branch, release-19a, UNICODE-BASE, double-double-array-checkpoint, double-double-reader-checkpoint-1, release-19d-base, release-19e-pre1, double-double-irrat-end, release-19e-pre2, snapshot-2010-05, snapshot-2010-04, snapshot-2010-07, snapshot-2010-06, snapshot-2010-01, snapshot-2010-03, snapshot-2010-02, release-19d-pre2, release-19d-pre1, snapshot-2010-08, release-18e, double-double-init-checkpoint-1, double-double-reader-base, label-2009-03-25, snapshot-2005-03, release-19b-base, cross-sol-x86-2010-12-20, double-double-init-x86, sse2-checkpoint-2008-10-01, intl-branch-2010-03-18-1300, snapshot-2005-11, double-double-sparc-checkpoint-1, snapshot-2004-04, sse2-merge-with-2008-11, sse2-merge-with-2008-10, snapshot-2005-10, RELEASE_20a, snapshot-2005-12, release-20a-pre1, snapshot-2005-01, snapshot-2009-11, snapshot-2009-12, unicode-utf16-extfmt-2009-06-11, portable-clx-import-2009-06-16, unicode-utf16-string-support, release-19c-pre1, cross-sparc-branch-base, release-19e-base, intl-branch-base, double-double-irrat-start, snapshot-2005-06, snapshot-2005-05, snapshot-2005-04, ppc_gencgc_snap_2005-05-14, snapshot-2005-02, unicode-utf16-base, portable-clx-base, snapshot-2005-09, snapshot-2005-08, lisp-executable-base, snapshot-2009-08, snapshot-2007-12, snapshot-2007-10, snapshot-2007-11, snapshot-2009-02, snapshot-2009-01, snapshot-2009-07, snapshot-2009-05, snapshot-2009-04, snapshot-2006-02, snapshot-2006-03, release-18e-pre1, snapshot-2006-01, snapshot-2006-06, snapshot-2006-07, snapshot-2006-04, snapshot-2006-05, pre-telent-clx, snapshot-2006-08, snapshot-2006-09, HEAD
Branch point for: release-19b-branch, double-double-reader-branch, double-double-array-branch, mod-arith-branch, RELEASE-19F-BRANCH, portable-clx-branch, sparc_gencgc_branch, cross-sparc-branch, RELEASE-20B-BRANCH, RELENG_18, unicode-string-buffer-branch, sparc-tramp-assem-branch, dynamic-extent, UNICODE-BRANCH, release-19d-branch, ppc_gencgc_branch, sse2-packed-branch, lisp-executable, RELEASE-20A-BRANCH, amd64-dd-branch, double-double-branch, unicode-string-buffer-impl-branch, intl-branch, release-18e-branch, cold-pcl, unicode-utf16-branch, cross-sol-x86-branch, release-19e-branch, sse2-branch, release-19a-branch, release-19c-branch, intl-2-branch, unicode-utf16-extfmt-branch
Changes since 1.2: +0 -2 lines
Fix headed boilerplate.
1 ;;; -*- Log: hemlock.log; Mode: Lisp; Package: Hemlock-Internals -*-
2 ;;;
3 ;;; **********************************************************************
4 ;;; This code was written as part of the CMU Common Lisp project at
5 ;;; Carnegie Mellon University, and has been placed in the public domain.
6 ;;;
7 (ext:file-comment
8 "$Header: /tiger/var/lib/cvsroots/cmucl/src/hemlock/keysym-defs.lisp,v 1.3 1994/10/31 04:50:12 ram Rel $")
9 ;;;
10 ;;; **********************************************************************
11 ;;;
12 ;;; This file defines all the definitions of keysyms (see key-event.lisp).
13 ;;; These keysyms match those for X11.
14 ;;;
15 ;;; Written by Bill Chiles
16 ;;; Modified by Blaine Burks.
17 ;;;
18
19 (in-package "HEMLOCK-INTERNALS")
20
21
22 ;;; The IBM RT keyboard has X11 keysyms defined for the following modifier
23 ;;; keys, but we leave them mapped to nil indicating that they are non-events
24 ;;; to be ignored:
25 ;;; ctrl 65507
26 ;;; meta (left) 65513
27 ;;; meta (right) 65514
28 ;;; shift (left) 65505
29 ;;; shift (right) 65506
30 ;;; lock 65509
31 ;;;
32
33
34 ;;; Function keys for the RT.
35 ;;;
36 (ext:define-keysym 65470 "F1")
37 (ext:define-keysym 65471 "F2")
38 (ext:define-keysym 65472 "F3")
39 (ext:define-keysym 65473 "F4")
40 (ext:define-keysym 65474 "F5")
41 (ext:define-keysym 65475 "F6")
42 (ext:define-keysym 65476 "F7")
43 (ext:define-keysym 65477 "F8")
44 (ext:define-keysym 65478 "F9")
45 (ext:define-keysym 65479 "F10")
46 (ext:define-keysym 65480 "F11" "L1")
47 (ext:define-keysym 65481 "F12" "L2")
48
49 ;;; Function keys for the Sun (and other keyboards) -- L1-L10 and R1-R15.
50 ;;;
51 (ext:define-keysym 65482 "F13" "L3")
52 (ext:define-keysym 65483 "F14" "L4")
53 (ext:define-keysym 65484 "F15" "L5")
54 (ext:define-keysym 65485 "F16" "L6")
55 (ext:define-keysym 65486 "F17" "L7")
56 (ext:define-keysym 65487 "F18" "L8")
57 (ext:define-keysym 65488 "F19" "L9")
58 (ext:define-keysym 65489 "F20" "L10")
59 (ext:define-keysym 65490 "F21" "R1")
60 (ext:define-keysym 65491 "F22" "R2")
61 (ext:define-keysym 65492 "F23" "R3")
62 (ext:define-keysym 65493 "F24" "R4")
63 (ext:define-keysym 65494 "F25" "R5")
64 (ext:define-keysym 65495 "F26" "R6")
65 (ext:define-keysym 65496 "F27" "R7")
66 (ext:define-keysym 65497 "F28" "R8")
67 (ext:define-keysym 65498 "F29" "R9")
68 (ext:define-keysym 65499 "F30" "R10")
69 (ext:define-keysym 65500 "F31" "R11")
70 (ext:define-keysym 65501 "F32" "R12")
71 (ext:define-keysym 65502 "F33" "R13")
72 (ext:define-keysym 65503 "F34" "R14")
73 (ext:define-keysym 65504 "F35" "R15")
74
75 ;;; Upper right key bank.
76 ;;;
77 (ext:define-keysym 65377 "Printscreen")
78 ;; Couldn't type scroll lock.
79 (ext:define-keysym 65299 "Pause")
80
81 ;;; Middle right key bank.
82 ;;;
83 (ext:define-keysym 65379 "Insert")
84 (ext:define-keysym 65535 "Delete" "Rubout" (string (code-char 127)))
85 (ext:define-keysym 65360 "Home")
86 (ext:define-keysym 65365 "Pageup")
87 (ext:define-keysym 65367 "End")
88 (ext:define-keysym 65366 "Pagedown")
89
90 ;;; Arrows.
91 ;;;
92 (ext:define-keysym 65361 "Leftarrow")
93 (ext:define-keysym 65362 "Uparrow")
94 (ext:define-keysym 65364 "Downarrow")
95 (ext:define-keysym 65363 "Rightarrow")
96
97 ;;; Number pad.
98 ;;;
99 (ext:define-keysym 65407 "Numlock")
100 (ext:define-keysym 65421 "Numpad\-Return" "Numpad\-Enter") ;num-pad-enter
101 (ext:define-keysym 65455 "Numpad/") ;num-pad-/
102 (ext:define-keysym 65450 "Numpad*") ;num-pad-*
103 (ext:define-keysym 65453 "Numpad-") ;num-pad--
104 (ext:define-keysym 65451 "Numpad+") ;num-pad-+
105 (ext:define-keysym 65456 "Numpad0") ;num-pad-0
106 (ext:define-keysym 65457 "Numpad1") ;num-pad-1
107 (ext:define-keysym 65458 "Numpad2") ;num-pad-2
108 (ext:define-keysym 65459 "Numpad3") ;num-pad-3
109 (ext:define-keysym 65460 "Numpad4") ;num-pad-4
110 (ext:define-keysym 65461 "Numpad5") ;num-pad-5
111 (ext:define-keysym 65462 "Numpad6") ;num-pad-6
112 (ext:define-keysym 65463 "Numpad7") ;num-pad-7
113 (ext:define-keysym 65464 "Numpad8") ;num-pad-8
114 (ext:define-keysym 65465 "Numpad9") ;num-pad-9
115 (ext:define-keysym 65454 "Numpad.") ;num-pad-.
116
117 ;;; "Named" keys.
118 ;;;
119 (ext:define-keysym 65289 "Tab")
120 (ext:define-keysym 65307 "Escape" "Altmode" "Alt") ;escape
121 (ext:define-keysym 65288 "Backspace") ;backspace
122 (ext:define-keysym 65293 "Return" "Enter") ;enter
123 (ext:define-keysym 65512 "Linefeed" "Action" "Newline") ;action
124 (ext:define-keysym 32 "Space" " ")
125
126 ;;; Letters.
127 ;;;
128 (ext:define-keysym 97 "a") (ext:define-keysym 65 "A")
129 (ext:define-keysym 98 "b") (ext:define-keysym 66 "B")
130 (ext:define-keysym 99 "c") (ext:define-keysym 67 "C")
131 (ext:define-keysym 100 "d") (ext:define-keysym 68 "D")
132 (ext:define-keysym 101 "e") (ext:define-keysym 69 "E")
133 (ext:define-keysym 102 "f") (ext:define-keysym 70 "F")
134 (ext:define-keysym 103 "g") (ext:define-keysym 71 "G")
135 (ext:define-keysym 104 "h") (ext:define-keysym 72 "H")
136 (ext:define-keysym 105 "i") (ext:define-keysym 73 "I")
137 (ext:define-keysym 106 "j") (ext:define-keysym 74 "J")
138 (ext:define-keysym 107 "k") (ext:define-keysym 75 "K")
139 (ext:define-keysym 108 "l") (ext:define-keysym 76 "L")
140 (ext:define-keysym 109 "m") (ext:define-keysym 77 "M")
141 (ext:define-keysym 110 "n") (ext:define-keysym 78 "N")
142 (ext:define-keysym 111 "o") (ext:define-keysym 79 "O")
143 (ext:define-keysym 112 "p") (ext:define-keysym 80 "P")
144 (ext:define-keysym 113 "q") (ext:define-keysym 81 "Q")
145 (ext:define-keysym 114 "r") (ext:define-keysym 82 "R")
146 (ext:define-keysym 115 "s") (ext:define-keysym 83 "S")
147 (ext:define-keysym 116 "t") (ext:define-keysym 84 "T")
148 (ext:define-keysym 117 "u") (ext:define-keysym 85 "U")
149 (ext:define-keysym 118 "v") (ext:define-keysym 86 "V")
150 (ext:define-keysym 119 "w") (ext:define-keysym 87 "W")
151 (ext:define-keysym 120 "x") (ext:define-keysym 88 "X")
152 (ext:define-keysym 121 "y") (ext:define-keysym 89 "Y")
153 (ext:define-keysym 122 "z") (ext:define-keysym 90 "Z")
154
155 ;;; Standard number keys.
156 ;;;
157 (ext:define-keysym 49 "1") (ext:define-keysym 33 "!")
158 (ext:define-keysym 50 "2") (ext:define-keysym 64 "@")
159 (ext:define-keysym 51 "3") (ext:define-keysym 35 "#")
160 (ext:define-keysym 52 "4") (ext:define-keysym 36 "$")
161 (ext:define-keysym 53 "5") (ext:define-keysym 37 "%")
162 (ext:define-keysym 54 "6") (ext:define-keysym 94 "^")
163 (ext:define-keysym 55 "7") (ext:define-keysym 38 "&")
164 (ext:define-keysym 56 "8") (ext:define-keysym 42 "*")
165 (ext:define-keysym 57 "9") (ext:define-keysym 40 "(")
166 (ext:define-keysym 48 "0") (ext:define-keysym 41 ")")
167
168 ;;; "Standard" symbol keys.
169 ;;;
170 (ext:define-keysym 96 "`") (ext:define-keysym 126 "~")
171 (ext:define-keysym 45 "-") (ext:define-keysym 95 "_")
172 (ext:define-keysym 61 "=") (ext:define-keysym 43 "+")
173 (ext:define-keysym 91 "[") (ext:define-keysym 123 "{")
174 (ext:define-keysym 93 "]") (ext:define-keysym 125 "}")
175 (ext:define-keysym 92 "\\") (ext:define-keysym 124 "|")
176 (ext:define-keysym 59 ";") (ext:define-keysym 58 ":")
177 (ext:define-keysym 39 "'") (ext:define-keysym 34 "\"")
178 (ext:define-keysym 44 ",") (ext:define-keysym 60 "<")
179 (ext:define-keysym 46 ".") (ext:define-keysym 62 ">")
180 (ext:define-keysym 47 "/") (ext:define-keysym 63 "?")
181
182 ;;; Standard Mouse keysyms.
183 ;;;
184 (ext::define-mouse-keysym 1 25601 "Leftdown" "Super" :button-press)
185 (ext::define-mouse-keysym 1 25602 "Leftup" "Super" :button-release)
186
187 (ext::define-mouse-keysym 2 25603 "Middledown" "Super" :button-press)
188 (ext::define-mouse-keysym 2 25604 "Middleup" "Super" :button-release)
189
190 (ext::define-mouse-keysym 3 25605 "Rightdown" "Super" :button-press)
191 (ext::define-mouse-keysym 3 25606 "Rightup" "Super" :button-release)
192
193 ;;; Sun keyboard.
194 ;;;
195 (ext:define-keysym 65387 "break") ;alternate (Sun).
196 ;(ext:define-keysym 65290 "linefeed")
197
198
199
200 ;;;; SETFs of KEY-EVANT-CHAR and CHAR-KEY-EVENT.
201
202 ;;; Converting ASCII control characters to Common Lisp control characters:
203 ;;; ASCII control character codes are separated from the codes of the
204 ;;; "non-controlified" characters by the code of atsign. The ASCII control
205 ;;; character codes range from ^@ (0) through ^_ (one less than the code of
206 ;;; space). We iterate over this range adding the ASCII code of atsign to
207 ;;; get the "non-controlified" character code. With each of these, we turn
208 ;;; the code into a Common Lisp character and set its :control bit. Certain
209 ;;; ASCII control characters have to be translated to special Common Lisp
210 ;;; characters outside of the loop.
211 ;;; With the advent of Hemlock running under X, and all the key bindings
212 ;;; changing, we also downcase each Common Lisp character (where normally
213 ;;; control characters come in upcased) in an effort to obtain normal command
214 ;;; bindings. Commands bound to uppercase modified characters will not be
215 ;;; accessible to terminal interaction.
216 ;;;
217 (let ((@-code (char-code #\@)))
218 (dotimes (i (char-code #\space))
219 (setf (ext:char-key-event (code-char i))
220 (ext::make-key-event (string (char-downcase (code-char (+ i @-code))))
221 (key-event-modifier-mask "control")))))
222 (setf (ext:char-key-event (code-char 9)) (ext::make-key-event #k"Tab"))
223 (setf (ext:char-key-event (code-char 10)) (ext::make-key-event #k"Linefeed"))
224 (setf (ext:char-key-event (code-char 13)) (ext::make-key-event #k"Return"))
225 (setf (ext:char-key-event (code-char 27)) (ext::make-key-event #k"Alt"))
226 (setf (ext:char-key-event (code-char 8)) (ext::make-key-event #k"Backspace"))
227 ;;;
228 ;;; Other ASCII codes are exactly the same as the Common Lisp codes.
229 ;;;
230 (do ((i (char-code #\space) (1+ i)))
231 ((= i 128))
232 (setf (ext:char-key-event (code-char i))
233 (ext::make-key-event (string (code-char i)))))
234
235 ;;; This makes KEY-EVENT-CHAR the inverse of CHAR-KEY-EVENT from the start.
236 ;;; It need not be this way, but it is.
237 ;;;
238 (dotimes (i 128)
239 (let ((character (code-char i)))
240 (setf (ext::key-event-char (ext:char-key-event character)) character)))
241
242 ;;; Since we treated these characters specially above when setting
243 ;;; EXT:CHAR-KEY-EVENT above, we must set these EXT:KEY-EVENT-CHAR's specially
244 ;;; to make quoting characters into Hemlock buffers more obvious for users.
245 ;;;
246 (setf (ext:key-event-char #k"C-h") #\backspace)
247 (setf (ext:key-event-char #k"C-i") #\tab)
248 (setf (ext:key-event-char #k"C-j") #\linefeed)
249 (setf (ext:key-event-char #k"C-m") #\return)

  ViewVC Help
Powered by ViewVC 1.1.5