|
23 | 23 | (ctrl nil :type boolean)
|
24 | 24 | (meta nil :type boolean)
|
25 | 25 | (super nil :type boolean)
|
26 |
| - (hypher nil :type boolean) |
| 26 | + (hyper nil :type boolean) |
27 | 27 | (shift nil :type boolean)
|
28 | 28 | (sym 0 :type string))
|
29 | 29 |
|
30 | 30 | (defmethod print-object ((object key) stream)
|
31 |
| - (with-slots (ctrl meta super hypher shift sym) object |
| 31 | + (with-slots (ctrl meta super hyper shift sym) object |
32 | 32 | (write-string (key-to-string :ctrl ctrl
|
33 | 33 | :meta meta
|
34 | 34 | :super super
|
35 |
| - :hypher hypher |
| 35 | + :hyper hyper |
36 | 36 | :shift shift
|
37 | 37 | :sym sym)
|
38 | 38 | stream)))
|
39 | 39 |
|
40 |
| -(defun key-to-string (&key ctrl meta super hypher shift sym) |
| 40 | +(defun key-to-string (&key ctrl meta super hyper shift sym) |
41 | 41 | (with-output-to-string (stream)
|
42 |
| - (when hypher (write-string "H-" stream)) |
| 42 | + (when hyper (write-string "H-" stream)) |
43 | 43 | (when super (write-string "S-" stream))
|
44 | 44 | (when meta (write-string "M-" stream))
|
45 | 45 | (when ctrl (write-string "C-" stream))
|
|
54 | 54 |
|
55 | 55 | (defvar *key-constructor-cache* (make-hash-table :test 'equal))
|
56 | 56 |
|
57 |
| -(defun convert-key (&rest args &key ctrl meta super hypher shift sym) |
| 57 | +(defun convert-key (&rest args &key ctrl meta super hyper shift sym) |
58 | 58 | (let ((elt (assoc (apply #'key-to-string args) *key-conversions* :test #'equal)))
|
59 | 59 | (if elt
|
60 | 60 | (let ((key (first (parse-keyspec (cdr elt)))))
|
61 | 61 | (list :ctrl (key-ctrl key)
|
62 | 62 | :meta (key-meta key)
|
63 | 63 | :super (key-super key)
|
64 |
| - :hypher (key-hypher key) |
| 64 | + :hyper (key-hyper key) |
65 | 65 | :shift (key-shift key)
|
66 | 66 | :sym (key-sym key)))
|
67 | 67 | (list :ctrl ctrl
|
68 | 68 | :meta meta
|
69 | 69 | :super super
|
70 |
| - :hypher hypher |
| 70 | + :hyper hyper |
71 | 71 | :shift shift
|
72 | 72 | :sym sym))))
|
73 | 73 |
|
74 |
| -(defun make-key (&rest args &key ctrl meta super hypher shift sym) |
75 |
| - (declare (ignore ctrl meta super hypher shift sym)) |
| 74 | +(defun make-key (&rest args &key ctrl meta super hyper shift sym) |
| 75 | + (declare (ignore ctrl meta super hyper shift sym)) |
76 | 76 | (let ((hashkey (apply #'convert-key args)))
|
77 | 77 | (or (gethash hashkey *key-constructor-cache*)
|
78 | 78 | (setf (gethash hashkey *key-constructor-cache*)
|
79 | 79 | (apply #'%make-key args)))))
|
80 | 80 |
|
81 |
| -(defun match-key (key &key ctrl meta super hypher shift sym) |
| 81 | +(defun match-key (key &key ctrl meta super hyper shift sym) |
82 | 82 | (and (eq (key-ctrl key) ctrl)
|
83 | 83 | (eq (key-meta key) meta)
|
84 | 84 | (eq (key-super key) super)
|
85 |
| - (eq (key-hypher key) hypher) |
| 85 | + (eq (key-hyper key) hyper) |
86 | 86 | (eq (key-shift key) shift)
|
87 | 87 | (equal (key-sym key) sym)))
|
88 | 88 |
|
|
0 commit comments