/[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.1.1.1 by ram, Fri Jul 20 16:05:22 1990 UTC revision 1.1.1.2 by wlott, Wed Oct 10 17:35:35 1990 UTC
# Line 111  Line 111 
111    
112  ;;; TRANSLATE-KEY-EVENT -- Public.  ;;; TRANSLATE-KEY-EVENT -- Public.
113  ;;;  ;;;
114  #+nil  #+clx
115  (defun translate-key-event (display scan-code bits)  (defun translate-key-event (display scan-code bits)
116    "Translates the X scan-code and X bits to a key-event.  First this maps    "Translates the X scan-code and X bits to a key-event.  First this maps
117     scan-code to an X keysym using XLIB:KEYCODE->KEYSYM looking at bits and     scan-code to an X keysym using XLIB:KEYCODE->KEYSYM looking at bits and
# Line 317  Line 317 
317  ;;; modifier identifier.  ;;; modifier identifier.
318  ;;;  ;;;
319  (defvar *id-namestring*  (defvar *id-namestring*
320    (make-array 30 :adjustable t :fill-pointer 0 :element-type 'string-char))    (make-array 30 :adjustable t :fill-pointer 0 :element-type 'base-character))
321    
322  ;;; PARSE-KEY-FUN -- Internal.  ;;; PARSE-KEY-FUN -- Internal.
323  ;;;  ;;;
# Line 472  Line 472 
472    
473  ;;; DEFINE-CLX-MODIFIER -- Public.  ;;; DEFINE-CLX-MODIFIER -- Public.
474  ;;;  ;;;
475  (defun <define-clx-modifier (clx-mask modifier-name)  (defun define-clx-modifier (clx-mask modifier-name)
476    "This establishes a mapping from clx-mask to a define key-event modifier-name.    "This establishes a mapping from clx-mask to a define key-event modifier-name.
477     TRANSLATE-KEY-EVENT and TRANSLATE-MOUSE-KEY-EVENT can only return key-events     TRANSLATE-KEY-EVENT and TRANSLATE-MOUSE-KEY-EVENT can only return key-events
478     with bits defined by this routine."     with bits defined by this routine."
# Line 540  Line 540 
540    (let* ((high-byte (ash keysym -8))    (let* ((high-byte (ash keysym -8))
541           (low-byte-vector (svref *keysym-high-bytes* high-byte)))           (low-byte-vector (svref *keysym-high-bytes* high-byte)))
542      (unless low-byte-vector      (unless low-byte-vector
543        (let ((new-vector (make-array 256)))        (let ((new-vector (make-array 256 :initial-element nil)))
544          (setf (svref *keysym-high-bytes* high-byte) new-vector)          (setf (svref *keysym-high-bytes* high-byte) new-vector)
545          (setf low-byte-vector new-vector)))          (setf low-byte-vector new-vector)))
546      (let* ((low-byte (ldb (byte 8 0) keysym))      (let* ((low-byte (ldb (byte 8 0) keysym))
547             (bit-vector (svref low-byte-vector low-byte)))             (bit-vector (svref low-byte-vector low-byte)))
548        (unless bit-vector        (unless bit-vector
549          (let ((new-vector (make-array modifier-bits-limit)))          (let ((new-vector (make-array modifier-bits-limit
550                                          :initial-element nil)))
551            (setf (svref low-byte-vector low-byte) new-vector)            (setf (svref low-byte-vector low-byte) new-vector)
552            (setf bit-vector new-vector)))            (setf bit-vector new-vector)))
553        (let ((key-event (svref bit-vector bits)))        (let ((key-event (svref bit-vector bits)))
# Line 728  Line 729 
729    (setf *all-modifier-names* ())    (setf *all-modifier-names* ())
730    (setf *keysym-high-bytes* (make-array 256 :initial-element nil))    (setf *keysym-high-bytes* (make-array 256 :initial-element nil))
731    (setf *key-event-characters* (make-hash-table))    (setf *key-event-characters* (make-hash-table))
732    (setf *character-key-events* (make-array char-code-limit :initial-element nil))    (setf *character-key-events*
733            (make-array char-code-limit :initial-element nil))
734    
735    (define-key-event-modifier "Hyper" "H")    (define-key-event-modifier "Hyper" "H")
736    (define-key-event-modifier "Super" "S")    (define-key-event-modifier "Super" "S")
# Line 736  Line 738 
738    (define-key-event-modifier "Control" "C")    (define-key-event-modifier "Control" "C")
739    (define-key-event-modifier "Shift" "Shift")    (define-key-event-modifier "Shift" "Shift")
740    (define-key-event-modifier "Lock" "Lock")    (define-key-event-modifier "Lock" "Lock")
741  #|  
742    (define-clx-modifier (xlib:make-state-mask :shift) "Shift")    #+clx (define-clx-modifier (xlib:make-state-mask :shift) "Shift")
743    (define-clx-modifier (xlib:make-state-mask :mod-1) "Meta")    #+clx (define-clx-modifier (xlib:make-state-mask :mod-1) "Meta")
744    (define-clx-modifier (xlib:make-state-mask :control) "Control")    #+clx (define-clx-modifier (xlib:make-state-mask :control) "Control")
745    (define-clx-modifier (xlib:make-state-mask :lock) "Lock")    #+clx (define-clx-modifier (xlib:make-state-mask :lock) "Lock"))
 |#  
 )  

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.2

  ViewVC Help
Powered by ViewVC 1.1.5