触摸应用程序的滑动行为
我正在为 ActionScript 编写一个管理器来检测 SWIPE 手势。是的,已经有 API 可以与本机(操作系统)手势配合使用,但我的计划是:
- 因此它甚至可以用于单点触摸屏(换句话说,通常的平台。单点触摸屏或只是常规的鼠标输入)。
- 拥有稍微低级的 API。基本上我正在处理常规的 MOUSE_DOWN@target、MOUSE_MOVE@stage и stage.MOUSE_UP@stage。
不是火箭科学。但为了使其顺利工作(就用户体验而言),您确实必须考虑细节。
那么有人心里有一些小细节、提示和技巧吗?其他移动平台(iOS/Android/...)有什么经验吗?低级术语中的 SWIPE 手势是什么?
我的担忧:
- 这个事件(如 TransformGestureEvent)应该在 MOUSE_UP@stage 上触发还是在手指/鼠标释放之前触发? (如果有人有 antroid 设备,你能检查一下 TourDeFlex 应用程序是如何发生的吗?)
- 主要问题:如何过滤掉?我倾向于公式“(沿我们的轴传递的距离大于 N && 沿正交轴传递的距离不大于 M)在最后 T 毫秒内”。
怀疑,是否有一定的时间窗口(从手指/鼠标向下开始)做手势..以便在该时间窗口(计时器)关闭后一切都会中止。
期待您的笔记和评论,谢谢。
UPD:一些不错的想法: http://smartandroidians.blogspot.com/2010 /04/swipe-action-and-viewflipper-in-android.html 使用某种速度
I'm writing a manager for ActionScript to detect SWIPE gesture. Yes, there is API to work with native (OS) gesture already, but my plan is:
- so it would work even for singletouch screens (usual platforms in other words. singletouch screen or just a regular mouse input).
- to have slightly more low-level API. Basically I'm processing regular MOUSE_DOWN@target, MOUSE_MOVE@stage и stage.MOUSE_UP@stage.
Not a rocket-science. But in order to make it working smooth (in terms of UX) you really have to think of details.
So is anyone has some small details, tips&tricks in mind? Any experience from other mobile platforms (iOS/Android/...)? What is the SWIPE gesture in low-level terms?
My concerns:
- Should this event (like TransformGestureEvent) be fired on MOUSE_UP@stage or before finger/mouse release? (if anyone has antroid-device, could you check TourDeFlex app how it happens there?)
- Main question: how to filter out? I tend to formula "(distance passed along our axis greater then N && distance passed along orthogonal axis NOT greater then M) during last T ms".
Doubt, whether to have a certain time window (starting from finger/mouse down) to do the gesture.. so that everything would be aborted after this time window (timer) is closed.
Looking forward for your notes and comments, thank you.
UPD: Some nice found ideas:
http://smartandroidians.blogspot.com/2010/04/swipe-action-and-viewflipper-in-android.html using some sort of velocity
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我已经开始了自己的开源项目。在 Github 上查看 Gestouch:http://github.com/fljot/Gestouch
I have started my own open source project. Check out Gestouch on Github: http://github.com/fljot/Gestouch
您是否尝试过这个:
GestureWorks
它是一个 AS3 手势 API。
Have you tried this one:
GestureWorks
It is an AS3 gestures API.