跳转到主要内容

Element: webkitmouseforcewillbegin event

{{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 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 feature.

Syntax

Use the event name in {{domxref("EventTarget/addEventListener", "addEventListener()")}}:

addEventListener("webkitmouseforcewillbegin", (event) => { })

Alternatively, assign to the event handler property of the interface:

onwebkitmouseforcewillbegin = (event) => { }

Event type

A {{domxref("MouseEvent")}}. Inherits from {{domxref("UIEvent")}} and {{domxref("Event")}}.

{{InheritanceDiagram("MouseEvent")}}

Specifications

Not part of any specification. Apple has a description at the Mac Developer Library.

Browser compatibility

{{Compat}}

See also

  • Learn: Introduction to events
  • {{domxref("Element/webkitmouseforcedown_event", "webkitmouseforcedown")}}
  • {{domxref("Element/webkitmouseforceup_event", "webkitmouseforceup")}}
  • {{domxref("Element/webkitmouseforcechanged_event", "webkitmouseforcechanged")}}