Blackberry 6: how to detect a long click on track

2019-07-21 08:20发布

how do you detect a long click on a track pad please? I.e. on this thingy:

enter image description here

I can detect a short click with:

public boolean navigationClick(int status, int time) {
    // XXX
    return super.navigationClick(status, time); 
}

And also I can detect a long click on a touch screen with:

protected boolean touchEvent(TouchEvent event) {
    if (event.getEvent() == TouchEvent.GESTURE) {
        TouchGesture gesture = event.getGesture();
        if (gesture.getEvent() == TouchGesture.HOVER) {
            // XXX
            return true;
        }
    }
    return super.touchEvent(event);
}

But I just can't find how to detect the long click on a track pad (I'd like to show a popup menu in that case)...

Thank you! Alex

1条回答
倾城 Initia
2楼-- · 2019-07-21 08:47

I would play with trackwheelClick(int status, int time) and trackwheelUnclick(int status, int time) to determine click length. You'll have to set flags here and there (probably in navigationClick() as well) to not fire normal click events prematurely. Beyond that, I don't know of a LONG_CLICK flag or anything.

查看更多
登录 后发表回答