黑莓6:如何检测轨迹板长时间点击? [英] Blackberry 6: how to detect a long click on track pad?

查看:101
本文介绍了黑莓6:如何检测轨迹板长时间点击?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你怎么检测长点击跟踪板吗?即在这个啄:

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

我可以检测到的的点击有:

I can detect a short click with:

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

和我也可以在触摸屏上检测到长按的有:

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

推荐答案

我将与 trackwheelClick(INT的地位,诠释时间)播放 trackwheelUnclick (INT状态,诠释时间)确定点击的长度。你必须在这里和那里设置标志(可能在 navigationClick()以及)不pmaturely火正常的单击事件$ P $。除此之外,我不知道LONG_CLICK标志或任何东西。

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.

这篇关于黑莓6:如何检测轨迹板长时间点击?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆