/[cmucl]/src/hemlock/key-event.lisp
ViewVC logotype

Diff of /src/hemlock/key-event.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by ram, Mon Oct 31 04:50:12 1994 UTC revision 1.4 by ram, Wed May 8 14:56:40 1996 UTC
# Line 132  Line 132 
132     this signals an error.  Otherwise, this makes a key-event with the keysym     this signals an error.  Otherwise, this makes a key-event with the keysym
133     and bits formed by mapping the X bits to key-event bits.     and bits formed by mapping the X bits to key-event bits.
134    
135       If any state bit is set that has no suitable modifier translation, it is
136       passed to XLIB:DEFAULT-KEYSYM-INDEX in order to handle Mode_Switch keys
137       appropriately.
138    
139     Otherwise, this makes a key-event with the keysym and bits formed by mapping     Otherwise, this makes a key-event with the keysym and bits formed by mapping
140     the X bits to key-event bits."     the X bits to key-event bits."
141    (let ((new-bits 0)    (let ((new-bits 0)
142          shiftp lockp)          shiftp lockp)
143      (dolist (map *modifier-translations*)      (dolist (map *modifier-translations*)
144        (unless (zerop (logand (car map) bits))        (unless (zerop (logand (car map) bits))
145            ;; ignore the bits of the mapping for the determination of a key index
146            (setq bits (logxor bits (car map)))
147          (cond          (cond
148           ((string-equal (cdr map) "Shift")           ((string-equal (cdr map) "Shift")
149            (setf shiftp t))            (setf shiftp t))
# Line 145  Line 151 
151            (setf lockp t))            (setf lockp t))
152           (t (setf new-bits           (t (setf new-bits
153                    (logior new-bits (key-event-modifier-mask (cdr map))))))))                    (logior new-bits (key-event-modifier-mask (cdr map))))))))
154      (let ((keysym (xlib:keycode->keysym display scan-code (if shiftp 1 0))))      ;; here pass any remaining modifier bits to clx
155        (let* ((index  (and (not (zerop bits))
156                            (xlib:default-keysym-index display scan-code bits)))
157               (keysym (xlib:keycode->keysym display scan-code (or index (if shiftp 1 0)))))
158        (cond ((null (keysym-names keysym))        (cond ((null (keysym-names keysym))
159               nil)               nil)
160              ((and (not shiftp) lockp (<= 97 keysym 122)) ; small-alpha-char-p              ((and (not shiftp) lockp (<= 97 keysym 122)) ; small-alpha-char-p

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.5