CGPostKeyboardEvent() with dead keys;
CGPostKeyboardEvent() with dead keys;
- Subject: CGPostKeyboardEvent() with dead keys;
- From: Matt Budd (Madentec) <email@hidden>
- Date: Tue, 12 Oct 2004 16:27:08 -0600
Hello all,
I am trying to emulate key strokes with the CGPostKeyboardEvent() API.
I am trying to emulate the following key on the US keyboard: [รก]
(without braces). This is done by hitting Option+E and then the A key.
More precisely, this is done by sending keycodes 58 (for Option), 14
(for E), and then 0 (for A). I have tried the following code and it
does not work:
CGPostKeyboardEvent(0, 58, YES);
CGPostKeyboardEvent(0, 14, YES);
CGPostKeyboardEvent(0, 14, NO);
CGPostKeyboardEvent(0, 58, NO);
CGPostKeyboardEvent(0, 0, YES);
CGPostKeyboardEvent(0, 0, NO);
...all that is typed is the letter [a]. It seems that doing this
consumes the dead key that you get if you physically do this on your
keyboard.
If I try emulating the dead key twice:
CGPostKeyboardEvent(0, 58, YES);
CGPostKeyboardEvent(0, 14, YES);
CGPostKeyboardEvent(0, 14, NO);
CGPostKeyboardEvent(0, 58, NO);
CGPostKeyboardEvent(0, 58, YES);
CGPostKeyboardEvent(0, 14, YES);
CGPostKeyboardEvent(0, 14, NO);
CGPostKeyboardEvent(0, 58, NO);
CGPostKeyboardEvent(0, 0, YES);
CGPostKeyboardEvent(0, 0, NO);
...it does work.
Does anyone know why this is? I've also tried this repeat-dead-key
trick on dead keys that don't require modifiers (see the Bulgarian
keyboard and try typing [`] (back-tick) + [w]) and it doesn't work, so
I can't just do a double dead key hack...
- Matt
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden