Arduino Nano Mouse Clicker
Arduino Nano Mouse Clicker

Automated Mouse Clicker

Written by Scratch on Monday May 25, 2020

...or, how to prevent repetitive strain injury in gamers' fingers!

Ouch!

I saw my nephews playing some games that rewarded them for making lots of mouse clicks (and I mean LOTS; tens of thousands). As a sufferer of arthritis in my fingers I thought I'd see if I could do something to help them cheat save their joints.

This article summarises my first day's investigations, and presents a practical, if hacked, solution.  When I say I hacked a solution I mean that in the old fashioned (i.e. my) meaning of hack; that is, to bodge a solution that is just about fit for purpose. I still have trouble with the modern meaning!

Initial Thoughts

The first thought was to use an Arduino type device to emulate a mouse. These boards all have USB controllers built in, so surely they can emulate mice? Long story short - no, they can't. Well a few can, but most can't.

Thought 2 then, bit bang a USB cable and do it myself. The hardware side of this is doable, you just need to take care with voltage levels on the USB data lines. However I couldn't find a concise definition of the appropriate USB HID (Human Interface Device) spec for this. So this is parked for now.

Thought 3, use a Bluetooth device. I know this would work because I've used Bluetooth on an ESP32 to do this, but that means paring a device and the ESP32 is really total overkill for this.

And finally, I opened up an old mouse, found the left button's pins on the USB and shorted them - click! - aha! So, the hacked approach will be to use a simple microcontroller to simply make the electrical connection on the physical mouse, multiple times a second.

Arduino Nano Mouse Clicker
Prototype Arduino Nano Mouse Clicker

Related content