Re: Send Key Event to Focused Window

2008-06-19 Thread Daniel
hi! I've dig a little bit in Quartz Events services and I got some poorly results. CGEventRef event = CGEventCreateKeyboardEvent(NULL, (CGKeyCode) 40, true); CGEventPost(kCGHIDEventTap, event); This for example works, in Xcode a k is inserted, but there are a lot of other key codes that do not

Re: Send Key Event to Focused Window

2008-06-19 Thread Bill Cheeseman
on 2008-06-19 3:46 AM, Daniel at [EMAIL PROTECTED] wrote: CGEventRef event = CGEventCreateKeyboardEvent(NULL, (CGKeyCode) 40, true); CGEventPost(kCGHIDEventTap, event); I wouldn't expect you to get even the k character with that code by itself. To type a character requires posting a key down

Send Key Event to Focused Window

2008-06-18 Thread Daniel
Hi to all, I'm developing a tool for assistive input and my question is how can I send a key event (like a keyboard press event) to the current window (whatever this one could be), for data input. I've tried the following, but only a beep is produced by my machine. snippet id keyTarget =

Re: Send Key Event to Focused Window

2008-06-18 Thread j o a r
On Jun 18, 2008, at 12:31 AM, Daniel wrote: I'm developing a tool for assistive input and my question is how can I send a key event (like a keyboard press event) to the current window (whatever this one could be), for data input. Have you looked at the Quartz Event Services?

Re: Send Key Event to Focused Window

2008-06-18 Thread Daniel
Thank you! I'll read through them. Basically, I've noticed that the code I'm using works (as it sends the right event), but it is sent to the wrong receiver. That means I'm sending it to my current application, instead I should be able to click on a button (representing a key stroke) and sending

Re: Send Key Event to Focused Window

2008-06-18 Thread j o a r
On Jun 18, 2008, at 4:25 AM, Daniel wrote: Basically, I've noticed that the code I'm using works (as it sends the right event), but it is sent to the wrong receiver. That means I'm sending it to my current application, instead I should be able to click on a button (representing a key stroke)

Re: Send Key Event to Focused Window

2008-06-18 Thread Bill Cheeseman
on 2008-06-18 7:25 AM, Daniel at [EMAIL PROTECTED] wrote: I should be able to click on a button (representing a key stroke) and sending the event (e.g. Safari) to the right application. As joar says, look at the Quartz Event Taps API and the Accessibility API. To try out examples of