From e42a37e905702475c474ff9a00f7478dd2026b10 Mon Sep 17 00:00:00 2001 From: skyclouds2001 <95597335+skyclouds2001@users.noreply.github.com> Date: Thu, 30 Nov 2023 21:07:11 +0800 Subject: [PATCH] add GroupData for Force Touch Events (#30657) * add GroupData * APIRef text fix * update GroupData for adding constansts * style pretty * fix apiref * update links * fix capacity * Apply suggestions from code review * fix * fix --- .../webkitmouseforcechanged_event/index.md | 6 +++--- .../element/webkitmouseforcedown_event/index.md | 5 ++--- .../element/webkitmouseforceup_event/index.md | 5 ++--- .../webkitmouseforcewillbegin_event/index.md | 7 +++---- files/en-us/web/api/force_touch_events/index.md | 6 ++++-- .../index.md | 3 +-- .../webkit_force_at_mouse_down_static/index.md | 3 +-- .../web/api/mouseevent/webkitforce/index.md | 3 +-- files/jsondata/GroupData.json | 17 +++++++++++++++++ 9 files changed, 34 insertions(+), 21 deletions(-) diff --git a/files/en-us/web/api/element/webkitmouseforcechanged_event/index.md b/files/en-us/web/api/element/webkitmouseforcechanged_event/index.md index 5f6abc0c78f1016..082a9e464942c3e 100644 --- a/files/en-us/web/api/element/webkitmouseforcechanged_event/index.md +++ b/files/en-us/web/api/element/webkitmouseforcechanged_event/index.md @@ -8,11 +8,11 @@ status: browser-compat: api.Element.webkitmouseforcechanged_event --- -{{APIRef}}{{Non-standard_header}} +{{APIRef("Force Touch Events")}}{{Non-standard_header}} The non-standard **`webkitmouseforcechanged`** event is fired by Safari each time the amount of pressure changes on the trackpad/touchscreen. -**`webkitmouseforcechanged`** is a proprietary, WebKit-specific event introduced by Apple to support their [Force Touch events](/en-US/docs/Web/API/Force_Touch_events) feature. +**`webkitmouseforcechanged`** is a proprietary, WebKit-specific event introduced by Apple to support their {{domxref("Force Touch Events")}} feature. This event first fires after the {{domxref("Element/mousedown_event", "mousedown")}} event and stops firing before the {{domxref("Element/mouseup_event", "mouseup")}} event. @@ -94,7 +94,7 @@ _Not part of any specification._ Apple has [a description at the Mac Developer L ## See also -- [Force Touch events](/en-US/docs/Web/API/Force_Touch_events) +- [Introduction to events](/en-US/docs/Learn/JavaScript/Building_blocks/Events) - {{domxref("Element/webkitmouseforcewillbegin_event", "webkitmouseforcewillbegin")}} - {{domxref("Element/webkitmouseforcedown_event", "webkitmouseforcedown")}} - {{domxref("Element/webkitmouseforceup_event", "webkitmouseforceup")}} diff --git a/files/en-us/web/api/element/webkitmouseforcedown_event/index.md b/files/en-us/web/api/element/webkitmouseforcedown_event/index.md index f14581b148e3928..24bb2c0f9d9d7e5 100644 --- a/files/en-us/web/api/element/webkitmouseforcedown_event/index.md +++ b/files/en-us/web/api/element/webkitmouseforcedown_event/index.md @@ -8,11 +8,11 @@ status: browser-compat: api.Element.webkitmouseforcedown_event --- -{{APIRef}}{{Non-standard_header}} +{{APIRef("Force Touch Events")}}{{Non-standard_header}} After a {{domxref("Element.mousedown_event", "mousedown")}} event has been fired at the element, if and when sufficient pressure has been applied to the mouse or trackpad button to qualify as a "force click," Safari begins sending **`webkitmouseforcedown`** events to the element. -**`webkitmouseforcedown`** is a proprietary, WebKit-specific event. It is part of the [Force Touch events](/en-US/docs/Web/API/Force_Touch_events) feature. +**`webkitmouseforcedown`** is a proprietary, WebKit-specific event. It is part of the {{domxref("Force Touch Events")}} feature. ## Syntax @@ -93,7 +93,6 @@ _Not part of any specification._ Apple has [a description at the Mac Developer L ## See also - [Introduction to events](/en-US/docs/Learn/JavaScript/Building_blocks/Events) -- [Force Touch events](/en-US/docs/Web/API/Force_Touch_events) - {{domxref("Element/webkitmouseforcewillbegin_event", "webkitmouseforcewillbegin")}} - {{domxref("Element/webkitmouseforceup_event", "webkitmouseforceup")}} - {{domxref("Element/webkitmouseforcechanged_event", "webkitmouseforcechanged")}} diff --git a/files/en-us/web/api/element/webkitmouseforceup_event/index.md b/files/en-us/web/api/element/webkitmouseforceup_event/index.md index 6d6cf15992dcb3b..4392a931029705b 100644 --- a/files/en-us/web/api/element/webkitmouseforceup_event/index.md +++ b/files/en-us/web/api/element/webkitmouseforceup_event/index.md @@ -8,11 +8,11 @@ status: browser-compat: api.Element.webkitmouseforceup_event --- -{{APIRef}}{{Non-standard_header}} +{{APIRef("Force Touch Events")}}{{Non-standard_header}} The non-standard **`webkitmouseforceup`** event is fired by Safari at an {{domxref("Element")}} some time after the {{domxref("Element/webkitmouseforcedown_event", "webkitmouseforcedown")}} event, when pressure on the button has been reduced sufficiently to end the "force click". -**`webkitmouseforceup`** is a proprietary, WebKit-specific event. It is part of the [Force Touch events](/en-US/docs/Web/API/Force_Touch_events) feature. +**`webkitmouseforceup`** is a proprietary, WebKit-specific event. It is part of the {{domxref("Force Touch Events")}} feature. ## Syntax @@ -93,7 +93,6 @@ _Not part of any specification._ Apple has [a description at the Mac Developer L ## See also - [Introduction to events](/en-US/docs/Learn/JavaScript/Building_blocks/Events) -- [Force Touch events](/en-US/docs/Web/API/Force_Touch_events) - {{domxref("Element/webkitmouseforcewillbegin_event", "webkitmouseforcewillbegin")}} - {{domxref("Element/webkitmouseforcedown_event", "webkitmouseforcedown")}} - {{domxref("Element/webkitmouseforcechanged_event", "webkitmouseforcechanged")}} diff --git a/files/en-us/web/api/element/webkitmouseforcewillbegin_event/index.md b/files/en-us/web/api/element/webkitmouseforcewillbegin_event/index.md index b949fad2965f650..c7f5d65e4ca79ac 100644 --- a/files/en-us/web/api/element/webkitmouseforcewillbegin_event/index.md +++ b/files/en-us/web/api/element/webkitmouseforcewillbegin_event/index.md @@ -8,15 +8,15 @@ status: browser-compat: api.Element.webkitmouseforcewillbegin_event --- -{{APIRef}}{{Non-standard_header}} +{{APIRef("Force Touch Events")}}{{Non-standard_header}} Safari for macOS fires the non-standard **`webkitmouseforcewillbegin`** event at an {{domxref("Element")}} before firing the initial {{domxref("Element/mousedown_event", "mousedown")}} event. -This offers the opportunity to tell the system not to trigger any default Force Touch actions if and when the click turns into a [Force Touch event](/en-US/docs/Web/API/Force_Touch_events). +This offers the opportunity to tell the system not to trigger any default Force Touch actions if and when the click turns into a {{domxref("Force Touch Events")}}. To instruct macOS not to engage any default Force Touch actions if the user apply enough pressure to activate a Force Touch event, call {{domxref("Event.preventDefault", "preventDefault()")}} on the `webkitmouseforcewillbegin` event object. -**`webkitmouseforcewillbegin`** is a proprietary, WebKit-specific event. It is part of the [Force Touch events](/en-US/docs/Web/API/Force_Touch_events) feature. +**`webkitmouseforcewillbegin`** is a proprietary, WebKit-specific event. It is part of the {{domxref("Force Touch Events")}} feature. ## Syntax @@ -97,7 +97,6 @@ _Not part of any specification._ Apple has [a description at the Mac Developer L ## See also - [Introduction to events](/en-US/docs/Learn/JavaScript/Building_blocks/Events) -- [Force Touch events](/en-US/docs/Web/API/Force_Touch_events) - {{domxref("Element/webkitmouseforcedown_event", "webkitmouseforcedown")}} - {{domxref("Element/webkitmouseforceup_event", "webkitmouseforceup")}} - {{domxref("Element/webkitmouseforcechanged_event", "webkitmouseforcechanged")}} diff --git a/files/en-us/web/api/force_touch_events/index.md b/files/en-us/web/api/force_touch_events/index.md index 9e581d5be794e57..f1ef4c6d6b2cd37 100644 --- a/files/en-us/web/api/force_touch_events/index.md +++ b/files/en-us/web/api/force_touch_events/index.md @@ -2,11 +2,13 @@ title: Force Touch events slug: Web/API/Force_Touch_events page-type: web-api-overview +status: + - non-standard --- -{{DefaultAPISidebar("Force Touch events")}}{{Non-standard_header}} +{{DefaultAPISidebar("Force Touch Events")}}{{Non-standard_header}} -**Force Touch events** are a proprietary, Apple-specific feature which makes possible (where supported by the input hardware) new interactions based on how hard the user clicks or presses down on the touchscreen or trackpad. +**Force Touch Events** are a proprietary, Apple-specific feature which makes possible (where supported by the input hardware) new interactions based on how hard the user clicks or presses down on the touchscreen or trackpad. ## Events diff --git a/files/en-us/web/api/mouseevent/webkit_force_at_force_mouse_down_static/index.md b/files/en-us/web/api/mouseevent/webkit_force_at_force_mouse_down_static/index.md index 81044377c9260c1..c76edb783b81df3 100644 --- a/files/en-us/web/api/mouseevent/webkit_force_at_force_mouse_down_static/index.md +++ b/files/en-us/web/api/mouseevent/webkit_force_at_force_mouse_down_static/index.md @@ -7,7 +7,7 @@ status: - non-standard --- -{{APIRef("UI Events")}}{{Non-standard_header}} +{{APIRef("Force Touch Events")}}{{Non-standard_header}} **`MouseEvent.WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN`** is a proprietary, WebKit-specific, static numeric property whose value is the minimum force necessary for a force click. @@ -21,4 +21,3 @@ _Not part of any specification._ Apple has [a description at the Mac Developer L - {{domxref("MouseEvent.WEBKIT_FORCE_AT_MOUSE_DOWN_static", "MouseEvent.WEBKIT_FORCE_AT_MOUSE_DOWN")}} - {{domxref("MouseEvent.webkitForce")}} -- [Force Touch events](/en-US/docs/Web/API/Force_Touch_events) diff --git a/files/en-us/web/api/mouseevent/webkit_force_at_mouse_down_static/index.md b/files/en-us/web/api/mouseevent/webkit_force_at_mouse_down_static/index.md index 36cd7cfd114defe..0990015e3a662ce 100644 --- a/files/en-us/web/api/mouseevent/webkit_force_at_mouse_down_static/index.md +++ b/files/en-us/web/api/mouseevent/webkit_force_at_mouse_down_static/index.md @@ -7,7 +7,7 @@ status: - non-standard --- -{{APIRef("UI Events")}}{{Non-standard_header}} +{{APIRef("Force Touch Events")}}{{Non-standard_header}} **`MouseEvent.WEBKIT_FORCE_AT_MOUSE_DOWN`** is a proprietary, WebKit-specific, static numeric property whose value is the minimum force necessary for a normal click. @@ -21,4 +21,3 @@ _Not part of any specification._ Apple has [a description at the Mac Developer L - {{domxref("MouseEvent.WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN_static", "MouseEvent.WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN")}} - {{domxref("MouseEvent.webkitForce")}} -- [Force Touch events](/en-US/docs/Web/API/Force_Touch_events) diff --git a/files/en-us/web/api/mouseevent/webkitforce/index.md b/files/en-us/web/api/mouseevent/webkitforce/index.md index c91a169388c24cc..45b88839e0a57ed 100644 --- a/files/en-us/web/api/mouseevent/webkitforce/index.md +++ b/files/en-us/web/api/mouseevent/webkitforce/index.md @@ -7,7 +7,7 @@ status: - non-standard --- -{{APIRef("UI Events")}}{{Non-standard_header}} +{{APIRef("Force Touch Events")}}{{Non-standard_header}} **`MouseEvent.webkitForce`** is a proprietary, WebKit-specific numeric property whose value represents the amount of pressure that is being applied on the touchpad or touchscreen. @@ -19,4 +19,3 @@ _Not part of any specification._ Apple has [a description at the Mac Developer L - {{domxref("MouseEvent.WEBKIT_FORCE_AT_MOUSE_DOWN_static", "MouseEvent.WEBKIT_FORCE_AT_MOUSE_DOWN")}} - {{domxref("MouseEvent.WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN_static", "MouseEvent.WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN")}} -- [Force Touch events](/en-US/docs/Web/API/Force_Touch_events) diff --git a/files/jsondata/GroupData.json b/files/jsondata/GroupData.json index 50a0c5926cfc559..eb91b8b8d8e3e17 100644 --- a/files/jsondata/GroupData.json +++ b/files/jsondata/GroupData.json @@ -523,6 +523,23 @@ "properties": [], "events": [] }, + "Force Touch Events": { + "overview": ["Force Touch Events"], + "guides": [], + "interfaces": [], + "methods": [], + "properties": [ + "MouseEvent.webkitForce", + "MouseEvent.WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN", + "MouseEvent.WEBKIT_FORCE_AT_MOUSE_DOWN" + ], + "events": [ + "Element: webkitmouseforcewillbegin", + "Element: webkitmouseforcedown", + "Element: webkitmouseforceup", + "Element: webkitmouseforcechanged" + ] + }, "Fullscreen API": { "overview": ["Fullscreen API"], "guides": ["/docs/Web/API/Fullscreen_API/Guide"],