anchor.diff:    (when (<= #xd800 code #xdbff)
       (charms/ll:timeout 100)
       (let ((c-lead  code)
  -          (c-trail (charms/ll:getch)))
  +          (c-trail (getch-pad)))
         (when (<= #xdc00 c-trail #xdfff)
           (setf code (+ #x10000 (* (- c-lead #xd800) #x0400) (- c-trail #xdc00))))
         (charms/ll:timeout -1)))
  
positive.code:            ((= code #x1ea) (setf code #o403))
             ((= code #x1ed) (setf code #o404))
             ((= code #x1ec) (setf code #o405))
             ;; M-[
             ((= code #x1f1)
              (charms/ll:timeout 100)
              (let ((code1 (charms/ll:getch)))
                (cond
  		;; drop mouse escape sequence
  		((= code1 #x03c)	; <
                   (loop :for code2 := (charms/ll:getch)
                      :until (or (= code2 -1)
                                 (= code2 #x04d)	   ; M
                                 (= code2 #x06d)))   ; m
  
negative.code: (cffi:load-foreign-library '(:default "User32"))
  (defvar *windows-code-page*
    (cffi:foreign-funcall "GetConsoleOutputCP" :int))
  
  ;; for input
  ;; (we can't use *stdscr* for input because it calls wrefresh implicitly)
  (defvar *padwin* nil)
  (defun getch-pad ()
    (unless *padwin*
      (setf *padwin* (charms/ll:newpad 1 1))
      (charms/ll:keypad *padwin* 1)
      (charms/ll:PDC-save-key-modifiers 1))
    (charms/ll:wgetch *padwin*))
  
  ;; for resizing display
  (defkeycode "[resize]" #x222)
  