A macOS app that converts three-finger trackpad clicks to middle clicks, perfect for closing browser tabs and other middle-click actions.
- Background Operation: Runs silently in the background with a menu bar icon
- Three-Finger Detection: Detects three-finger trackpad gestures and converts them to middle clicks
- Easy Control: Simple menu bar interface to enable/disable the feature
- Permission Management: Automatic handling of accessibility permissions
- Cross-Application Support: Works with any application that supports middle clicks
- macOS 10.15 (Catalina) or later
- Built-in trackpad or Magic Trackpad
- Xcode 12.0 or later (for building from source)
- Accessibility permissions (granted automatically on first run)
Install directly from the repository using Homebrew:
brew install --build-from-source https://raw.githubusercontent.com/WinkyTy/MacOS-Trackpad-MiddleClick/main/Formula/middleclick.rb-
Clone the repository:
git clone https://github.com/WinkyTy/MacOS-Trackpad-MiddleClick.git cd MacOS-Trackpad-MiddleClick -
Open in Xcode:
open MiddleClick.xcodeproj
-
Build the project:
- In Xcode, press
β+Bto build - Or use the build script:
./build.sh
- In Xcode, press
-
Run the app:
- In Xcode, press
β+Rto run - Or run from command line:
open build/Release/MiddleClick.app
- In Xcode, press
- Clone and build:
git clone https://github.com/WinkyTy/MacOS-Trackpad-MiddleClick.git cd MacOS-Trackpad-MiddleClick chmod +x build.sh ./build.sh
-
Clone the repository:
git clone https://github.com/WinkyTy/MacOS-Trackpad-MiddleClick.git cd MacOS-Trackpad-MiddleClick -
Build using xcodebuild:
xcodebuild -project MiddleClick.xcodeproj -scheme MiddleClick -configuration Release
-
Run the app:
open build/Release/MiddleClick.app
After installation, launch the MiddleClick app. You'll see a grid icon appear in your menu bar.
When you first run the app, you'll be prompted to grant accessibility permissions:
- Click "Open System Preferences" when prompted
- Navigate to: System Preferences > Security & Privacy > Privacy > Accessibility
- Add MiddleClick to the list:
- Click the lock icon to make changes
- Click the "+" button
- Navigate to your app location and select MiddleClick
- Check the box next to MiddleClick
- Restart the app if needed
- Click the grid icon in your menu bar
- Select "Enable Middle Click" from the menu
- Verify the icon is filled (indicating the feature is active)
The app appears as a grid icon in your menu bar:
- π¦ Filled Grid Icon: Feature is enabled and active
- βͺ Outline Grid Icon: Feature is disabled
- Enable/Disable Middle Click: Toggle the three-finger to middle-click conversion
- Status: Shows current status (Enabled/Disabled)
- About MiddleClick: Information about the app
- Open System Preferences: Quick access to accessibility settings
- Quit: Exit the application
- Ensure the feature is enabled (filled grid icon in menu bar)
- Perform a three-finger click on your trackpad
- The app will convert it to a middle click at the same location
- Perfect for:
- Closing browser tabs
- Opening links in new tabs
- Other middle-click actions in any application
- Open a web browser (Chrome, Safari, Firefox)
- Open multiple tabs
- Enable MiddleClick from the menu bar
- Try a three-finger click on a tab
- The tab should close (middle-click behavior)
-
Check Permissions:
- System Preferences > Security & Privacy > Privacy > Accessibility
- Ensure MiddleClick is checked and enabled
-
Restart the App:
- Quit MiddleClick from the menu bar
- Relaunch the application
-
Check Menu Bar Status:
- Ensure the feature is enabled (filled grid icon)
- Check the status in the menu
-
Verify Trackpad Settings:
- System Preferences > Trackpad
- Ensure "Tap to click" and other gestures are enabled
-
Try Different Gestures:
- Three-finger click (press down)
- Three-finger tap (light tap)
- Three-finger swipe
-
Check App Status:
- Ensure MiddleClick is enabled in the menu bar
- Verify accessibility permissions are granted
- Application Limitations: Some applications may not respond to programmatically generated middle clicks
- Browser Compatibility: Works best with modern browsers (Chrome, Safari, Firefox, Edge)
- System Apps: May have limited support in some system applications
-
Xcode Version:
- Ensure you have Xcode 12.0 or later
- Update Xcode if needed
-
Build Errors:
- Clean the project:
Product > Clean Build Folderin Xcode - Delete derived data:
Window > Projects > Click arrow next to project > Delete
- Clean the project:
-
Permission Issues:
- Ensure you have admin privileges
- Check that the project is in a writable location
-
Update Homebrew:
brew update
-
Check Formula:
brew info middleclick
-
Reinstall:
brew uninstall middleclick brew install --build-from-source https://raw.githubusercontent.com/WinkyTy/MacOS-Trackpad-MiddleClick/main/Formula/middleclick.rb
-
Install with Verbose Output:
brew install --build-from-source --verbose https://raw.githubusercontent.com/WinkyTy/MacOS-Trackpad-MiddleClick/main/Formula/middleclick.rb
MiddleClick/
βββ MiddleClick/
β βββ MiddleClickApp.swift # Main app delegate
β βββ StatusBarController.swift # Menu bar interface
β βββ TrackpadHandler.swift # Gesture detection
β βββ ContentView.swift # Unused (background app)
β βββ Info.plist # App configuration
β βββ Assets.xcassets/ # App assets
βββ MiddleClickTests/ # Unit tests
βββ MiddleClickUITests/ # UI tests
βββ Formula/ # Homebrew formula
β βββ middleclick.rb # Homebrew formula
β βββ README.md # Formula documentation
βββ scripts/ # Build and release scripts
β βββ create-release.sh # Release creation script
βββ build.sh # Build script
βββ README.md # This file
- Event Monitoring: Uses NSEvent monitors to detect trackpad gestures
- CGEvent Tap: Alternative method for intercepting mouse events
- Accessibility Integration: Proper permission handling and status checking
- Background Operation: Runs as a menu bar app without dock icon
-
Archive the project in Xcode:
- Product > Archive
- Select "Distribute App"
- Choose "Copy App"
-
Create DMG (optional):
- Use Disk Utility to create a disk image
- Drag the app to the disk image
- Eject and distribute
-
Create a Release:
./scripts/create-release.sh 1.0.0 "Initial release" -
Update Formula (if needed):
- The formula will be automatically updated with the correct SHA256
- Commit and push the changes
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes
- Test thoroughly
- Submit a pull request
This project is open source. Feel free to modify and distribute according to your needs.
If you encounter any issues:
- Check the troubleshooting section above
- Open an issue on GitHub with:
- macOS version
- Xcode version
- Detailed error description
- Steps to reproduce
- Initial release
- Three-finger to middle-click conversion
- Menu bar interface
- Accessibility permission handling
- Background operation
- Homebrew formula support
Enjoy using MiddleClick! π±οΈβ¨