Touch events (Mozilla experimental) - Developer guides 编辑

Warning: This experimental API was removed in Gecko 18.0 (Firefox 18.0 / Thunderbird 18.0 / SeaMonkey 2.15), when support for the standard touch events was implemented.

The experimental touch events API described on this page was available from Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) to Gecko/Firefox 17. You should instead use the standard touch events API, supported since Gecko/Firefox 6 with multi-touch support added in Gecko/Firefox 12.

This API allowed you to track the movement of the user's finger on a touch screen, monitoring the raw touch events generated by the system. Although touch events were based on — and work similarly to — mouse events, each event included an identifier that allowed you to track multiple fingers moving on the screen at the same time.

Event fields

Touch events were based upon MouseEvent, and thereby shared all mouse event fields. They included one additional field.

streamId
A unique integer identifying the finger generating the event. When the MozTouchDown event is built, a unique value is assigned to that finger. Corresponding MozTouchMove and MozTouchUp events for that finger will have the same streamId value. This lets you track each finger's movements on the touch screen independently. The stream ID is unique until the MozTouchUp event occurs; after that, the value may be recycled for another series of events.

Types of touch events

MozTouchDown
Sent when the user begins a screen touch action.
MozTouchMove
Sent when the user moves his finger on the touch screen.
MozTouchUp
Sent when the user lifts his finger off the screen.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:60 次

字数:2182

最后编辑:6年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文