Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

Using Access Keys

This section illustrates how to use access keys.

In this section:

Registering an Access Key
Getting Access Keys
Unregistering an Access Key


Registering an Access Key

Listing 6-1 illustrates how to register an application access key.

Listing 6-1  Registering an application access key

OSErr myErr = 0;
Str255 keyType = doomCDKeyType;
long flags = AccessKeySystemFlag;
handle keyHdl;
keyHdl = NewHandle (sizeof("keykeykey")-1);
/* put key in handle */
myErr = QTRegisterAccessKey (keyType, flags, keyHdl);

Listing 6-2 illustrates how to register a system access key.

Listing 6-2  Registering a system access key

OSErr myErr = 0;
Str255 keyType = doomCDKeyType;
long flags = 0;
handle keyHdl;
keyHdl = NewHandle (sizeof("keykeykey")-1);
/* put key in handle */
myErr = QTRegisterAccessKey (keyType, flags, keyHdl);

Getting Access Keys

Listing 6-3 illustrates how to get application access keys of a particular type.

Listing 6-3  Getting access keys

OSErr myErr = 0;
Str255 keyType = doomCDKeyType;
long flags = 0;
handle keyHdl;
/* handle initialization here */
myErr = QTGetAccessKeys (keyType, flags, keyHdl);

Unregistering an Access Key

Listing 6-4 illustrates how to unregister a system access key.

Listing 6-4  Unregistering an access key

OSErr myErr = 0;
Str255 keyType = doomCDKeyType;
long flags = AccessKeySystemFlag;
handle keyHdl;
keyHdl = NewHandle (sizeof("keykeykey")-1);
/* put key in handle */
myErr = QTUnRegisterAccessKey (keyType, flags, keyHdl);


< Previous PageNext Page > Hide TOC


Last updated: 2006-01-10




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice