comparison lisp/x-win-xfree86.el @ 253:157b30c96d03 r20-5b25

Import from CVS: tag r20-5b25
author cvs
date Mon, 13 Aug 2007 10:20:27 +0200
parents 434959a2fba3
children 8626e4521993
comparison
equal deleted inserted replaced
252:afb15df44434 253:157b30c96d03
32 ;;; #### bleck!!! Use key-translation-map! 32 ;;; #### bleck!!! Use key-translation-map!
33 33
34 ;;; #### Counter-bleck!! We shouldn't override a user binding for F13. 34 ;;; #### Counter-bleck!! We shouldn't override a user binding for F13.
35 ;;; So we use function-key-map for now. 35 ;;; So we use function-key-map for now.
36 ;;; When we've implemented a fallback-style equivalent of 36 ;;; When we've implemented a fallback-style equivalent of
37 ;;; keyboard-translate-table, we'll use that instead. (mrb) 37 ;;; keyboard-translate-table, we'll use that instead. (martin)
38 38
39 ;; For no obvious reason, shift-F1 is called F13, although Meta-F1 and 39 ;; For no obvious reason, shift-F1 is called F13, although Meta-F1 and
40 ;; Control-F1 have normal names. 40 ;; Control-F1 have normal names.
41 41
42 (defun x-win-init-xfree86 () 42 (defun x-win-init-xfree86 ()
43 43 (loop for (key sane-key) in
44 (loop for (x-key key sane-key) in 44 '((f13 f1)
45 '(("F13" f13 f1) 45 (f14 f2)
46 ("F14" f14 f2) 46 (f15 f3)
47 ("F15" f15 f3) 47 (f16 f4)
48 ("F16" f16 f4) 48 (f17 f5)
49 ("F17" f17 f5) 49 (f18 f6)
50 ("F18" f18 f6) 50 (f19 f7)
51 ("F19" f19 f7) 51 (f20 f8)
52 ("F20" f20 f8) 52 (f21 f9)
53 ("F21" f21 f9) 53 (f22 f10)
54 ("F22" f22 f10) 54 (f23 f11)
55 ("F23" f23 f11) 55 (f24 f12))
56 ("F24" f24 f12)) 56 do
57 do 57 (when (and (x-keysym-on-keyboard-p key)
58 (when (and (x-keysym-on-keyboard-p x-key) 58 (not (x-keysym-on-keyboard-sans-modifiers-p key)))
59 (not (x-keysym-on-keyboard-sans-modifiers-p x-key))) 59 ;; define also the control, meta, and meta-control versions.
60 ;; define also the control, meta, and meta-control versions. 60 (loop for mods in '(() (control) (meta) (meta control)) do
61 (loop for mods in '(() (control) (meta) (meta control)) do 61 (define-key function-key-map `[(,@mods ,key)] `[(shift ,@mods ,sane-key)])
62 (define-key function-key-map `[(,@mods ,key)] `[(shift ,@mods ,sane-key)]) 62 ))))
63 )))
64
65 ;; (let ((mapping '((f13 . (shift f1))
66 ;; (f14 . (shift f2))
67 ;; (f15 . (shift f3))
68 ;; (f16 . (shift f4))
69 ;; (f17 . (shift f5))
70 ;; (f18 . (shift f6))
71 ;; (f19 . (shift f7))
72 ;; (f20 . (shift f8))
73 ;; (f21 . (shift f9))
74 ;; (f22 . (shift f10))
75 ;; (f23 . (shift f11))
76 ;; (f24 . (shift f12)))))
77 ;;
78 ;; ;; now define them and also the control, meta, and meta-control versions.
79 ;; (while mapping
80 ;; (let* ((foo (caar mapping))
81 ;; (bar (cdar mapping))
82 ;; (foo (if (listp foo) foo (list foo)))
83 ;; (bar (if (listp bar) bar (list bar))))
84 ;; (let ((mods '(() (control) (meta) (meta control))))
85 ;; (while mods
86 ;; (let ((k1 (vector (append (car mods) foo)))
87 ;; (k2 (vector (append (car mods) bar))))
88 ;; (define-key global-map k1 k2))
89 ;; (setq mods (cdr mods))))
90 ;; (setq mapping (cdr mapping)))))
91 )
92 63
93 ;;; x-win-xfree86.el ends here 64 ;;; x-win-xfree86.el ends here