anchor.diff:                (setf (lem::attribute-%internal-value attribute) bits)
                 bits)))))
   
  +;; XXX: see ncurses-pdcurseswin32.lisp:getch-pad
  +(defvar *padwin* nil)
  +(defun getch ()
  +  (unless *padwin*
  +    (setf *padwin* (charms/ll:newpad 1 1))
  +    (charms/ll:keypad *padwin* 1)
  +    ;; timeout setting is necessary to exit lem normally
  +    (charms/ll:wtimeout *padwin* 0))
  +  (charms/ll:wgetch *padwin*))
  +
   (defun get-key (code)
     (let* ((char (let ((nbytes (utf8-bytes code)))
                    (if (= nbytes 1)
  
positive.code:                   (#.(char-code #\F) (make-key :shift t :meta t :sym "End"))
                    (#.(char-code #\H) (make-key :shift t :meta t :sym "Home"))))
               (#.(char-code #\5)
                  (case (charms/ll:getch)
                    (#.(char-code #\A) (make-key :ctrl t :sym "Up"))
                    (#.(char-code #\B) (make-key :ctrl t :sym "Down"))
                    (#.(char-code #\C) (make-key :ctrl t :sym "Right"))
  
negative.code:                    (let ((vec (make-array nbytes :element-type '(unsigned-byte 8))))
                       (setf (aref vec 0) code)
                       (loop :for i :from 1 :below nbytes
                             :do (setf (aref vec i) (getch)))
                       (handler-case (schar (babel:octets-to-string vec) 0)
                         (babel-encodings:invalid-utf8-continuation-byte ()
                           (code-char code)))))))
  