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: Is GetKeys still preferred?



on 2008-04-30 3:44 AM, Laurence Harris at email@hidden wrote:

> On Apr 29, 2008, at 7:07 PM, Stefan Werner wrote:
> 
>> I believe the preferred method is to not use any polling whatsoever
>> and listen for key up/down events instead. I am not aware of any
>> direct 'modern' replacement for GetKeys (or GetMouse).
> 
> It's not just useful for polling. There are times when I want to
> determine if and which keys are down that could not be addressed with
> events. GetKeys is the only option for these cases.

If you know which key you want to test, look at the CGEventSourceKeyState
function, described in the Quartz Event Services Reference document. Or
CGEventSourceFlagsState for modifier keys. These work in Tiger and Leopard.

--

Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
www.quecheesoftware.com

PreFab Software - www.prefabsoftware.com


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: Is GetKeys still preferred? (From: Laurence Harris <email@hidden>)



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.