Skip to main content

airhand

Drive any device that accepts a Bluetooth keyboard and mouse: phones, tablets, computers and TVs. Nothing is installed on the device. A $10 nRF52840 USB dongle pairs with it as a keyboard, mouse and media remote, and your computer sends it commands over USB serial.

your computer ──USB serial──▶ nRF52840 dongle ──Bluetooth LE HID──▶ phone · tablet · computer · TV

Use it to automate devices that you cannot or do not want to instrument: real phones without developer mode, locked-down apps, kiosks, set-top boxes. Add a camera over the screen if your automation needs to see.

What it can send

Input Commands
Pointer at an exact position tap, double tap, right click, long press, hover, swipe, drag
Scroll wheel vertical and horizontal
Keyboard text on a US layout, any key with ctrl / shift / alt / cmd, F1 to F24, the numpad
Media and system keys home, back, search, volume, mute, play/pause, next, previous, brightness

Positions are fractions of the screen, 0.0 to 1.0, so the same script works at any resolution.

Hardware

  • A Nordic nRF52840 Dongle (PCA10059). It costs about $10.
  • A device with Bluetooth LE that accepts a Bluetooth keyboard and mouse.

Quick start

  1. Flash the firmware. Download airhand-firmware-<version>.zip from the releases. Press the dongle's RESET button (the red LED pulses), then:

    pip install nrfutil
    nrfutil install nrf5sdk-tools
    nrfutil nrf5sdk-tools dfu usb-serial -pkg airhand-firmware-<version>.zip -p <serial port>
    
  2. Pair. Open the device's Bluetooth settings and select airhand. Pairing needs no code.

    • iPhone and iPad: turn on Settings > Accessibility > Touch > AssistiveTouch to use the pointer.
    • Android, computers and TVs: no extra settings.
  3. Send input.

    pip install airhand
    
    from airhand import Dongle
    
    with Dongle() as dongle:
        dongle.media("home")
        dongle.tap(0.5, 0.3)
        dongle.type_text("hello\n")
        dongle.swipe((0.5, 0.8), (0.5, 0.3), ms=400)
        dongle.key("cmd+space")
    

    Dongle() opens the one plugged-in dongle. With several, give a USB serial number from airhand.serial_numbers(): Dongle("<serial>"). A dongle found by serial number is found again after a replug. Use Dongle(port="/dev/ttyACM0") for a fixed port.

Python API

Method Does
tap(x, y, button="left", count=1) Click. count=2 is a double click; button is left, right or middle.
hold(x, y, ms, button="left") Press and hold: a long press.
move(x, y) Move the pointer without pressing.
swipe(start, end, ms, hold_ms=0) Press, move, release. With hold_ms, a drag that starts with a long press.
wheel(lines, pan=0) Turn the scroll wheel by detents. Positive turns it up and right; natural scrolling reverses the content.
type_text(text) Type text.
key(combo) Press a key or a combination, such as enter, a or ctrl+shift+t.
media(name) Press a media or system key.
status() The link state, such as {"conn": "yes", "sec": "2", "interval_ms": "45"}.
unpair() Forget every paired device.

airhand.serial_numbers() lists the plugged-in dongles. airhand.KEYS, MODIFIERS, MEDIA and BUTTONS list every name the firmware accepts.

Errors all derive from airhand.AirhandError:

Error Means
HostUnavailable No device took the command within 10 s: it is not connected, or never encrypted the link. Its reason says which.
DongleLost The dongle is not plugged in or stopped answering. The command may or may not have run.
Unsupported The input cannot be sent: a character, key, button or position outside what the firmware supports.
Refused The firmware refused the command and sent nothing. Its reason holds the firmware's words.
WrongFirmware The port answers, but not with airhand firmware of the client's series: client 0.1.x needs firmware 0.1.x.

The client keeps commands safe across a lost reply. Every request carries an id, and a reply that goes missing is asked for again with result <id>, so a tap is never sent twice.

airhand.testing.FakeDongle answers the protocol on a pseudo-terminal (macOS and Linux), so you can test your code without hardware:

from airhand import Dongle
from airhand.testing import FakeDongle

with FakeDongle() as fake:
    Dongle(port=fake.port).tap(0.5, 0.5)
    assert fake.commands == [("tap", "0.5000", "0.5000")]

Serial protocol

Every language can use the dongle: it is one line per request on a USB serial port. See docs/protocol.md.

Platform notes

Device Notes
iPhone, iPad Turn on AssistiveTouch for the pointer. A slow drag can count as a tap: move at least 0.75 screen heights per second. iOS has no Back key.
Android Back, Home and the pointer work with no setup.
macOS, Windows, Linux Use the wheel to scroll; a drag selects text on a computer.
TVs and set-top boxes Use arrow keys, enter and the media keys.

Tested on an iPhone 12 with iOS 26. Results from other devices are welcome as issues or pull requests.

Build the firmware

The firmware is a Zephyr app for nRF Connect SDK v3.4.1, in firmware/:

west build -b nrf52840dongle/nrf52840 -d build firmware
nrfutil nrf5sdk-tools pkg generate --hw-version 52 --application-version 1 --sd-req=0x00 \
  --application build/firmware/zephyr/zephyr.hex airhand-firmware.zip

The protocol core, firmware/src/proto.c, has no Zephyr dependency. The tests build it for your computer and drive it through the Python client:

pip install -e . pytest
pytest

License

Apache-2.0. See LICENSE.

The released firmware image also contains Zephyr (Apache-2.0) and parts of the nRF Connect SDK, such as the Bluetooth LE controller and the HID service, under the Nordic 5-Clause license. Those parts may only be used with Nordic Semiconductor chips.

Metadata

Release files for airhand 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for airhand 0.1.0
File Size Uploaded Provenance Actions
airhand-0.1.0.tar.gz 28.3 kB With provenance Details for airhand-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for airhand 0.1.0
File Interpreter ABI Platform Actions
airhand-0.1.0-py3-none-any.whl Python 3 none any Details for airhand-0.1.0-py3-none-any.whl

Total release size: 43.0 kB

Release files / airhand-0.1.0.tar.gz

Download URL airhand-0.1.0.tar.gz
Size 28.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0653153022d178a84d8becc4064108caff84deafdda15e7bc0ca983c4fd34d4c
BLAKE2b-256 checksum
How to use checksums
aba8ec54b424754aaf4365b3242c3ef80f64e248a7a45ff56d53419b9fd231d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Release files / airhand-0.1.0-py3-none-any.whl

Download URL airhand-0.1.0-py3-none-any.whl
Size 14.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b4c7796a2b4b67b6f4b3574389f2a722251336c472bb5878a019bfe430b8680
BLAKE2b-256 checksum
How to use checksums
0b7f97a514f09328b9086f804fb7a5ac22ca079392f8d6d4acd47b51c989a9b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Security for airhand 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for airhand-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page