A collection of experimental approaches to use a colored laser pointer as a mouse input device on macOS.
Create a laser-pointer-controlled mouse for a MacBook without external hardware (ideally), exploiting unconventional sensing methods.
Uses the MacBook's built-in ambient light sensor combined with display rastering patterns to detect laser position through single-pixel imaging techniques (inspired by MIT research on ALS privacy threats).
Uses the built-in webcam to detect the laser dot on the screen through reflections or a small mirror placed to view the screen.
A simple Arduino-based photodiode frame that uses trilateration to locate the laser position - most reliable but requires hardware.
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt- MacBook displays are LCD with LED backlighting, not LED pixels
- LCD pixels modulate transmitted light using liquid crystals, not LEDs
- The backlight LEDs are behind the display panel and not individually addressable
- No known API exposes individual LED voltage readings
-
Ambient Light Sensor: MacBooks have an ALS (AppleLMUController) that reads ambient brightness. MIT researchers demonstrated computational imaging using ALS + known display patterns.
-
LED Reverse Photovoltaic Effect: LEDs CAN sense light (~2V photovoltaic voltage when illuminated). Arduino projects exist that use this. Could be exploited with external LED arrays.
-
Webcam Detection: Well-established technique using OpenCV to track laser dots in camera feed.
strategy1_als_imaging.py- Ambient Light Sensor approachstrategy2_webcam_detect.py- FaceTime camera reflection approachstrategy3_arduino_photodiode/- Hardware approach (Arduino code + Python interface)utils/- Shared utilities for mouse control
- macOS (tested on Apple Silicon)
- Python 3.9+
- For Strategy 2: Camera permissions
- For Strategy 3: Arduino + photodiodes