Welcome!

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

Reply
Developer
sahil_khanna
Posts: 112
Registered: ‎07-19-2009
My Device: Not Specified
Accepted Solution

Using EventInjector

[ Edited ]

 

I'm using BlackBerry 8520. I'm developing an application to implement the functionality of EventInjector. In my application I spawn a thread which is supposed to type a phone number on the home screen. As soon as I start the aplication, I get back to the home screen and wait for the number to be typed. Following is the code I'm using but I'm unable to implement the desired functionality. 

Just to inform, I've used the code both on simulator and device

 

 

 

EventInjector.KeyCodeEvent keyPress = new EventInjector.KeyCodeEvent(EventInjector.KeyCodeEvent.KEY_DOWN, Characters.DIGIT_NINE, KeypadListener.STATUS_ALT, 3000);

EventInjector.KeyCodeEvent keyRelease = new EventInjector.KeyCodeEvent(EventInjector.KeyCodeEvent.KEY_UP, Characters.DIGIT_NINE, KeypadListener.STATUS_ALT, 3000);

keyPress.post();

keyRelease.post();

sleep(); //sleep for 5 seconds

 

keyPress = new EventInjector.KeyCodeEvent(EventInjector.KeyCodeEvent.KEY_DOWN, Characters.DIGIT_EIGHT, KeypadListener.STATUS_ALT, 3000);

keyRelease = new EventInjector.KeyCodeEvent(EventInjector.KeyCodeEvent.KEY_UP, Characters.DIGIT_EIGHT, KeypadListener.STATUS_ALT, 3000);

keyPress.post();

keyRelease.post();

 sleep(); //sleep for 5 seconds

 

keyPress = new EventInjector.KeyCodeEvent(EventInjector.KeyCodeEvent.KEY_DOWN, Characters.DIGIT_SEVEN, KeypadListener.STATUS_ALT, 3000);

keyRelease = new EventInjector.KeyCodeEvent(EventInjector.KeyCodeEvent.KEY_UP, Characters.DIGIT_SEVEN, KeypadListener.STATUS_ALT, 3000);

keyPress.post();

keyRelease.post();

 sleep(); //sleep for 5 seconds

 

 

Developer
sahil_khanna
Posts: 112
Registered: ‎07-19-2009
My Device: Not Specified

Re: Using EventInjector

Resolved...

NMF
New Contributor
NMF
Posts: 2
Registered: ‎05-05-2010
My Device: 9000

Re: Using EventInjector

So how did you solve it in the end?

Developer
sahil_khanna
Posts: 112
Registered: ‎07-19-2009
My Device: Not Specified

Re: Using EventInjector

Just changes the KeypadListener.STATUS_ALT to 0

 

keyPress = new EventInjector.KeyCodeEvent(EventInjector.KeyCodeEv​ent.KEY_DOWN, Characters.DIGIT_EIGHT, 0, 3000);