Re: sending key presses to another app
Re: sending key presses to another app
- Subject: Re: sending key presses to another app
- From: "Jonathan 'Wolf' Rentzsch" <email@hidden>
- Date: Mon, 3 May 2004 00:26:13 -0500
justin webster, email@hidden, wrote:
>
How do I specify the application I'm sending to.
It sends to the front-most app.
>
How do I find the values for the particular keys I want to press?
Read up on your virtual keycodes:
<
http://developer.apple.com/documentation/mac/Text/Text-571.html>
By the way, CGPostKeyboardEvent() is somewhat buggy. For example, it will
fail in interesting ways if the user is holding down a modifier while
you're fake typing. Also, watch out for virtual keycodes that appear on
the numeric keypad. After posting one of those, it likes to keep the NUM
LOCK bit stuck on. Randomly. Add short delays while autotyping as
CGPostKeyboardEvent() likes to throw away incoming characters if they
come too fast. "Too fast" unfortunately isn't documented anywhere --
you'll need to empirically work that out yourself.
| Jonathan 'Wolf' Rentzsch
http://rentzsch.com
| Red Shed Software
http://redshed.net
| "better" necessarily means "different"
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.