Please note that I created this for my own personal use. I will not be maintaining or updating this code unless I need to make edits for myself. If you want a feature please fork the code and do whatever you need with it as allowable under the license. For the most part this works. Every so often I get a stray palm touch that moves my cursor but it's nowhere near as often as it used to be. I hope this helps someone out there.
TypeShield blocks trackpad/mouse input for a brief window after each keypress to prevent stray palm touches while typing.
Apple Silicon native (M1–M4), macOS 13+.
- Blocks clicks, drags, (optionally) scroll
- Tunable block and grace windows
- Simple CLI; optional LaunchAgent for auto-start at login
- Handy
typeshieldctltool for start/stop/restart/status/logs/edit - Minimal Xcode project included for folks who prefer Xcode over SwiftPM.
swift build -c release
./.build/release/TypeShield --help- Open
TypeShield.xcodeprojin Xcode 15+. - Select the TypeShield scheme.
- Product → Build (⌘B) or Run (⌘R).
- Executable output:
DerivedData/.../Build/Products/Debug/TypeShield
- Executable output:
sudo cp ./.build/release/TypeShield /usr/local/bin/typeshieldtypeshield --block-ms 275 --grace-ms 40
# add --allow-scroll to allow scroll events during the block window
# add --verbose for debug output--block-ms <n>(default 300)--grace-ms <n>(default 30)--allow-scroll(omit to block scrolling)--verbose|-v--help|-h--version
mkdir -p ~/Library/LaunchAgents
cp Resources/com.typeshield.agent.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/com.typeshield.agent.plistEdit defaults by changing ProgramArguments in the plist and reloading:
launchctl unload ~/Library/LaunchAgents/com.typeshield.agent.plist
launchctl load -w ~/Library/LaunchAgents/com.typeshield.agent.plistInstall the helper script:
sudo cp scripts/typeshieldctl /usr/local/bin/typeshieldctl
sudo chmod +x /usr/local/bin/typeshieldctlUsage:
typeshieldctl start|stop|restart|status|logs|edit|pathThe edit command opens the plist in TextEdit and auto-restarts the agent after you save & close (if it was running).
typeshield --block-ms 275 --grace-ms 40On first run, approve System Settings → Privacy & Security → Input Monitoring for the terminal or the binary path.
SPDX-License-Identifier: AGPL-3.0-only
© 2025 Eric Crescimano and contributors.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0.
See LICENSE for the full license text.
If you find TypeShield stops working after sleep and wake, or you want an aggressive self-healing setup, see extras/docs/README-EXTRAS.md and run:
./extras/install.shTo remove the helpers:
./extras/uninstall.sh