Element: webkitmouseforcewillbegin event
{{APIRef("Force Touch Events")}}{{Non-standard_header}}
Safari for macOS fires the non-standard webkitmouseforcewillbegin event at an {{domxref("Element")}}Element before firing the initial {{domxref("Element/mousedown_event", "mousedown")}}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")}}MouseEvent. Inherits from {{domxref("UIEvent")}}UIEvent and {{domxref("Event")}}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")}}webkitmouseforcedown{{domxref("Element/webkitmouseforceup_event", "webkitmouseforceup")}}webkitmouseforceup{{domxref("Element/webkitmouseforcechanged_event", "webkitmouseforcechanged")}}webkitmouseforcechanged