- Notifications
You must be signed in to change notification settings - Fork0
Arduino mouse jiggler for preventing a computer from locking in cases where it is not preventable in software (group policy).
License
TomasHubelbauer/arduino-mouse-jiggler
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This repository hosts Arduino code for turning an Arduino Leonardo into a mousejiggler.
A mouse jiggler is a either a hardware appliance of a software program for mousecursor movement automation for the purpose of preventing a computer from goingto sleep. Sometimes software-based solutions are locked down by IT departmentsat which point hardware-based solutions save the day.
There are several projects that implement other peripherials and translate themto mouse inputs, for example:
They all use theMouse.h
library that seems to come with the Arduino IDE. Themove
method in this library moves the mouse cursor relatively to its current positionmaking it ideal for a jiggler implementation.
#include<Mouse.h>voidsetup() { Mouse.begin();}byte shift =2;byte wait =250;voidloop() { Mouse.move(shift, -shift,0);delay(wait); Mouse.move(shift, shift,0);delay(wait); Mouse.move(-shift, shift,0);delay(wait); Mouse.move(-shift, -shift,0);delay(wait);}
This code will move the mouse in a diagonal shape, staying around the origin andnot sliding off. The on-board RX/TX LEDs will indicate USB communication, so youknow the board runs and works.
According to theMouse.h
documentation,32u4 based boardsand Due and Zero boards are supported:
These core libraries allow a 32u4 based boards or Due and Zero board to appearas a native Mouse and/or Keyboard to a connected computer.
This means Micro and Micro Pro should work. It didn't for me. I tried:
- Micro - Windows USB driver did notfind it
- Pro Micro - Windows USB driver didnot find it
- Uno - No support for USB HID
- Leonardo - Worked!I actually had a Freeduino Leonardo, but to the Arduino IDE it's all the same
After flashing the program using the Arduino IDE, the board restarts and startsacting as a mouse immediately. From this point on merely connecting it to thecomputer will power it and make it act as a mouse until disconnected.
While having issues with the Windows USB driver not finding Micro and Micro Pro,I also tried on macOS, but I was unable to flash it on macOS either. The bareArduino IDE install was not enough and I tried installing the driver recommendedby SparkFun:https://learn.sparkfun.com/tutorials/usb-serial-driver-quick-install-/all
But, this article points to an installer they host on their CDN and it is an oldversion which is not signed by Apple and won't work on Catalina.
I found the up to date version onhttps://ftdichip.com/drivers/vcp-drivers. Iinstalled the signed-by-Apple latest version for macOS, but the Arduino IDE didnot show any USB serial ports anyway. I gave up trying to make it work on macOS,but it probably would work for the Uno and the Leonardo, mimicking the issue onWindows.
I've implemented a Raspberry Pi based mouse jiggler in a complementary repo:https://github.com/TomasHubelbauer/raspi-mouse-jiggler
About
Arduino mouse jiggler for preventing a computer from locking in cases where it is not preventable in software (group policy).
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.