Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GetKeys() and KeyMap?



On Tue, 27 Jul 2004 19:36:09 -0500, Chilton Webb <email@hidden> wrote:
> Yo Spikeio,
> On Jul 27, 2004, at 6:26 PM, email@hidden wrote:
>> Bit Shifting should do the trick right?
> Absolutely.
> -Chilton

// inKeyCode = any keyboard scan code, 0-127
Boolean isPressed(unsigned short inKeyCode)
{
unsigned char keyMap[16];

GetKeys((UInt32*) &keyMap);
return (0 != ((keyMap[ inKeyCode >> 3] >> ( inKeyCode & 7)) & 1));
}

The virtual key codes are in Figure 2-10 of the Macintosh Toolbox Essentials
on page 2-43.

Also here: <http://developer.apple.com/documentation/mac/Text/Text-571.html>
--
Enjoy,
George Warner,
Schizophrenic Optimization Scientist
Apple Developer Technical Support (DTS)
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.