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: 136
Registered: ‎02-12-2009
My Device: Not Specified
Accepted Solution

Trackball roll

[ Edited ]

Hi all,

 I want to capture trackball event like rollup, rolldown ... I tried with trackwheel but it works only for "click" and "Unclick" event...and not for rollup and rolldown...

I want to programmatically fire rolldown and rollup of trackball...

 

Plz help

 

Thanks in advance

 

 

Message Edited by smartfish on 04-18-2009 08:46 AM
_____________________________________________________________________

Thank the person who helped you by clicking Kudos! star near their post..
If you start a new thread, then resolve it using Accepted Solution button..
Leave solved threads for reviewing purposes - Start a new thread for new questions..
Developer
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: Trackball roll

[ Edited ]

Take a look at this API ..

 

http://www.blackberry.com/developers/docs/4.5.0api/net/rim/device/api/system/TrackwheelListener.html

 

trackWheelRoll

 

Cheers.. 

 

EDIT: Link changed.. 

Message Edited by mantaker on 04-18-2009 06:44 PM
--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Trackball roll

How about overriding navigationMovement() in the Screen class? This gives you the dx,dy for all trackball movement.

 

Developer
Posts: 136
Registered: ‎02-12-2009
My Device: Not Specified

Re: Trackball roll

Hi.. Thanks for the reply...

     I want to programatically rollup and rolldown the trackball..

I have seen the navigationMovement(...)  method ..but i don't understand how to use it...

I have used EventInjector to rolldown the trackball but it is not working.... (Also i am able to click and unclick the trackball using EventInjector..)

 

Thanks  in advance...

_____________________________________________________________________

Thank the person who helped you by clicking Kudos! star near their post..
If you start a new thread, then resolve it using Accepted Solution button..
Leave solved threads for reviewing purposes - Start a new thread for new questions..
Developer
Developer
Posts: 266
Registered: ‎04-01-2009
My Device: Not Specified

Re: Trackball roll

Try this:

 

EventInjector.invokeEvent(new EventInjector.TrackwheelEvent( EventInjector.TrackwheelEvent.THUMB_ROLL_UP, 1 /*number of rolls*/, TrackwheelListener.STATUS_NOT_FROM_KEYPAD));

 

 

 

Developer
Posts: 136
Registered: ‎02-12-2009
My Device: Not Specified

Re: Trackball roll

thanks for this quick reply....

  i'll try this  ........

 

 

thanks

_____________________________________________________________________

Thank the person who helped you by clicking Kudos! star near their post..
If you start a new thread, then resolve it using Accepted Solution button..
Leave solved threads for reviewing purposes - Start a new thread for new questions..
Developer
Posts: 170
Registered: ‎01-17-2009
My Device: 9630

Re: Trackball roll

public boolean navigationMovement(int dx, int dy, int status, int time)

 

dx is the number of rolls to the left or right (left is negative)

dy is the number of rolls to up or down (up is negative I believe)