KrishKrosh /TrackWeight

Use your Mac trackpad as a weighing scale

★ 9,213⑂ 403
SwiftCreated 2025-07-21
9,213
stars
+4+6+41
403
forks
–
watchers
–
prs
–
issues
–
releases
–
discussions

README

TrackWeight

Turn your MacBook's trackpad into a precise digital weighing scale

TrackWeight is a macOS application that transforms your MacBook's trackpad into an accurate weighing scale by leveraging the Force Touch pressure sensors built into modern MacBook trackpads.

https://github.com/user-attachments/assets/7eaf9e0b-3dec-4829-b868-f54a8fd53a84

To use it yourself:

1. Open the scale
2. Rest your finger on the trackpad
3. While maintaining finger contact, put your object on the trackpad
4. Try to put as little pressure on the trackpad while still maintaining contact. This is the weight of your object

 How It Works

TrackWeight utilizes a custom fork of the Open Multi-Touch Support library by Takuto Nakamura to gain private access to all mouse and trackpad events on macOS. This library provides detailed touch data including pressure readings that are normally inaccessible to standard applications.

The key insight is that trackpad pressure events are only generated when there's capacitance detected on the trackpad surface - meaning your finger (or another conductive object) must be in contact with the trackpad. When this condition is met, the trackpad's Force Touch sensors provide precise pressure readings that can be calibrated and converted into weight measurements.

 Requirements

- macOS 13.0+ (Ventura or later)
- MacBook with Force Touch trackpad (2015 or newer MacBook Pro, 2016 or newer MacBook)
- App Sandbox disabled (required for low-level trackpad access)
- Xcode 16.0+ and Swift 6.0+ (for development)

 Installation

 Option 1: Download DMG (Recommended)

1. Go to the Releases page
2. Download the latest TrackWeight DMG file
3. Open the DMG and drag TrackWeight.app to your Applications folder
4. Run the application (you may need to allow it in System Preferences  Security & Privacy for unsigned builds)

 Option 2: Homebrew
bash
brew install --cask krishkrosh/apps/trackweight --force

 
 Option 3: Build from Source

1. Clone this repository
2. Open TrackWeight.xcodeproj in Xcode
3. Disable App Sandbox in the project settings (required for trackpad access)
4. Build and run the application

For more information about setting up the build pipeline, see .github/workflows/README.md.

 Calibration Process

The weight calculations have been validated by:
1. Placing the MacBook trackpad directly on top of a conventional digital scale
2. Applying various known weights while maintaining finger contact with the trackpad
3. Comparing and calibrating the pressure readings against the reference scale measurements
4. Ensuring consistent accuracy across different weight ranges

It turns out that the data we get from MultitouchSupport is already in grams!

 Limitations

- Finger contact required: The trackpad only provides pressure readings when it detects capacitance (finger touch), so you cannot weigh objects directly without maintaining contact
- Surface contact: Objects being weighed must be placed in a way that doesn't interfere with the requir

Snapshot: 2026-11-10T09:35:25Z · Data license Apache-2.0 · JSON