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: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: problem with EventInjector on 8300

Well in Application screen press Menu button and select Modules. It will list all the modules and select your application. Press menu and select Edit permissions. and rest as i mentioned in old post.

 

I cross checked with 8300 Simulator on JDE 4.6 and it worked for me and it didn't ask for any password.

 

Tnx.


Use Search. "Accept Solution" If the problem is resolved.
Developer
Posts: 745
Registered: ‎01-04-2009
My Device: 8300, 8800, 8700f, 9000

Re: problem with EventInjector on 8300

ok it is unblocked now, but the code does not work. i meant-code You presented should do 'escape' (in my application it should put application into background and show main screen). but still-there is not action:/ do You know what may be wrong?
Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: problem with EventInjector on 8300

Post sample code.

 

Tnq.


Use Search. "Accept Solution" If the problem is resolved.
Developer
Posts: 745
Registered: ‎01-04-2009
My Device: 8300, 8800, 8700f, 9000

Re: problem with EventInjector on 8300

ok, so You told that:

UiApplication.getUiApplication().invokeLater(new Runnable(){
            
             public void run(){
                 EventInjector.KeyEvent _inject = new EventInjector.KeyEvent(
                 EventInjector.KeyEvent.KEY_DOWN, Characters.ESCAPE, 0, 50);
                     _inject.post();
                     _inject.post();
                 ;
             }
            
         });

 

works for You. for me, there was permission problem. actually I went to the options You've mentioned, but i've only found there: connections, interactions and user data. connections and user data was allow, but the interactions was not, so i've changed it to the 'allow'. after that, no permission error shows, but still-no action when i click on 'escape'..

Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: problem with EventInjector on 8300

Dn't click on Escape.

The code which i posted will help you to Inject key after certian event occurs.

 

Tnq.


Use Search. "Accept Solution" If the problem is resolved.
Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: problem with EventInjector on 8300

try this code:

if (permissions.getPermission(ApplicationPermissions.PERMISSION_EVENT_INJECTOR) == ApplicationPermissions.VALUE_ALLOW) {
EventInjector.KeyCodeEvent pressEndKey = new EventInjector.KeyCodeEvent(EventInjector.KeyCodeEvent.KEY_DOWN,
(char) Keypad.KEY_END, KeypadListener.STATUS_NOT_FROM_KEYPAD, 100);
EventInjector.KeyCodeEvent releaseEndKey = new EventInjector.KeyCodeEvent(EventInjector.KeyCodeEvent.KEY_UP,
(char) Keypad.KEY_END, KeypadListener.STATUS_NOT_FROM_KEYPAD, 100);
EventInjector.invokeEvent(pressEndKey);
EventInjector.invokeEvent(releaseEndKey);
} else { //notifiy}
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Highlighted
Developer
Posts: 745
Registered: ‎01-04-2009
My Device: 8300, 8800, 8700f, 9000

Re: problem with EventInjector on 8300

anyway, this started working:

 

EventInjector.KeyCodeEvent _eDown = new EventInjector.KeyCodeEvent(
                     EventInjector.KeyCodeEvent.KEY_DOWN,
                     (char)keyCode,
                     0);
           
             //send
             _eDown.post();
             
             
             EventInjector.KeyCodeEvent _eUp = new EventInjector.KeyCodeEvent(
                     EventInjector.KeyCodeEvent.KEY_UP,
                     (char)keyCode,
                     0);
           
             //send
             _eUp.post();

 

but on 8800. still not sure if it's ok for 8300 - i hope i'll get back my 8300 today and try the code after unblocking things. i'll let You know if it works.