문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top