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
Posts: 1,636
Registered: ‎07-14-2008
My Device: Z10
My Carrier: Fido

key injection help

I'm trying to inject some characters to the textfield and it doesnt appear to be working.

here is my code:

 

 

EventInjector.KeyEvent pressEndKey=new EventInjector.KeyEvent(EventInjector.KeyEvent.KEY_DOWN, 'a',KeypadListener.STATUS_NOT_FROM_KEYPAD,100); EventInjector.KeyEvent releaseEndKey=new EventInjector.KeyEvent(EventInjector.KeyEvent.KEY_UP,'a',

KeypadListener.STATUS_NOT_FROM_KEYPAD,100); EventInjector.invokeEvent(pressEndKey); EventInjector.invokeEvent(releaseEndKey);

 

the above suppose to inject the char 'a' into the textfield but nothing happens.

 

 

Developer
Posts: 445
Registered: ‎07-15-2008
My Device: Not Specified

Re: key injection help

Try this:

 

EventInjector.invokeEvent(new EventInjector.KeyEvent(EventInjector.KeyEvent.KEY_DOWN, Characters.LATIN_SMALL_LETTER_A , TrackwheelListener.STATUS_NOT_FROM_KEYPAD));

 

EventInjector.invokeEvent(new EventInjector.KeyEvent(EventInjector.KeyEvent.KEY_UP, Characters.LATIN_SMALL_LETTER_A , TrackwheelListener.STATUS_NOT_FROM_KEYPAD)); 

 

 

 

If your question was answered, please accept it as a sollution and / or give Kudos ;-)
______________________________
Use the Search Field first! Maybe the question you want to ask already exists!