/Clicker

Turns any key into a mouse button

Primary LanguageObjective-CGNU General Public License v3.0GPL-3.0

NOTE: Karabiner-Elements now allows you to directly assign mouse buttons, so it might be better to use it instead of Clicker.

This small program listens to keyboard events and translates presses and releases of a specific key to presses and releases of a mouse button. It has been tested on OS X 10.11 and macOS 10.12, but it should work from OS X 10.6 onwards.

Grab a release

At the moment, Clicker is very simple, works in the background (with minimal CPU usage), and has no user interface. To exit it, please use Activity Monitor.

I wrote Clicker to be able to use the CapsLock key as a left mouse button on macOS Sierra. With previous operating systems, I'd use Karabiner with Seil, but they don't work with macOS Sierra. Sierra users must use Karabiner-Elements, but there is no support for translating key presses to mouse button presses at the moment, so I wrote this part.

How to use CapsLock as a left mouse button on macOS Sierra

First, install Karabiner-Elements and launch it. Setup a Simple Modification from key caps_lock to key application.

Then, go to the Keyboard section of the System Preferences app, click the Modifier keys… on the bottom right, and set the Caps Lock key to No Action.

At this point, any press of the CapsLock key will result in writing an invisible character corresponding to the PC Application key, which isn't really useful. You'll need Clicker to turn virtual presses of the PC Application key to virtual mouse clicks.

Launch the Clicker application. On the first launch, it'll probably ask that you grant it accessibility features (Security section of the System Preferences app, Confidentiality pane, Accessibility subsection), and just quit. Once you have done that, launch Clicker again and you're done.

To always enable Clicker, I added it in the Login Items pane of the System Preferences app (section Users and groups).

Changing to another key or to another mouse button

Clicker could work with another key and another mouse button, but for now, you'll need to grab the source code and to recompile it with your settings (see comments near the beginning of method -[ClickerController init], in ClickerController.m).

Feel free to send issues and requests if you'd like this tool to support your use case.