home *** CD-ROM | disk | FTP | other *** search
- 18-Jun-88 14:39:29-MDT,24316;000000000000
- Return-Path: <u-lchoqu%sunset@cs.utah.edu>
- Received: from cs.utah.edu by SIMTEL20.ARPA with TCP; Sat, 18 Jun 88 14:38:56 MDT
- Received: by cs.utah.edu (5.54/utah-2.0-cs)
- id AA22548; Sat, 18 Jun 88 14:38:50 MDT
- Received: by sunset.utah.edu (5.54/utah-2.0-leaf)
- id AA24727; Sat, 18 Jun 88 14:38:46 MDT
- Date: Sat, 18 Jun 88 14:38:46 MDT
- From: u-lchoqu%sunset@cs.utah.edu (Lee Choquette)
- Message-Id: <8806182038.AA24727@sunset.utah.edu>
- To: rthum@simtel20.arpa
- Subject: QuicKeys.c.shar
-
- #! /bin/sh
- #
- # This is a shell archive. Save this into a file, edit it
- # and delete all lines above this comment. Then give this
- # file to sh by executing the command "sh file". The files
- # will be extracted into the current directory owned by
- # you with default permissions.
- #
- # These code resources all interact with CE Software's QuicKeys
- # keyboard enhancer.
- # The files contained herein are:
- #
- # 5 GotoStdfile.c
- # 4 ProjectSwitch.c
- # 8 SetQuicText.c
- # 5 quickeys.h
- #
- echo 'Extracting GotoStdfile.c'
- if test -f GotoStdfile.c; then echo 'shar: will not overwrite GotoStdfile.c'; else
- sed 's/^X//' << '________This_Is_The_END________' > GotoStdfile.c
- X/*
- X * StdFile: XCMD to position the standard file open dialog box to a particular volume & folder.
- X * Can also be built as an FKEY for use in a QuicKeys environment, where it takes its
- X * argument from a text key (Command-Option-Shift-Zero).
- X * Dewi Williams, Delphi: DEWI.
- X */
- X
- X#include <MemoryMgr.h>
- X#include <EventMgr.h>
- X#include <FileMgr.h>
- X#include <HFS.h>
- X#include <StdFilePkg.h>
- X#include <HyperXCmd.h> /* Defines and structures for HyperCard XCMD programming */
- X#include "QuicKeys.h"
- X
- X/* Build a FKEY instead of a Hypercard XCMD. */
- X#define FKEY 1
- X#define NULL 0L
- X
- X/* Forward references */
- XQuicInitBlock *FindSysHeap();
- XStringPtr pstrchr(StringPtr str, unsigned char c);
- XBoolean FindSFArg(QuicInitBlock *qb, StringPtr arg);
- X
- Xpascal void
- Xmain(paramPtr)
- X#ifndef FKEY
- XXCmdBlockPtr paramPtr;
- X#endif
- X{
- X DirInfo dirInfo;
- X HVolumeParam v;
- X register unsigned char *partialPath;
- X register Byte slen;
- X Str255 pathName;
- X QuicInitBlock *qb;
- X
- X /* Check for HFS */
- X if (FSFCBLen == -1) { /* Not running HFS */
- X SysBeep(1);
- X return;
- X }
- X
- X#ifdef FKEY
- X /* Retrieve the path. It's to be found as a program-specific text item (Cmd-Option-Shift-0 (zero)). */
- X if ( (qb = FindSysHeap()) == NULL) {
- X SysBeep(1);
- X return;
- X }
- X
- X if (FindSFArg(qb, pathName) == FALSE) {
- X /* Keycode doesn't exist. */
- X SysBeep(1);
- X return;
- X }
- X#else
- X /* There should only be one parameter. */
- X if (paramPtr->paramCount != 1) {
- X SysBeep(1);
- X return;
- X }
- X
- X /* First param is the pathname. Convert it to a pascal string */
- X ZeroToPas(paramPtr,*(paramPtr->params[0]), pathName);
- X#endif
- X
- X /* The path must contain at least 1 colon. */
- X if ((partialPath = pstrchr(pathName, ':')) == NULL) {
- X SysBeep(1);
- X return;
- X }
- X
- X /* Temporarily isolate the volume component of the pathname. */
- X slen = pathName[0]; /* Save the length */
- X pathName[0] = (long)partialPath - (long)pathName;
- X
- X /* First, get the vRefNum corresponding to Programming: */
- X v.ioCompletion = NULL;
- X v.ioNamePtr = pathName;
- X v.ioVRefNum = 0x8000; /* See TechNote #77 */
- X v.ioVolIndex = -1; /* use name & vrefnum */
- X
- X if (PBHGetVInfo(&v, FALSE) != noErr) {
- X SysBeep(1);
- X return;
- X }
- X
- X pathName[0] = slen; /* Restore the full path */
- X
- X /* Now we need the dirID corresponding to the partial path. */
- X dirInfo.ioCompletion = NULL;
- X dirInfo.ioNamePtr = pathName;
- X dirInfo.ioVRefNum = 0;
- X dirInfo.ioFDirIndex = 0; /* use name and vrefnum */
- X dirInfo.ioDrDirID = 0;
- X
- X if (PBGetCatInfo(&dirInfo, FALSE) != noErr) {
- X SysBeep(1);
- X return;
- X }
- X
- X /* And is it a folder? */
- X if ( ! (dirInfo.ioFlAttrib & 0x10 )) { /* It's a file! */
- X SysBeep(1);
- X return;
- X }
- X
- X /* Set up the folder info for StdFile. */
- X CurDirStore = dirInfo.ioDrDirID;
- X
- X /* Set up the volume info for StdFile. */
- X SFSaveDisk = -1 * v.ioVRefNum;
- X}
- X
- X/*
- X * pstrchr: return pointer to first occurrence of char in pstring.
- X */
- X
- XStringPtr
- Xpstrchr(str, c)
- Xregister StringPtr str;
- Xregister unsigned char c;
- X{
- X register StringPtr end = str + str[0] + 1;
- X
- X for (str++;str < end; str++)
- X if (*str == c) return str;
- X
- X return NULL;
- X}
- X
- X#ifdef FKEY
- X/*
- X * This is a C version of the example code in Chapter 8 of the QuicKeys manual.
- X */
- X
- XQuicInitBlock *
- XFindSysHeap()
- X{
- X register Ptr endBlk = SysZone->bkLim;
- X register QuicInitBlock *qp;
- X
- X qp = (QuicInitBlock *) &SysZone->heapData;
- X
- X while(qp != (QuicInitBlock *) endBlk) {
- X /* Analyze the block we're looking at. */
- X if ((qp->header[0] & 0xC0) == 0x40) { /* Is it non-relocatable? */
- X /* Check magic and signature. */
- X if (qp->quic.magic == 0xa89f1234 && qp->quic.signature == 'CELN') {
- X /* Chapter 8 states that the version number is 1. It's actually 0 (as the example
- X * assembly language shows and a quick call to CE Software confirmed).
- X */
- X if (qp->quic.version == 0) return qp;
- X }
- X }
- X
- X /* Time to move on to the next block. The 0xFFFFFF strips off the tag byte(s). */
- X qp = (QuicInitBlock *)(((Byte *)qp) + ((* (long *)&qp->header) & 0xFFFFFF));
- X }
- X return NULL; /* Failed to find it */
- X}
- X
- X/*
- X * FindSFArg: Hunts for current contents of Cmd-Option-Shift-Zero.
- X */
- X
- XBoolean
- XFindSFArg(qb, arg)
- XQuicInitBlock *qb;
- XStringPtr arg;
- X{
- X register KeyRecord *kr = qb->quic.application;
- X register KeyRecord *end = kr + N_QCKEYS;
- X
- X /* 0x1de2 is the keycode/charcode for Cmd-Option-Shift-0 (found by experimentation). */
- X for (; kr < end; kr++) {
- X if (kr->QKtype == QK_TEXT) {
- X if ((kr->key) == 0x1de2 && (kr->modifiers == (cmdKey|optionKey|shiftKey))) {
- X BlockMove(kr->u.QuicText.text, arg, (Size)(kr->u.QuicText.text[0] +1));
- X return TRUE;
- X }
- X }
- X }
- X return FALSE;
- X}
- X#endif
- ________This_Is_The_END________
- if test `wc -l < GotoStdfile.c` -ne 186; then
- echo 'shar: GotoStdfile.c was damaged during transit'
- echo ' (should have been 186 bytes)'
- fi
- fi ; : end of overwriting check
- echo 'Extracting ProjectSwitch.c'
- if test -f ProjectSwitch.c; then echo 'shar: will not overwrite ProjectSwitch.c'; else
- sed 's/^X//' << '________This_Is_The_END________' > ProjectSwitch.c
- X/*
- X * ProjectSwitch: FKEY that works with QuicKeys to automate project switching for multiple project
- X * environments. It puts the name of the current project into a QuicKey text key.
- X * This can be used as a form of parameter substitution for sequences.
- X * The key chosen is Cmd-Option-Shift 1.
- X */
- X
- X
- X#include <MacTypes.h>
- X#include <MemoryMgr.h>
- X#include <EventMgr.h>
- X#include <WindowMgr.h>
- X#include <SegmentLdr.h>
- X#include "QuicKeys.h"
- X
- X#define NULL 0L
- X
- X/* Forward references */
- XQuicInitBlock *FindSysHeap();
- XBoolean UpdateParamKey(QuicInitBlock *qb, StringHandle theText, int param);
- X
- Xpascal void
- Xmain()
- X{
- X register WindowPeek wp;
- X register QuicInitBlock *qb;
- X
- X /* Have to be running Lightspeed C */
- X if (IUCompString(CurApName, "\pLightspeedC\252") != 0) {
- X SysBeep(1);
- X return;
- X }
- X
- X if ((qb = FindSysHeap()) == NULL) {
- X SysBeep(1);
- X return;
- X }
- X
- X /*
- X * Search the window list for the project window. This search relies on Lightspeed C internals
- X * deduced via TMON - namely: document windows have a windowKind of 0xB, and the project
- X * window has one of 0xA.
- X */
- X for (wp = WindowList; wp != NULL; wp = wp->nextWindow) {
- X if (wp->windowKind == 0xA) { /* A project window */
- X /* wp->titleHandle is a StringHandle to the window title. This corresponds to the
- X * project name. So we search for the reserved key record (type QK_TEXT,
- X * key 1, modifiers (Cmd,Option,Shift). When found, we copy in the required
- X * title.
- X */
- X if (UpdateParamKey(qb, wp->titleHandle, 1) == FALSE) SysBeep(1);
- X return;
- X }
- X }
- X}
- X
- X
- X/*
- X * This is a C version of the example code in Chapter 8 of the QuicKeys manual.
- X */
- X
- XQuicInitBlock *
- XFindSysHeap()
- X{
- X register Ptr endBlk = SysZone->bkLim;
- X register QuicInitBlock *qp;
- X
- X qp = (QuicInitBlock *) &SysZone->heapData;
- X
- X while(qp != (QuicInitBlock *) endBlk) {
- X /* Analyze the block we're looking at. */
- X if ((qp->header[0] & 0xC0) == 0x40) { /* Is it non-relocatable? */
- X /* Check magic and signature. */
- X if (qp->quic.magic == 0xa89f1234 && qp->quic.signature == 'CELN') {
- X /* Chapter 8 states that the version number is 1. It's actually 0 (as the example
- X * assembly language shows and a quick call to CE Software confirmed).
- X */
- X if (qp->quic.version == 0) return qp;
- X }
- X }
- X
- X /* Time to move on to the next block. The 0xFFFFFF strips off the tag byte(s). */
- X qp = (QuicInitBlock *)(((Byte *)qp) + ((* (long *)&qp->header) & 0xFFFFFF));
- X }
- X return NULL; /* Failed to find it */
- X}
- X
- X/*
- X * Cmd-Shift-Option 1 through 4 are reserved as parameter records of type 'text' (prog-specific).
- X * This routine searches for the given record and copies in the text.
- X */
- X
- XBoolean
- XUpdateParamKey(qb, theText, param)
- XQuicInitBlock *qb;
- XStringHandle theText;
- Xint param;
- X{
- X register KeyRecord *kr = qb->quic.application;
- X register KeyRecord *end = kr + N_QCKEYS;
- X register unsigned key;
- X
- X /* This depends on the fact that keys 1 through 4 have consecutive keycode values. The charcode values
- X * were found by experimentation.
- X */
- X key = ((0x11 + param) << 8) + 0xD9 + param; /* Convert to keycode & charcode */
- X
- X for (; kr < end; kr++) {
- X if (kr->QKtype == QK_TEXT) {
- X if ((kr->key) == key && (kr->modifiers == (cmdKey|optionKey|shiftKey))) {
- X BlockMove(*theText, kr->u.QuicText.text, (Size)((*theText)[0] + 1));
- X return TRUE;
- X }
- X }
- X }
- X return FALSE;
- X}
- ________This_Is_The_END________
- if test `wc -l < ProjectSwitch.c` -ne 117; then
- echo 'shar: ProjectSwitch.c was damaged during transit'
- echo ' (should have been 117 bytes)'
- fi
- fi ; : end of overwriting check
- echo 'Extracting SetQuicText.c'
- if test -f SetQuicText.c; then echo 'shar: will not overwrite SetQuicText.c'; else
- sed 's/^X//' << '________This_Is_The_END________' > SetQuicText.c
- X/*
- X * SetQuicText: Hypercard XCMD to set up a text QuicKey with a text string of up to 72 characters.
- X * Usage: SetQuicText modifiers, virtual key, text
- X * Modifiers can be one or more of "C" (Command), "L" (CapsLock), "O" (Option),
- X * "c" (Control), and "S" (Shift).
- X * The virtual key is a hardware-independent method of identifying a key. There's a
- X * table of key/char equivalences in Inside Macintosh Volume V, and also in the stack
- X * distributed with the PostEvent XCMD.
- X * Note that the text key has to be defined before this XCMD is run - i.e. the slot has
- X * to be reserved, and is assumed to be universal rather than program-specific (the
- X * XCMD looks at both, but checks universal first).
- X * Dewi Williams. Delphi: Dewi.
- X */
- X
- X#include <MemoryMgr.h>
- X#include <EventMgr.h>
- X#include <HyperXCmd.h> /* Defines and structures for HyperCard XCMD programming */
- X#include <Environs.h> /* Defines for the SysEnvirons trap */
- X#include <ScriptMgr.h> /* Came with the 2.11 upgrade as "xScriptMgr.h" */
- X#include "QuicKeys.h" /* Defines and structures for QuicKeys internals access */
- X
- X#define NULL 0L
- X#define HiWord(x) (((unsigned short *)&(x))[0])
- X#define LoWord(x) (((unsigned short *)&(x))[1])
- X#define controlKey 4096
- X
- X/* Forward references */
- XQuicInitBlock *FindSysHeap();
- Xint CalcModifiers(StringPtr str);
- Xint CalculateCharCode(int modifiers, int theKey);
- XBoolean UpdateKeySlot(QuicInitBlock *qb, int kcode, int modifiers, StringPtr text);
- X
- Xpascal void
- Xmain(paramPtr)
- XXCmdBlockPtr paramPtr;
- X{
- X Str255 text;
- X QuicInitBlock *qb;
- X int theKey;
- X int modifiers;
- X SysEnvRec env;
- X int kcode;
- X
- X /* Ensure that this is system 4.1 or later. This is needed for KeyTrans and extended keyboard
- X * checks. It ensures that KCHR/KMAP keyboard mappings are in place.
- X */
- X if (SysEnvirons(1, &env) == envNotPresent) {
- X /* We beep rather than put up an error message because I don't like hardwiring English
- X * strings into programs, and haven't figured out an owned resource type of technique for
- X * putting the error messages into resources. Apple needs to set a standard here (minor editorial!).
- X */
- X SysBeep(1);
- X return;
- X }
- X
- X /* There should be 3 parameters. */
- X if (paramPtr->paramCount != 3) {
- X SysBeep(1);
- X return;
- X }
- X
- X /* Find QuicKeys in the system heap. */
- X if ( (qb = FindSysHeap()) == NULL) {
- X /* Not running QuicKeys */
- X SysBeep(1);
- X return;
- X }
- X
- X /* First param is the modifiers. Convert it to a pascal string */
- X ZeroToPas(paramPtr,*(paramPtr->params[0]), text);
- X
- X modifiers = CalcModifiers(text);
- X
- X /* If the control key is specified, see if this is possible with the current keyboard. */
- X if (modifiers&controlKey) {
- X /* Make no assumptions about new keyboard models! */
- X if (env.keyBoardType <= envStandADBKbd && env.keyBoardType != envAExtendKbd) {
- X SysBeep(1);
- X return;
- X }
- X }
- X
- X /* The second param is the virtual keycode. */
- X ZeroToPas(paramPtr,*(paramPtr->params[1]), text);
- X theKey = ((int)StrToNum(paramPtr, (Str31 *)text)) & 0x7F;
- X
- X /* Sanity check: virtual keycodes past 0x60 belong to the extended keyboard (function keys, PageUp
- X * etc. To stop any possible confusion, we check for the existence of the extended keyboard before
- X * posting any such event.
- X */
- X if (theKey > 0x60 && env.keyBoardType != envAExtendKbd) {
- X SysBeep(1);
- X return;
- X }
- X
- X /* Third parameter is the text to substitute. */
- X ZeroToPas(paramPtr,*(paramPtr->params[2]), text);
- X
- X /* Clamp the string if it's too big. */
- X if (text[0] > 71) text[0] = 71; /* with room for the length byte */
- X
- X if ( (kcode = CalculateCharCode(modifiers, theKey)) == 0) {
- X /* Bad virtual keycode? */
- X SysBeep(1);
- X return;
- X }
- X
- X if (UpdateKeySlot(qb, kcode, modifiers, text) == FALSE) {
- X /* Slot wasn't reserved in universal key area. */
- X SysBeep(1);
- X }
- X}
- X
- X/*
- X * This is a C version of the example code in Chapter 8 of the QuicKeys manual.
- X */
- X
- XQuicInitBlock *
- XFindSysHeap()
- X{
- X register Ptr endBlk = SysZone->bkLim;
- X register QuicInitBlock *qp;
- X
- X qp = (QuicInitBlock *) &SysZone->heapData;
- X
- X while(qp != (QuicInitBlock *) endBlk) {
- X /* Analyze the block we're looking at. */
- X if ((qp->header[0] & 0xC0) == 0x40) { /* Is it non-relocatable? */
- X /* Check magic and signature. */
- X if (qp->quic.magic == 0xa89f1234 && qp->quic.signature == 'CELN') {
- X /* Chapter 8 states that the version number is 1. It's actually 0 (as the example
- X * assembly language shows and a quick call to CE Software confirmed).
- X */
- X if (qp->quic.version == 0) return qp;
- X }
- X }
- X
- X /* Time to move on to the next block. The 0xFFFFFF strips off the tag byte(s). */
- X qp = (QuicInitBlock *)(((Byte *)qp) + ((* (long *)&qp->header) & 0xFFFFFF));
- X }
- X return NULL; /* Failed to find it */
- X}
- X
- X/*
- X * CalculateCharCode: given a virtual keycode value, calculate the keycode/charcode combination.
- X */
- X
- Xint
- XCalculateCharCode(modifiers, theKey)
- Xint modifiers;
- Xint theKey;
- X{
- X long kResult;
- X long state = 0;
- X Handle hKeyData;
- X register int kchrID;
- X int theCode;
- X
- X /* Calculate the resource ID of the relevant KCHR resource. The Script Manager has
- X * this information. This may be useful if you're using Dvorak mappings, for instance.
- X * I haven't really been able to test this - 0 is the US default, and it's the only one I
- X * have.
- X */
- X kchrID = (int)GetScript(GetEnvirons(smKeyScript), smScriptKeys);
- X
- X if ( (hKeyData = GetResource('KCHR', kchrID)) == NULL) {
- X /* We've confirmed that it is System 4.1 or later. Strange. */
- X SysBeep(1);
- X return;
- X }
- X
- X /* The keyCode parameter passed to the KeyTrans trap consists of the modifier
- X * flags in bits 8-15, up/down stroke in bit 7 (1 = up), and the virtual key
- X * code in bits 6 - 0.
- X */
- X modifiers |= btnState; /* The mouse button is UP */
- X theKey |= modifiers; /* Already in bits 8-15 */
- X
- X /* I'm assuming here that KeyTrans doesn't move the heap. Don't see why it should. */
- X if ( (kResult = KeyTrans(*hKeyData, theKey, &state)) == 0) return 0;
- X
- X /* kResult consists of 2 16 bit characters to be posted as events (usually the high word of each is 0),
- X * high word first. A return value of 0 in either word should not be posted.
- X */
- X if ((theCode = HiWord(kResult)) != 0) {
- X if (LoWord(kResult) != 0) {
- X /* This combination's inappropriate - it has to be a single keycode/charcode combination. */
- X return 0;
- X }
- X } else {
- X theCode = LoWord(kResult);
- X }
- X
- X theKey &= 0x7F; /* Cut out any modifiers */
- X theKey <<= 8; /* And shift to the keyCode position */
- X theCode |= theKey;
- X
- X return theCode;
- X}
- X
- X/* Convert the modifier string to its numeric equivalent. This code isn't perfect - it does
- X * blind matches without validating for odd characters. For instance "LXO" == "LO".
- X */
- X
- Xstatic int
- XCalcModifiers(str)
- Xregister StringPtr str;
- X{
- X register StringPtr end = str + str[0] + 1;
- X register int modifiers = 0;
- X
- X for (str++;str < end; str++) {
- X switch( (*str) ) {
- X case 'C':
- X modifiers |= cmdKey;
- X break;
- X case 'S':
- X modifiers |= shiftKey;
- X break;
- X case 'L':
- X modifiers |= alphaLock;
- X break;
- X case 'O':
- X modifiers |= optionKey;
- X break;
- X case 'c':
- X modifiers |= controlKey;
- X break;
- X }
- X }
- X return modifiers;
- X}
- X
- X/*
- X * Write "theText" into the QuicKeys text key slot identified by "kcode". Look in universal first, then
- X * in program-specific.
- X */
- X
- XBoolean
- XUpdateKeySlot(qb, kcode, modifiers, theText)
- XQuicInitBlock *qb;
- Xint kcode;
- Xint modifiers;
- XStringPtr theText;
- X{
- X register KeyRecord *kr = qb->quic.universal;
- X register KeyRecord *end = kr + N_QCKEYS;
- X
- X for (; kr < end; kr++) {
- X if (kr->QKtype == QK_TEXT) {
- X if ((kr->key) == kcode && (kr->modifiers == modifiers)) {
- X BlockMove(theText, kr->u.QuicText.text, (Size)(theText[0] + 1));
- X return TRUE;
- X }
- X }
- X }
- X
- X /* Can't find it in universal, so let's look in program-specific for Hypercard. */
- X kr = qb->quic.application;
- X end = kr + N_QCKEYS;
- X
- X for (; kr < end; kr++) {
- X if (kr->QKtype == QK_TEXT) {
- X if ((kr->key) == kcode && (kr->modifiers == modifiers)) {
- X BlockMove(theText, kr->u.QuicText.text, (Size)(theText[0] + 1));
- X return TRUE;
- X }
- X }
- X }
- X return FALSE;
- X}
- ________This_Is_The_END________
- if test `wc -l < SetQuicText.c` -ne 271; then
- echo 'shar: SetQuicText.c was damaged during transit'
- echo ' (should have been 271 bytes)'
- fi
- fi ; : end of overwriting check
- echo 'Extracting quickeys.h'
- if test -f quickeys.h; then echo 'shar: will not overwrite quickeys.h'; else
- sed 's/^X//' << '________This_Is_The_END________' > quickeys.h
- X/*
- X * QuicKeys.h : Types and defines for interacting with QuicKeys internals. This information is based
- X * on Chapter 8 of the QuicKeys manual. Typed in by Dewi Williams. Delphi: DEWI, who is
- X * responsible for any typos here!
- X *
- X * The QuicKeys keyboard enhancer is a product of CE Software, 801 73rd Street,
- X * Des Moines, Iowa 50312. (515) 224-1995.
- X */
- X
- X
- X/* Defines */
- X
- X/* QuicKey command types (for the QKtype field of the key record). */
- X#define QK_UNUSED 0 /* Empty key record */
- X#define QK_FILE 1
- X#define QK_TEXT 2
- X#define QK_MENU 3
- X#define QK_DA 4
- X#define QK_OTHER 5
- X#define QK_ALIAS 6
- X#define QK_CLICK 7
- X#define QK_SEQUENCE 8
- X#define QK_BUTTON 9
- X
- X/* QuicKey "Other" command types. */
- X#define QKO_LINEUP 0
- X#define QKO_LINEDN 1
- X#define QKO_PAGEUP 2
- X#define QKO_PAGEDN 3
- X#define QKO_HOME 4
- X#define QKO_END 5
- X#define QKO_COLLEFT 6
- X#define QKO_COLRIGHT 7
- X#define QKO_PGLEFT 8
- X#define QKO_PGRIGHT 9
- X#define QKO_CLWIND 10
- X#define QKO_ZMWIND 11
- X#define QKO_TRANSFER 12
- X#define QKO_SHUTDN 13
- X#define QKO_RESTART 14
- X#define QKO_SELRWIND 16
- X#define QKO_SEL2WIND 17
- X#define QKO_QUOTES 18
- X#define QKO_DQUOTES 19
- X#define QKO_QUICREF 20
- X#define QKO_TOGGLE 21
- X#define QKO_READ 22
- X#define QKO_DATE1 23
- X#define QKO_DATE2 24
- X#define QKO_DATE3 25
- X#define QKO_DATE4 26
- X#define QKO_DATE5 27
- X#define QKO_DATE6 28
- X#define QKO_DATE7 29
- X#define QKO_DATE8 30
- X#define QKO_TIME1 32
- X#define QKO_TIME2 34
- X#define QKO_FKBASE 101 /* Base for FKEYs. Add ID value on to this. */
- X
- X#define N_QCKEYS 100 /* Number of entries in the key record arrays. */
- X
- X/* Types */
- X
- X/*
- X * Format of the key record within QuicKeys' system heap block.
- X */
- X
- Xtypedef struct {
- X unsigned short key; /* Keycode and ascii value as returned by GetNextEvent */
- X unsigned short modifiers; /* Modifiers as returned by GetNextEvent, masked */
- X short QKtype; /* Variant */
- X union {
- X struct { /* QuicKeys File */
- X char filename[32];
- X char volname[32];
- X long dirID;
- X ResType fileType;
- X } QKFile;
- X
- X struct { /* QuicKeys text to type */
- X char text[72];
- X } QuicText;
- X
- X struct { /* QuicKeys menu */
- X char menu[72];
- X } QuicMenu;
- X
- X struct { /* QuicKeys DA */
- X char da[72];
- X } QuicDA;
- X
- X struct { /* QuicKeys Other (e.g. mousies, special, datestamps) */
- X short cmd; /* See the defines above starting with "QKO_" */
- X } QuicOther;
- X
- X struct { /* QuicKeys Alias */
- X unsigned short key; /* Replacement keycode and ascii value */
- X unsigned short modifiers; /* Replacement modifiers */
- X } QuicAlias;
- X
- X struct { /* QuicKeys Click */
- X char title[28]; /* Title of the click */
- X char wtitle[28]; /* Title of the window to look for */
- X short nclicks; /* Number of clicks */
- X short specific; /* Look for specific window. Really boolean + pad. */
- X short mUpFormat; /* Mouse up format: Absolute/relative/window etc. */
- X Point mouseUp;
- X short mDownFormat; /* Mouse down format: Absolute/relative/window etc. */
- X Point mouseDown;
- X } QuicClick;
- X
- X struct { /* QuicKeys Sequence */
- X char title[12]; /* QuicKeys sequence title */
- X short step[30]; /* Individual steps of sequence as a keycode/modifiers */
- X } QuicSequence;
- X
- X struct {
- X char name[72]; /* Name of the button */
- X } QuicButton;
- X } u;
- X} KeyRecord;
- X
- Xtypedef struct { /* QuicKeys INIT system heap block */
- X long magic; /* Hex value of a89f1234 */
- X long signature; /* CE Software's signature of 'CELN' */
- X long version; /* Version number of 0. */
- X ProcPtr SetLaunch; /* Vector */
- X long unknown1; /* Undocumented */
- X ProcPtr FindAnApp; /* Vector */
- X Byte unknown2[16]; /* Undocumented */
- X ProcPtr PlotAnItem; /* Vector */
- X long unknown3; /* Undocumented */
- X KeyRecord universal[N_QCKEYS]; /* Universal keys */
- X KeyRecord application[N_QCKEYS]; /* Program-specific keys */
- X} QuicInit;
- X
- X/*
- X * And the block together with its memory manager header.
- X */
- X
- Xtypedef struct { /* QuicInit and its block header */
- X Byte header[8]; /* Memory manager block header */
- X QuicInit quic;
- X} QuicInitBlock;
- X
- X/* Prototypes */
- XQuicInitBlock *FindSysHeap(void);
- ________This_Is_The_END________
- if test `wc -l < quickeys.h` -ne 147; then
- echo 'shar: quickeys.h was damaged during transit'
- echo ' (should have been 147 bytes)'
- fi
- fi ; : end of overwriting check
- exit 0
-