Skip to content

Commit

Permalink
add GroupData for Force Touch Events (mdn#30657)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
skyclouds2001 authored and estelle committed Dec 5, 2023
1 parent c2c5ef3 commit e42a37e
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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")}}
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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")}}
5 changes: 2 additions & 3 deletions files/en-us/web/api/element/webkitmouseforceup_event/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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")}}
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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")}}
6 changes: 4 additions & 2 deletions files/en-us/web/api/force_touch_events/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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)
3 changes: 1 addition & 2 deletions files/en-us/web/api/mouseevent/webkitforce/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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)
17 changes: 17 additions & 0 deletions files/jsondata/GroupData.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down

0 comments on commit e42a37e

Please sign in to comment.