MACINTOSH INSTRUCTIONS FOR GARNET 3.0 December 10, 1994 This file contains a few Macintosh-specific instructions for using Garnet. It highlights information already contained in the Garnet 3.0 reference manual and the changes3.0.txt document which describes the changes for version 3.0. COMPENSATING FOR 31-CHARACTER FILENAMES: As mentioned in the changes3.0 file, there are several gadgets files that normally have names that are longer than 31 characters. To allow Mac users to continue to specify the full-length names of these files, we have modified user::garnet-load (described in the Garnet 2.2 Overview manual) to translate the regular names of the gadgets into their truncated 31-char names so they can be loaded. It is recommended that Garnet-Load be used whenever any Garnet file is loaded, so that typically long and cumbersome pathnames can be abbreviated by a short prefix. DIRECTORIES: Unlike the Unix version, the Macintosh version currently stores all the binary and source files together in the various subdirectories under "src". We might fix this, but Garnet-Load will always know where to find the files. BINDING KEYS: As in the Unix version (and described in the V2.2 manual), we have assigned Lisp keywords for most of the keys on the Macintosh keyboard. Thus, to start when the "F1" key is hit, use :F1 as the :start-event of an interactor. If you want to know what a key generates, you can use the small utility Find-Key-Symbols which has been ported to the Mac. Execute (garnet-load "inter-src:find-key-symbols") to bring up a window which can perceive keyboard events and prints out the resulting characters. The data you collect from this utility can be used in the :start-where slot of interactors to describe events that will start the interactor, and can be used to modify the characters generated by the keyboard key by editing the file "inter:mac-define-keys.lisp". SIMULATING MULTIPLE MOUSE BUTTONS WITH THE KEYBOARD: Most of the Garnet demos assume a three button mouse. To simulate this on the Macintosh, we use keyboard keys to replace a three-button mouse. By default, the keys are F13, F14, and F15 for the left, middle, and right mouse buttons, respectively. The real mouse button is also mapped to :leftdown. You can redefine the keys to be any three keys you want by setting inter::*leftdown-key*, inter::*middledown-key*, and inter::*rightdown-key* after loading Garnet or by editing the file inter/mac-define-keys.lisp directly. These variables should contain numerical key-codes corresponding to your desired keys. Some key-codes are shown on p. I-251 of Inside Macintosh Volume I, but you can also do (garnet-load "inter:find-key-symbols") to run a utility program that tells you the key-code for any keyboard key. The utility will generate numbers that can be used directly in inter/mac-define-keys.lisp. MODIFIER KEYS: Like MCL itself, Garnet treats the Option key as the "Meta" key. Also, you currently cannot get access to the Command (Open-Apple) key from Garnet. THINGS TO KEEP IN MIND WHEN YOU WANT YOUR GARNET PROGAMS TO RUN ON BOTH X WINDOWS AND THE MAC: * Use user::garnet-load instead of load when loading gadget files * Only supply :face values for fonts that run on both systems -- this typically restricts you to using only the standard faces available in previous (Unix) versions of Garnet. * The #+apple and #-apple reader macros can be used to indicate code that should be used only for Macs and only for non-Macs, respectively. When defining fonts, for example, you may want to provide the slot description (:face #+apple :underline #-apple :bold) to indicate that the font will be underlined on the Mac but bold in X. * The default place for windows is at (0,0) which unfortunately puts them under the Macintosh menubar, so you cannot even move the window using the mouse! (You can still s-value the position from the Lisp Listener.) Therefore, never create a window on the Mac with a :top less than 45 or it will not be movable. * Remember that many Mac screens are much smaller than most workstations' screens. Positioning windows perfectly may not be possible, and a better goal may be to simply keep the window title-bars within reach of the mouse so that the windows can be moved.