[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: keystrokes without windows
- To: tcasasent@diamond.kbsi.com
- Subject: Re: keystrokes without windows
- From: bill@cambridge.apple.com (Bill St. Clair)
- Date: Thu, 4 Feb 1993 11:24:43 -0600
- Cc: info-mcl
>How can you process keystrokes without having a window open?
>
>The main problem we're having is finding and identifying the event
>associated with a control- or option-character keystroke. I know about
>adding a function into the *eventhook* function. But I don't know how
>(within that function) to figure out if I'm looking at a keystroke event (or
>even where to get an event).
Your *eventhook* needs to look at the event record in *current-event*.
The format of this record is documented in Inside Macintosh (look
for the EventRecord structure).
Since I think this warrants as extension of MCL's event handling,
I have prepared a patch that calls VIEW-KEY-EVENT-HANDLER with
arguments of *APPLICATION* and the keystroke if the user types a
key when no window is active. The default method beeps, but you can
write your own as follows:
(defclass my-application (application) ())
(setq *application* (make-instance 'my-application))
(defmethod view-key-event-handler ((a my-application) key)
...)
The patch will work standalone or if loaded after patch 1 or patch 2.
If you want it, ask for "no-window-key-events-patch".
-----
Bill St. Clair
bill@cambridge.apple.com