如何使用触觉设备?
我陷入了这个问题:如果设备是触觉设备(例如带有 Sun JavaME WirelessToolkit SDK 3.0 的 DefaultFxTouchPhone1 ),我想在用户用笔设备单击表行(或单元格)时执行一项操作。我尝试使用 addFocusListener
方法,但它有错误,因为即使显示表格的表单不再显示,FocusGain
方法仍然被调用!
那么如何仅在实际窗体显示时捕获笔单击事件呢?
确实非常感谢
I am stuck on this problem : I want to execute an action when the user clicks with the pen device on a Table row (or cell) if the device is a tactile one ( for example the DefaultFxTouchPhone1 with Sun JavaME WirelessToolkit SDK 3.0 ). I tried to use the addFocusListener
method but it has bugs because even though the Form which displays the Table is not shown anymore then the FocusGain
method is still called !
So how to capture the pen click event only when the actual Form is shown ?
Thank you very much indeed
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
LookAndFeel.setTactileTouchDuration(int)
可能就是您所需要的。LookAndFeel.setTactileTouchDuration(int)
is probably what you need.好的,我将
pointerListener
添加到了 Form 中,并实现了pointerPressed
方法,在该方法中测试了pointerPressed
的 x 和 y 坐标方法位于表格单元格的第一个absoluteX
和最后一个absoluteY
(加上高度)之间。它有效!Ok , I added the
pointerListener
to the Form , and I implemented thepointerPressed
method into which I test if the x and y coordinates of thepointerPressed
method is between the firstabsoluteX
and lastabsoluteY
( plus the height ) of the Table cell. And it works !