1

I would like to be able to do a "push-to-activate" style interaction with the trackball. That is, I would like an event notification at the beginning and end of the push. At the moment, using the code below, I can only get an event when the trackball/pad is let go.

/**
 * listen for clicks
 */
public boolean navigationClick(int status, int time)
{
    System.out.println("click (" + status + "," + time + ")");

    return super.navigationClick(status, time);
}

 

/**
 * listen for movement
 */
public boolean navigationMovement(int dx, int dy, int status, int time)
{
    System.out.println("move (" + dx + "," + dy + "," + status + "," + time + ")");

    return super.navigationMovement(dx, dy, status, time);
}

Is there an event that fires when I first press a button?

Matt
  • 9,068
  • 12
  • 64
  • 84
  • Could you share more what are you going to do with this event? Also what is your os target version? – Eugen Martynov Aug 07 '12 at 16:23
  • I'm aiming at 4.6 right now. I just want to do a push-to-talk interaction, to record audio. – Matt Aug 07 '12 at 16:27
  • 1
    You can use `navigationClick` and `navigationUnclick`. Check API, http://www.blackberry.com/developers/docs/4.6.0api/net/rim/device/api/ui/Field.html – Rupak Aug 07 '12 at 18:17
  • Do you have an example of `navigationClick` firing when the button is pressed *down*? – Matt Aug 08 '12 at 09:19

1 Answers1

0

The solution to this was that it was only ever a problem in the simulator.

It's now working on a physical device and the navigationClick(..) and navigationUnclick(..) methods do exactly what they claim. They're basically button down and button up events for the trackball/pad.

Matt
  • 9,068
  • 12
  • 64
  • 84