Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

BlackBerry Development Advisor
Posts: 15,697
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Inject KeyCodeEvent

I was testing this with the phone application already in the foreground.  Part of the issue is the fact that the events are being injected before the phone application has focus.  To work around that you can add a delay (Thread.sleep) in the thread that is running this code.


You'll also need to use EventInjector.invokeEvent method instead of calling post.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
New Developer
Posts: 35
Registered: ‎09-11-2008
My Device: Not Specified

Re: Inject KeyCodeEvent

Thanks Mark. That did the trick. It was the timing issue. The Thread.sleep command fixed everything.