VisibleMouseClicksDoc.tioga
Peter Kessler, May 15, 1986 12:38:32 pm PDT
VisibleMouseClicks
CEDAR 6.1 — FOR INTERNAL XEROX USE ONLY
VisibleMouseClicks
Peter B. Kessler
© Copyright 1985 Xerox Corporation. All rights reserved.
Abstract: Displays mouse button clicks in the cursor.
Created by: Peter B. Kessler
Maintained by: Peter B. Kessler <PeterKessler.pa>
Keywords: visible, mouse, button, click, cursor, teaching
XEROX  Xerox Corporation
   Palo Alto Research Center
   3333 Coyote Hill Road
   Palo Alto, California 94304

For Internal Xerox Use Only
1. Purpose
VisibleMouseClicks addresses the problem of demonstrating how operations are performed via various keystrokes in conjunction with the use of the mouse as a pointing device. In particular, it is impossibly difficult to watch simultaneously the cursor, the mouse buttons, and the control and shift keys. VisibleMouseClicks displays mouse clicks and the state of the shift and control keys in the cursor (which is presumed to be the focus of attention). On the other hand, it's a cute hack.
Mouse clicks are displayed by changing the cursor to a image of the mouse with the appropriate keys highlighted. The left, middle and right mouse buttons always appear, with the depressed button shown wider than the others. The state of the control and shift keys are shown as additional buttons on the left side of the mouse image (this state is displayed on the left side of the mouse image regardless of whether the left or right shift and control keys were used). The image of the mouse buttons persists until some other process changes the cursor (there appear to be several different styles of resetting the cursor).
2. Command Tool Interface
VisibleMouseClicks is a Command Tool command of one argument, either on or off, which respectively enables or disables the display of mouse clicks in the cursor. That is, to make mouse clicks visible, use
VisibleMouseClicks on
and to revert to normal (invisible) mouse clicks, use
VisibleMouseClicks off
3. Programmers Interface
VisibleMouseClicks defines two procedures VisibleMouseClicks.On[] and VisibleMouseClicks.Off[], that respectively enable and disable the display of mouse clicks in the cursor. These procedures return the previous state of visible mouse clicks as element of the type VisibleMouseClicks.Visibility. If you don't like the cursors I chose, they are just variables in VisibleMouseClicksImpl.
4. Wishlist
The cursor is kind of small for displaying the state of five variables, particularly when the cursor is over a piece of the screen with black dots on it already.
Various programs are variously aggressive about maintaining the cursor in their preferred image. For example, Tioga sets the cursor to a textPointer at almost every event (mouse up or down click click, or mouse motion), the menu buttons in Viewers set the cursor as you enter the menu, but never again, and Tioga buttons (e.g. Walnut message sets) whenever you move to the space between buttons. This makes it complicated to worry about resetting the cursor from inside of VisibleMouseClicks, so I don't. This means that ``dragging'' in Tioga resets the cursor to a textPointer. Sigh. The watcher has to remember the state of the mouse buttons as they were last displayed.
It's a shame you can't compute the shape of the cursor dynamically, instead of having to register cursors before you use them. For example, I got tired after making the 12 cursors for the 3 mouse buttons cross the 4 states of shift and control, and so didn't do chords among the mouse buttons.
If the voice server were really fast, maybe it could provide an alternate channel for presenting this information.
Maybe this isn't the best way of doing this: maybe there should be a viewer that records recent keystrokes.