anchor.diff:  An event should be bound to the pre-defined function exit-event-loop."
     (flet ((ev (event)
              (let ((keymap (typecase (keymap object)
  +                           ;; the keymap can be a keymap object directly
                              (keymap (keymap object))
  +                           ;; or a symbol as the name of the keymap
                              (symbol (find-keymap (keymap object))))))
                ;; object-local bindings override the external keymap
                ;; an event is checked in the bindings first, then in the external keymap.
                (if (bindings object)
                    (if (assoc event (bindings object))
                        (assoc event (bindings object))
  +                     ;; if there is no handler in the local bindings,
  +                     ;; check if there is a keymap
                        (if (and keymap (bindings keymap))
                            (assoc event (bindings keymap))
                            nil))
  
positive.code: 
  The key bindings alist is stored in the bindings slot of the object.
  
  If no handler is defined for the event, the default event handler t is tried.
  If not even a default handler is defined, the event is ignored.
  
  
negative.code: delay in miliseconds.
  
  Example use: (bind scr #\q  (lambda (win event) (throw 'event-loop :quit)))"
    (with-accessors ((bindings bindings)) object
      (cond ((or (null event)
                 (atom event))
             (setf bindings (acons event handler bindings)))
            ((listp event)
             (dolist (e event)
               (setf bindings (acons e handler bindings)))))))
  
  (defun unbind (object event)
    "Remove the event and the handler function from object's bindings alist.
  
  If event is a list of events, remove each event separately from the alist."
    (with-accessors ((bindings bindings)) object
      (cond ((or (null event)
                 (atom event))
             (setf bindings (remove event bindings :key #'car)))
            ((listp event)
             (dolist (e event)
               (setf bindings (remove e bindings :key #'car)))))))
  
  (defparameter *keymaps* nil "An alist of available keymaps.")
  
  