黑莓6:如何检测长点击轨迹板? [英] Blackberry 6: how to detect a long click on track pad?
问题描述
如何检测到点击轨迹板上的长时间?也就是说
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);
}
还可以检测到长按一下与:
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);
}
但我只是无法找到如何检测长途pad(我想在这种情况下显示一个弹出式菜单)...
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)...
谢谢!
Alex
Thank you! Alex
推荐答案
我将使用 trackwheelClick(int status,int time) code>和
trackwheelUnclick(int status,int time)
来确定点击长度。你必须在这里和那里设置标志(也许在 navigationClick()
)以不过早地触发正常点击事件。除此之外,我不知道有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屋!