AS3 多点触控事件行为
如果我设置 Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;
当用户点击时仍然会调度 MouseEvent.CLICK
吗?或者只会调度 TouchEvent.TOUCH_TAP
事件?
(在支持多点触控的设备上)
If I set Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;
will there still be dispatched a MouseEvent.CLICK
when the users tabs? or will there ONLY be dispatched a TouchEvent.TOUCH_TAP
event ?
(on a multitouch supported device)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
实际上,在这种情况下,鼠标事件是针对第一个接触点调度的。这就是不适合触摸输入的 UI 元素如何继续在触摸设备上工作的原因。
至少 MOUSE_DOWN 和 MOUSE_UP 是在 TOUCH_BEGIN 和 TOUCH_END 之后立即调度的,这有时非常烦人。
Actually, mouse events are dispatched in this case for the first point of contact. That's how UI elements not suited for touch input continue to work on touch devices.
At least MOUSE_DOWN and MOUSE_UP are dispatched right after TOUCH_BEGIN and TOUCH_END which is very annoying sometimes.
终于找到了这个问题的答案,抱歉 Stackoverflow,我并不是想发垃圾邮件!
MultitouchInputMode.TOUCH_POINT:如果您仅对触摸事件感兴趣,而不对鼠标或手势事件感兴趣,请使用此模式。如果您想支持运行时不支持的手势,或者需要同时支持多点触控和手势,您可以使用此模式来合成您自己的手势。 (http://www.adobe.com/devnet/flash/articles/multitouch_gestures。 html)
Finally found the answer to this, sorry Stackoverflow, wasn't trying to spam!
MultitouchInputMode.TOUCH_POINT: Use this mode if you are interested only in touch events and no mouse or gesture events. You can use this mode to synthesize your own gestures if you want to support gestures that are not supported by the runtime, or if you need to support both multitouch and gestures. (http://www.adobe.com/devnet/flash/articles/multitouch_gestures.html)
如果其他人发现本机触摸实现有缺陷,那么以下内容可能值得研究:
Gestouch:用于鼠标、触摸和多点触摸 AS3 开发的 NUI 手势检测框架。
Gestouch 是一个 ActionScript 库/框架,可帮助您处理单点触控和多点触控手势,以构建更好的 NUI(自然用户界面)。
https://github.com/fljot/Gestouch
In case anyone else finds the native touch implementation falls short there is also the following which may be worth looking into:
Gestouch: NUI gestures detection framework for mouse, touch and multitouch AS3 development.
Gestouch is a ActionScript library/framework that helps you to deal with single- and multitouch gestures for building better NUI (Natural User Interface).
https://github.com/fljot/Gestouch