Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: CGPostKeyboardEvent in OSX/Classic (was: Re: Determining which environment are other apps running in)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CGPostKeyboardEvent in OSX/Classic (was: Re: Determining which environment are other apps running in)



On Friday, June 29, 2001, at 05:40 PM, Stephen Malinowski wrote:
Let me follow up on Matt's question. I have an application (Keyspan Digital Media Remote) that sends keystrokes to other applications. It uses CGPostKeyboardEvent for this. The OS X and Classic environments respond differently when there's a delay between key-down and key-up actions. If I do this

CGPostKeyboardEvent(charCode, keyCode, keyDown=1);
// some time elapses
CGPostKeyboardEvent(charCode, keyCode, keyDown=0);

and an OS X application is in the foreground, it receives a single key down, followed up a key up later. A Classic application in the foreground receives a key down, some number of key repeats, and a key up.

Is this a bug? Ideally, I'd like both OSX and Classic apps to work the way OSX apps do, but if there's some architectural reason that doesn't make sense, then I'd like some way of figuring out whether to issue the key up immediately (so as to make the Classic apps work right).

You may have good reasons why you prefer the OS X way, but to me the classic way seems to make a lot of sense. If I physically hold down a key for a while I get key repeats until I release the key again. Why should this be different for CG remote key events? Is it perhaps also a difference depending on whether carbon events of WNE is used?

David


References: 
 >CGPostKeyboardEvent in OSX/Classic (was: Re: Determining which environment are other apps running in) (From: Stephen Malinowski <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.