Copyright (C) 1994, Digital Equipment Corp.
Digital Internal Use Only
Created on Fri Feb 18 09:53:07 PST 1994 by najork
In accordance with the terminology used by Trestle, we refer to key
transitions as to {\em key events}. A key event is represented
by a record KeyCB.Rec.
A {\em key event callback object} is an object which has one
method, invoke. Each geometric object has a stack of key callback
objects. When a key event kr is relayed to a particular geometric
o, the the message cb.invoke(kr) is sent to the top callback
object on o's key callback stack (if o's key callback stack is
empty, the event is simply dropped). It is cb's reponsibility to
perform whatever action is appropriate in the current context.
INTERFACEKeyCB ; IMPORT CB, ProxiedObj, VBT; TYPE T <: Public; Public = ProxiedObj.T OBJECT METHODS init () : T; invoke (kr : Rec) RAISES {CB.BadMethod}; END;
KeyCB.Tis the abstract class of key callback objects. Ifois a geometric object,cis the top object in its key callback stack, and a key eventkrgets relayed too, thencb.invoke(kr)will be called. It is up to the user to create subclasses ofKeyCB.Tthat handle key events in a given context appropriately.
Rec = RECORD
whatChanged : VBT.KeySym;
wentDown : BOOLEAN;
modifiers : VBT.Modifiers;
END;
KeyCB.Recis a record type containing information about a key event.whatChangedis the key that went up or down,wentDownindicates whether it went down or up.modifiersis the set of modifiers (Shift, Control, Mouse Buttons, etc.) that was active when the transition took place.{\em NOTE: There is a fair chance that I will add other fields to
Rec, once we have gained more experience with event handling. So far, I pretty much mimick (part of) what is there inVBT.KeyRec.}
END KeyCB.