X7xenon/antigravity-bluetooth-remote

Turn any Bluetooth selfie button into a physical push-to-talk clicker and prompt submitter for Google Antigravity

Python

0

2 commits

updated Sep 19, 2026

See the code

See what people are saying (1)

SourceMessageScoreDate

Turned a cheap Bluetooth selfie button into a physical push-to-talk clicker for Google Antigravity (r/SideProject)

Google Antigravity has native speech-to-text dictation with Ctrl+M, and the transcription quality is surprisingly solid. But having to sit right in front of the keyboard just to hit Ctrl+M to start dictating and then press Enter to submit defeats the purpose of hands-free agentic prompting. I took…

2

Sep 19, 2026

README

Antigravity Bluetooth Remote

A lightweight Windows background daemon that turns any standard 2-dollar Bluetooth selfie shutter or presentation clicker into a physical push-to-talk wand and prompt submitter for Google Antigravity.

Why this exists

Google Antigravity has built-in speech-to-text dictation triggered via Ctrl+M. While the voice model is fast, having to reach for the keyboard to hit Ctrl+M, speak, and then hit Enter ruins the hands-free voice assistant experience.

Most cheap Bluetooth selfie remotes (AB Shutter 3, TikTok scroll rings, camera remotes) register as standard Bluetooth HID keyboards that emit Volume Up (0xAF) or Volume Down (0xAE).

This daemon intercepts those signals at the Win32 driver level, suppresses the Windows volume changes and screen HUD, brings the Antigravity window to the foreground, and maps them to dictation actions:

  • Single Click: Restores and focuses Antigravity, toggles microphone (Ctrl+M).
  • Double Click: Finalizes dictation and submits the prompt (Enter via hardware scan code 0x1C).
  • Shift + Click: Passes through the original volume keystroke so you can still adjust PC volume when needed.

Features

  • Low-level Win32 keyboard hook (WH_KEYBOARD_LL) with zero dropped clicks.
  • OS Volume HUD suppression: drops key events so the annoying Windows volume overlay never flashes on your screen.
  • Calibrated Bluetooth debounce: accounts for physical switch latency and wireless packet delays (~550ms threshold).
  • Bulletproof window focus controller: attaches thread input, uses desktop station routing, and clears Windows foreground lock to reliably bring Antigravity forward across monitors or virtual desktops.
  • Clean dictation finalization: double-clicking while the microphone is recording stops the mic first, waits for the transcript to settle, and then fires Enter.
  • Low-latency audio cues: subtle system beeps confirm single clicks (1200Hz tick) and double clicks (ascending chime).
  • Single instance protection: Named Mutex (Global\AntigravityBluetoothRemoteMutex) prevents duplicate hook collisions.
  • Zero-window silent background execution via pythonw.exe and one-click Windows Startup installer.

Hardware Compatibility

Works out of the box with virtually any Bluetooth remote that triggers camera shutters:

  • AB Shutter 3 (widely available generic Bluetooth camera remotes)
  • Bluetooth TikTok scrolling rings / finger clickers
  • Bluetooth presentation remotes and media clickers
  • Any device sending HID Consumer Control Volume Up (0xAF), Volume Down (0xAE), or Play/Pause (0xB3)

Requirements

  • Windows 10 or Windows 11 (64-bit)
  • Python 3.8+
  • Google Antigravity

Installation

  1. Clone the repository:
git clone https://github.com/X7xenon/antigravity-bluetooth-remote.git
cd antigravity-bluetooth-remote
  1. Install dependencies:
pip install -r requirements.txt
  1. Pair your Bluetooth remote to your PC via Windows Settings -> Bluetooth & devices.

Usage

Run in Console (Testing & Debugging)

python main.py

Or double-click start_remote.bat.

Run Silently in Background

Double-click start_remote_silent.vbs.

This runs the daemon via pythonw.exe without opening a command prompt or taskbar icon.

Run on Windows Startup

Double-click install_startup.bat.

This adds a shortcut to %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup pointing to the silent runner. The remote will be active every time you log in.

To remove it, double-click uninstall_startup.bat.

Command Line Arguments

usage: main.py [-h] [--interval INTERVAL] [--no-sound] [--debug]
               [--no-suppress] [--status] [--test-mic] [--test-enter]

Antigravity Bluetooth Remote: Map any selfie shutter clicker to Antigravity actions

options:
  -h, --help           show this help message and exit
  --interval INTERVAL  Double-tap threshold in seconds (default: calibrated ~0.55s)
  --no-sound           Disable audio beep feedback
  --debug              Enable verbose hook event logging
  --no-suppress        Do not swallow OS volume events (native volume will change)
  --status             Display current background service status and metrics
  --test-mic           Test action: Focus Antigravity and simulate Ctrl+M
  --test-enter         Test action: Focus Antigravity and simulate Enter key

Checking Status

To check if the daemon is running and view click statistics:

python main.py --status

Output:

---------------------------------------------------------------
  Antigravity Bluetooth Remote Status
---------------------------------------------------------------
  Running       : YES
  Started At    : 2026-09-19 15:00:00
  Single Taps   : 14
  Double Taps   : 6
  Suppressed    : 26
  Last Event    : single_tap (Antigravity Mic ON Ctrl+M)
  Last Time     : 2026-09-19 15:08:12
---------------------------------------------------------------

How It Works Under The Hood

+-------------------------+
| Bluetooth Selfie Remote |
+-------------------------+
             |  (BLE HID: VK_VOLUME_UP / 0xAF)
             v
+-------------------------+
| WH_KEYBOARD_LL Hook     | ---> Returns 1 (Swallows key; no Windows volume HUD)
+-------------------------+
             |
             +---> Single Tap ---> Focuses Antigravity Window ---> Sends Ctrl+M (Mic Toggle)
             |
             +---> Double Tap ---> Stops Mic (if active)      ---> Sends Enter (Scan code 0x1C)
  1. Hook: Installs a low-level keyboard hook using SetWindowsHookExW(WH_KEYBOARD_LL).
  2. Filter & Suppress: When VK_VOLUME_UP or VK_VOLUME_DOWN is detected, the callback increments internal counters and returns 1 to discard the event, stopping Windows from adjusting audio volume. If the user holds Shift, the hook calls CallNextHookEx to preserve normal volume adjustments.
  3. Timer & State Machine: A single press starts a high-resolution timer. If a second press arrives before expiration, it cancels the timer and dispatches the double-click handler.
  4. Window Management: To guarantee the keystrokes land in Antigravity even when another application or game has focus, the controller invokes AttachThreadInput, simulates an Alt key tap to bypass the Win32 SetForegroundWindow restriction, restores minimized state, and routes input directly to Antigravity's process.

License

MIT License. See LICENSE file for details.

Contributors

X7xenon

2 commits

X7xenon/antigravity-bluetooth-remote

Turn any Bluetooth selfie button into a physical push-to-talk clicker and prompt submitter for Google Antigravity

Python

0

2 commits

updated Sep 19, 2026

See the code

See what people are saying (1)

SourceMessageScoreDate

Turned a cheap Bluetooth selfie button into a physical push-to-talk clicker for Google Antigravity (r/SideProject)

Google Antigravity has native speech-to-text dictation with Ctrl+M, and the transcription quality is surprisingly solid. But having to sit right in front of the keyboard just to hit Ctrl+M to start dictating and then press Enter to submit defeats the purpose of hands-free agentic prompting. I took…

2

Sep 19, 2026

README

Antigravity Bluetooth Remote

A lightweight Windows background daemon that turns any standard 2-dollar Bluetooth selfie shutter or presentation clicker into a physical push-to-talk wand and prompt submitter for Google Antigravity.

Why this exists

Google Antigravity has built-in speech-to-text dictation triggered via Ctrl+M. While the voice model is fast, having to reach for the keyboard to hit Ctrl+M, speak, and then hit Enter ruins the hands-free voice assistant experience.

Most cheap Bluetooth selfie remotes (AB Shutter 3, TikTok scroll rings, camera remotes) register as standard Bluetooth HID keyboards that emit Volume Up (0xAF) or Volume Down (0xAE).

This daemon intercepts those signals at the Win32 driver level, suppresses the Windows volume changes and screen HUD, brings the Antigravity window to the foreground, and maps them to dictation actions:

  • Single Click: Restores and focuses Antigravity, toggles microphone (Ctrl+M).
  • Double Click: Finalizes dictation and submits the prompt (Enter via hardware scan code 0x1C).
  • Shift + Click: Passes through the original volume keystroke so you can still adjust PC volume when needed.

Features

  • Low-level Win32 keyboard hook (WH_KEYBOARD_LL) with zero dropped clicks.
  • OS Volume HUD suppression: drops key events so the annoying Windows volume overlay never flashes on your screen.
  • Calibrated Bluetooth debounce: accounts for physical switch latency and wireless packet delays (~550ms threshold).
  • Bulletproof window focus controller: attaches thread input, uses desktop station routing, and clears Windows foreground lock to reliably bring Antigravity forward across monitors or virtual desktops.
  • Clean dictation finalization: double-clicking while the microphone is recording stops the mic first, waits for the transcript to settle, and then fires Enter.
  • Low-latency audio cues: subtle system beeps confirm single clicks (1200Hz tick) and double clicks (ascending chime).
  • Single instance protection: Named Mutex (Global\AntigravityBluetoothRemoteMutex) prevents duplicate hook collisions.
  • Zero-window silent background execution via pythonw.exe and one-click Windows Startup installer.

Hardware Compatibility

Works out of the box with virtually any Bluetooth remote that triggers camera shutters:

  • AB Shutter 3 (widely available generic Bluetooth camera remotes)
  • Bluetooth TikTok scrolling rings / finger clickers
  • Bluetooth presentation remotes and media clickers
  • Any device sending HID Consumer Control Volume Up (0xAF), Volume Down (0xAE), or Play/Pause (0xB3)

Requirements

  • Windows 10 or Windows 11 (64-bit)
  • Python 3.8+
  • Google Antigravity

Installation

  1. Clone the repository:
git clone https://github.com/X7xenon/antigravity-bluetooth-remote.git
cd antigravity-bluetooth-remote
  1. Install dependencies:
pip install -r requirements.txt
  1. Pair your Bluetooth remote to your PC via Windows Settings -> Bluetooth & devices.

Usage

Run in Console (Testing & Debugging)

python main.py

Or double-click start_remote.bat.

Run Silently in Background

Double-click start_remote_silent.vbs.

This runs the daemon via pythonw.exe without opening a command prompt or taskbar icon.

Run on Windows Startup

Double-click install_startup.bat.

This adds a shortcut to %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup pointing to the silent runner. The remote will be active every time you log in.

To remove it, double-click uninstall_startup.bat.

Command Line Arguments

usage: main.py [-h] [--interval INTERVAL] [--no-sound] [--debug]
               [--no-suppress] [--status] [--test-mic] [--test-enter]

Antigravity Bluetooth Remote: Map any selfie shutter clicker to Antigravity actions

options:
  -h, --help           show this help message and exit
  --interval INTERVAL  Double-tap threshold in seconds (default: calibrated ~0.55s)
  --no-sound           Disable audio beep feedback
  --debug              Enable verbose hook event logging
  --no-suppress        Do not swallow OS volume events (native volume will change)
  --status             Display current background service status and metrics
  --test-mic           Test action: Focus Antigravity and simulate Ctrl+M
  --test-enter         Test action: Focus Antigravity and simulate Enter key

Checking Status

To check if the daemon is running and view click statistics:

python main.py --status

Output:

---------------------------------------------------------------
  Antigravity Bluetooth Remote Status
---------------------------------------------------------------
  Running       : YES
  Started At    : 2026-09-19 15:00:00
  Single Taps   : 14
  Double Taps   : 6
  Suppressed    : 26
  Last Event    : single_tap (Antigravity Mic ON Ctrl+M)
  Last Time     : 2026-09-19 15:08:12
---------------------------------------------------------------

How It Works Under The Hood

+-------------------------+
| Bluetooth Selfie Remote |
+-------------------------+
             |  (BLE HID: VK_VOLUME_UP / 0xAF)
             v
+-------------------------+
| WH_KEYBOARD_LL Hook     | ---> Returns 1 (Swallows key; no Windows volume HUD)
+-------------------------+
             |
             +---> Single Tap ---> Focuses Antigravity Window ---> Sends Ctrl+M (Mic Toggle)
             |
             +---> Double Tap ---> Stops Mic (if active)      ---> Sends Enter (Scan code 0x1C)
  1. Hook: Installs a low-level keyboard hook using SetWindowsHookExW(WH_KEYBOARD_LL).
  2. Filter & Suppress: When VK_VOLUME_UP or VK_VOLUME_DOWN is detected, the callback increments internal counters and returns 1 to discard the event, stopping Windows from adjusting audio volume. If the user holds Shift, the hook calls CallNextHookEx to preserve normal volume adjustments.
  3. Timer & State Machine: A single press starts a high-resolution timer. If a second press arrives before expiration, it cancels the timer and dispatches the double-click handler.
  4. Window Management: To guarantee the keystrokes land in Antigravity even when another application or game has focus, the controller invokes AttachThreadInput, simulates an Alt key tap to bypass the Win32 SetForegroundWindow restriction, restores minimized state, and routes input directly to Antigravity's process.

License

MIT License. See LICENSE file for details.

Contributors

X7xenon

2 commits

Languages

Python

94.2%

Batchfile

4.6%

VBScript

1.2%