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

making presentation actions work when no input expected

    Date: Fri, 24 Feb 89 11:07:59 EDT
    From: cogen@XN.LL.MIT.EDU (David Cogen)
    Another question: What is the significance of the keyword GESTURE in the tester
    function? Doesn't the tester run before any buttons are clicked? So how can it
    know what to set GESTURE to?

It can't know which button you are thinking of clicking, but it can know the
current state of the keyboard shift keys.  You may have noticed that the first
line of the mouse documentation field at the bottom of the screen shows only
commands available on gestures that could be performed without changing the
state of the shift keys ("without moving your left hand").

That doesn't answer your first question.  When you write the
define-presentation-action the way you did in your message, the gesture that's
going to be passed to your :tester function is just the same gesture that you
specified in the :gesture clause of define-presentation-action.  The :gesture
argument to the tester function means "if the user performed this gesture, on
this presentation, in this context, would this presentation action respond to
it."  But your tester function won't even be called for gestures other than
the one you specified, so you don't need to even look at the gesture argument.
The reasons you might want to look at the gesture argument are if you share
a common tester function among several presentation actions or if you use
the :GESTURE T option, meaning all gestures (see book 7A, page 225).