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
Contributor
Posts: 35
Registered: ‎11-21-2012
My Device: 9810
My Carrier: o2

Browser scroll using EventInjector

Hello,

 

I am trying to scroll the browser when it is open on the users touch screen phone using code 

 

EventInjector.TouchEvent[] moveEvents = new EventInjector.TouchEvent[1];
moveEvents[0] = new EventInjector.TouchEvent(TouchEvent.MOVE, xCo, yCo, -1, -1, -1);
EventInjector.TouchEvent.injectSwipeGesture(xCoOrig, yCoOrig, moveEvents);
          

 

This code works fine for scrolling if just in the menu or in other screens on the phone but if in the browser it doesn't scroll.

 

It doesn't seem like event injection has been blocked in browser application either because I can inject characters and I can make the cursor move very slowly using code..

 

EventInjector.invokeEvent(new EventInjector.NavigationEvent(EventInjector.NavigationEvent.NAVIGATION_MOVEMENT,0, 1,  (int)Device.DEFAULT_DEVICE_TIME));

 

Thanks for any suggestions to get browser scrolling.

 

Contributor
Posts: 35
Registered: ‎11-21-2012
My Device: 9810
My Carrier: o2

Re: Browser scroll using EventInjector

It seems I can get the browser to scroll using 

 

EventInjector.invokeEvent(new EventInjector.NavigationEvent(EventInjector.NavigationEvent.NAVIGATION_MOVEMENT,0, 100,  (int)Device.DEFAULT_DEVICE_TIME));
    

 but this code is only good for when the browser is open/active - I have done some searching on this issue and it seems there is no way to tell when the browser is active so currently I'm still in need of help!