[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

more flexible READ-CHAR?

I need a version of READ-CHAR that

1. catches ALL key events (READ-CHAR ignores #\Backspace, for instance)

2. does NOT print to the listener.

I've been doing it like this, but this is slow:

(defvar *key-event* nil)

(defobfun (window-key-event-handler *my-window*) (char)
   (setq *key-event* char))

(defun my-read-char (&rest ignore)
  (let ((*key-event* nil))
     (when *key-event* (return *key-event*)))))

Can someone suggest an improvement? How does READ-CHAR work internally?