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
nikita18
Posts: 144
Registered: ‎08-18-2012
My Device: Blackberry Curve 8520
Accepted Solution

Scroll vertically down 10 times programmatically..

I have a requirement to vertically scroll down 10 times programmatically from my app. Can anybody help me doing this. Thanks.

Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Scroll vertically down 10 times programmatically..

input simulation / event injection?
if setVerticalScroll does not do what you want, at least.
----------------------------------------------------------
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
Developer
nikita18
Posts: 144
Registered: ‎08-18-2012
My Device: Blackberry Curve 8520

yes i want to inject key press for scrolling 10 times in...

[ Edited ]

yes i want to inject key press for scrolling 10 times in blackberry. Can we do this? Please show me how. Thanks.

Developer
peter_strange
Posts: 19,609
Registered: ‎07-14-2008
My Device: Not Specified

Re: yes i want to inject key press for scrolling 10 times in...

This seems a bit vague, 10 times what?  10 screens?  10 swipes of the trackpad?

 

If this is your applicatino how about setVerticalScroll?

Developer
nikita18
Posts: 144
Registered: ‎08-18-2012
My Device: Blackberry Curve 8520

Re: Scroll vertically down 10 times programmatically..

[ Edited ]

I want 10 swipes of the trackpad and this is not my application. I have this requirement. I got to know that we can enject Key presses programmatically. How can we do this for 10 swipes of the trackpad? Thanks a lot.

Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Scroll vertically down 10 times programmatically..

http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/system/EventInjector.Navigatio...
----------------------------------------------------------
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
Developer
maadani
Posts: 729
Registered: ‎05-04-2011
My Device: 9700

Re: Scroll vertically down 10 times programmatically..

You can try and add a NullField and set focus to it.

 

E.

Developer
nikita18
Posts: 144
Registered: ‎08-18-2012
My Device: Blackberry Curve 8520

Re: Scroll vertically down 10 times programmatically..

[ Edited ]


Ok thanks a lot for your reply simon, will try and then tell you. 

Developer
nikita18
Posts: 144
Registered: ‎08-18-2012
My Device: Blackberry Curve 8520

Re: Scroll vertically down 10 times programmatically..

I got it with the code below:

 

for(int i=0;i<10;i++)
    		 EventInjector.invokeEvent(new EventInjector.TrackwheelEvent(EventInjector.TrackwheelEvent.THUMB_ROLL_DOWN,1,KeypadListener.STATUS_ALT));

 

 

Thanks a lot everyone.