(setq type (car type)))
(if (symbolp type)
(cdr (get type 'event-symbol-elements))
- (let ((list nil))
- (or (zerop (logand type ?\M-\^@))
+ (let ((list nil)
+ (char (logand type (lognot (logior ?\M-\^@ ?\C-\^@ ?\S-\^@
+ ?\H-\^@ ?\s-\^@ ?\A-\^@)))))
+ (if (not (zerop (logand type ?\M-\^@)))
(setq list (cons 'meta list)))
- (or (and (zerop (logand type ?\C-\^@))
- (>= (logand type 127) 32))
+ (if (or (not (zerop (logand type ?\C-\^@)))
+ (< char 32))
(setq list (cons 'control list)))
- (or (and (zerop (logand type ?\S-\^@))
- (= (logand type 255) (downcase (logand type 255))))
+ (if (or (not (zerop (logand type ?\S-\^@)))
+ (/= char (downcase char)))
(setq list (cons 'shift list)))
(or (zerop (logand type ?\H-\^@))
(setq list (cons 'hyper list)))