JavaScript MouseEvent webkitForce Property

Beginner
⏱️ 10 min read
📚 Updated: Jul 2026
🎯 5 Examples
🚀 5 Try-it labs
Non-standard
Instance property

What You’ll Learn

MouseEvent.webkitForce is a non-standard read-only number: how hard the user is pressing on a Force Touch trackpad or touchscreen. Learn feature detection, threshold compares, Force Touch events, and safer Pointer Events alternatives.

01

Kind

Instance property

02

Returns

Number (pressure)

03

Status

Non-standard

04

Access

event.webkitForce

05

Engine

WebKit / Safari

06

Prefer

pressure

Introduction

On Apple Force Touch hardware, a light press and a deep “force click” are different. WebKit exposes the live pressure as webkitForce on mouse events so pages can react to how hard the user presses—mostly useful for Safari experiments.

JavaScript
element.addEventListener("mousedown", (event) => {
  console.log(event.webkitForce); // number on supporting WebKit; often undefined elsewhere
});
💡
Beginner tip

Treat webkitForce as Safari/WebKit reading material. For new apps, listen to pointerdown / pointermove and read event.pressure instead.

Understanding the Property

MDN: MouseEvent.webkitForce is a proprietary, WebKit-specific numeric property whose value represents the amount of pressure applied on the touchpad or touchscreen. It is not part of any specification.

📝 Syntax

JavaScript
const force = mouseEvent.webkitForce;

Value

A number representing pressure when supported. Elsewhere the property is typically undefined. Always feature-detect before comparing.

⚖️ Force Touch Family

APIKindRole
event.webkitForceInstanceLive pressure on this event
MouseEvent.WEBKIT_FORCE_AT_MOUSE_DOWNStaticMinimum force for a normal click
MouseEvent.WEBKIT_FORCE_AT_FORCE_MOUSE_DOWNStaticMinimum force for a force click

Mental model: if event.webkitForce >= MouseEvent.WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN, treat it as a force click on supporting hardware.

⚡ Quick Reference

GoalCode
Detect supporttypeof event.webkitForce === "number"
Read pressureevent.webkitForce
Force-click checkevent.webkitForce >= MouseEvent.WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN
Pressure changesaddEventListener("webkitmouseforcechanged", …)
MDN statusNon-standard (WebKit proprietary)

🔍 At a Glance

Four facts about webkitForce.

Kind
instance

On the event

Type
number

When present

Status
non-standard

WebKit only

Use for
pressure

Force Touch

Examples Gallery

Examples follow MDN MouseEvent.webkitForce and the Force Touch events overview. On non-WebKit browsers, expect undefined—that is normal.

📚 Getting Started

Feature-detect and read live pressure safely.

Example 1 — Feature Detection

Always check before treating pressure as available.

JavaScript
const event = new MouseEvent("mousedown");
const supported = typeof event.webkitForce === "number";

console.log(supported); // true on some WebKit builds, else false
Try It Yourself

How It Works

A synthetic event is enough to ask whether the engine exposes a numeric webkitForce. Most browsers answer false.

Example 2 — Log webkitForce on Mouse Down

See the live value when the user presses.

JavaScript
document.addEventListener("mousedown", (e) => {
  console.log(
    typeof e.webkitForce === "number"
      ? e.webkitForce
      : "webkitForce not available"
  );
});
Try It Yourself

How It Works

On Force Touch Safari, you may see a number that rises as you press harder. Elsewhere, the fallback string runs.

📈 Thresholds, Force Events & Standards

Compare cutoffs, watch pressure changes, prefer Pointer Events.

Example 3 — Compare Against Force Thresholds

Classify a press as normal click vs force click when both APIs exist.

JavaScript
function classifyForce(event) {
  if (
    typeof event.webkitForce !== "number" ||
    !("WEBKIT_FORCE_AT_MOUSE_DOWN" in MouseEvent) ||
    !("WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN" in MouseEvent)
  ) {
    return "unsupported";
  }

  const force = event.webkitForce;
  if (force >= MouseEvent.WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN) {
    return "force-click";
  }
  if (force >= MouseEvent.WEBKIT_FORCE_AT_MOUSE_DOWN) {
    return "normal-click";
  }
  return "light";
}

document.addEventListener("mousedown", (e) => {
  console.log(classifyForce(e));
});
Try It Yourself

How It Works

Guard the instance pressure and both static thresholds. Only then compare bands the way Apple’s Force Touch docs describe.

Example 4 — Listen for webkitmouseforcechanged

MDN: this event fires as pressure changes between mouse down and up.

JavaScript
document.addEventListener("webkitmouseforcechanged", (e) => {
  if (typeof e.webkitForce === "number") {
    console.log("pressure:", e.webkitForce);
  }
});

// On non-WebKit browsers this listener never runs — that is expected.
Try It Yourself

How It Works

Related Force Touch events include webkitmouseforcedown, webkitmouseforceup, and webkitmouseforcewillbegin. All are non-standard and Safari-oriented.

Example 5 — Prefer PointerEvent.pressure

A more standard path for pressure-aware UI.

JavaScript
element.addEventListener("pointerdown", (e) => {
  // 0–1 when the device reports pressure; often 0.5 for a normal mouse click
  console.log(e.pressure);
});

element.addEventListener("pointermove", (e) => {
  if (e.pressure > 0) {
    console.log("pressure:", e.pressure);
  }
});
Try It Yourself

How It Works

Pointer Events are the modern, standardized way to read pressure. Keep webkitForce for learning Safari Force Touch history—not as your primary production path.

🚀 Common Use Cases

  • Safari / WebKit Force Touch experiments and demos.
  • Detecting force clicks vs normal clicks with the static thresholds.
  • Logging pressure while learning proprietary Force Touch events.
  • Teaching why non-standard APIs need feature detection.
  • Migrating pressure UX toward PointerEvent.pressure.

🔧 How It Works

1

User presses Force Touch hardware

Trackpad or touchscreen reports pressure to WebKit.

Input
2

Browser builds MouseEvent

Sets webkitForce when the engine supports it.

Event
3

Listener reads pressure

Your handler compares against static Force Touch thresholds.

Handler
4

Branch or fall back

Force-click UX on Safari; Pointer Events elsewhere.

📝 Notes

Limited / Non-standard Support

MouseEvent.webkitForce is a Non-standard WebKit proprietary instance property. Logos use the shared browser-image-sprite.png sprite. Expect support mainly in Safari/WebKit Force Touch contexts; Chromium and Firefox typically omit it.

Non-standard · WebKit

MouseEvent.webkitForce

Live Force Touch pressure on mouse events. Feature-detect; do not require it for Chrome/Firefox users.

Limited WebKit-oriented
Google Chrome Typically not available
No support
Mozilla Firefox Typically not available
No support
Apple Safari WebKit Force Touch builds may expose it
Limited
Microsoft Edge Typically not available (Chromium)
No support
Opera Typically not available
No support
Internet Explorer Not available
No support
webkitForce Limited

Bottom line: Instance Force Touch pressure on MouseEvent in WebKit; missing elsewhere—prefer PointerEvent.pressure.

Conclusion

event.webkitForce is a WebKit-only pressure reading for Force Touch. Feature-detect it, compare against the static thresholds when present, and prefer PointerEvent.pressure for real products.

Continue with x, WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN, shiftKey, or the JavaScript hub.

💡 Best Practices

✅ Do

  • Feature-detect with typeof event.webkitForce === "number"
  • Compare to the static WEBKIT_FORCE_AT_* thresholds when present
  • Prefer PointerEvent.pressure for production pressure UX
  • Keep Force Touch as an optional enhancement
  • Test on real Force Touch hardware when possible

❌ Don’t

  • Require webkitForce for core Chrome/Firefox features
  • Skip feature detection before comparing numbers
  • Confuse instance webkitForce with the static thresholds
  • Assume every Safari machine has Force Touch hardware
  • Mutate event.webkitForce on live user events

Key Takeaways

Knowledge Unlocked

Five things to remember about webkitForce

Non-standard WebKit Force Touch pressure—learn it, prefer standards.

5
Core concepts
🔢 02

Number

pressure value

Type
🍎 03

WebKit

Safari-oriented

Engine
⚖️ 04

Thresholds

static cutoffs

Compare
🛡️ 05

Non-standard

detect first

Status

❓ Frequently Asked Questions

It is a proprietary WebKit numeric property on a mouse event that represents how much pressure is being applied on a Force Touch trackpad or touchscreen. On non-WebKit browsers it is usually undefined.
MDN marks it Non-standard — not part of any specification. It is not labeled Deprecated or Experimental on that MDN page, but you should not rely on it in production cross-browser code.
Feature-detect both event.webkitForce and MouseEvent.WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN, then check whether webkitForce is greater than or equal to that static threshold.
MDN’s Force Touch docs list it on webkitmouseforcewillbegin, mousedown, webkitmouseforcechanged, webkitmouseforcedown, webkitmouseforceup, mousemove, and mouseup when the engine supports Force Touch.
Prefer Pointer Events with event.pressure (0–1) on pointerdown / pointermove when you need more standard, cross-browser pressure sensing.
Instance. Read event.webkitForce on a live mouse event. The related WEBKIT_FORCE_AT_* values are static constants on the MouseEvent constructor.
Did you know?

Apple’s Force Touch docs note that trackpads without Force Touch may still report a webkitForce equal to MouseEvent.WEBKIT_FORCE_AT_MOUSE_DOWN on click-related events—so a numeric value alone does not always mean deep-press hardware is present.

Next: MouseEvent.x

Learn the short alias for clientX—viewport X coordinates.

x →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful