Skip to content

mishamyrt/nanomiddleclick

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

29 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

nanomiddleclick

Lightweight daemon for middle-click emulation on macOS.

Features

  • Supports:
    • MacBook onboard trackpad;
    • Magic Trackpad;
    • Magic Mouse.
  • Uses 12 MB of RAM (compared to 40+ for MiddleClick)
  • Highly configurable.

What for?

To open links in a new tab or close tabs in browsers with a single action using one hand (without pressing cmd) and paste highlighted text in the Terminal app.

Why is there no UI?

I don't think these kinds of background apps need any UI or menu items. The background daemon is launched once, configured via the terminal, and then left for a long time.

It just works, consuming the minimum possible resources.

Installation

Brew

brew install mishamyrt/tap/nanomiddleclick

From source

To build the project, you must have the Rust toolchain installed on your computer.

make
make install

Setup

Once the app is installed, you need to start the background process. To do this, run the following in your terminal:

nanomiddleclick daemon on

Configuration

The daemon reads settings from co.myrt.nanomiddleclick. After changing the configuration, you must restart the daemon:

kill -HUP "$(pgrep -x nanomiddleclick)"

Number of Fingers

You can use any number of fingers (up to 10) to middle-click.

☝️ Note: setting fingers to 2 will conflict with normal two-finger right-clicks.

defaults write co.myrt.nanomiddleclick fingers -int 4

Allow to click with more than the defined number of fingers.

This is useful if your second hand accidentally touches the touchpad.

Disabled by default.

defaults write co.myrt.nanomiddleclick allowMoreFingers -bool true

Tapping tuning

The default values for these settings should work for most users, but if they aren't working correctly for you, you should start by adjusting them.

Max Distance Delta

The maximum distance the cursor can travel between touch and release for a tap to be considered valid. The position is normalized and values go from 0 to 1.

Default is 0.05.

defaults write co.myrt.nanomiddleclick maxDistanceDelta -float 0.03

Max Time Delta

The maximum interval in milliseconds between touch and release for a tap to be considered valid.

Default is 300

defaults write co.myrt.nanomiddleclick maxTimeDelta -int 150

Ignored apps

Some (actually very rare) applications have built-in separate support for 3-finger taps. To avoid conflicts with them and prevent the daemon from running, use can use ignoredAppBundles parameter.

Default is empty.

defaults write co.myrt.nanomiddleclick ignoredAppBundles -array com.apple.finder com.apple.Terminal

Tap to click

The app can handle both clicks and trackpad taps. By default, it follows the system behavior for 1 and 2 fingers, but you can set a custom one:

defaults write co.myrt.nanomiddleclick tapToClick -bool true

Magic Mouse mode

Magic Mouse supports several types of actions to emulate a middle-click:

  • center β€” click with one finger in the horizontal center zone.
  • threeFinger β€” click with 3 fingers anywhere
  • disabled β€” ignore Magic Mouse and emulate middle-click only with trackpad.

Default is center.

defaults write co.myrt.nanomiddleclick mouseClickMode -string threeFinger

Credits

Heavily inspired by MiddleClick.app

License

MIT.

About

πŸ–– Lightweight daemon for middle-click emulation

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Contributors

Languages