Bluetooth Auto Toggle
Automatically cycles Bluetooth off and back on in milliseconds when a connected device is detected at startup
Author: Dev-StudioCode
A Windhawk tool mod that automatically cycles Windows Bluetooth off and back on
(in milliseconds) whenever Windhawk boots with your system and a connected
Bluetooth device is detected.
Why this mod?
Some Bluetooth hardware adapters, drivers, and wireless peripherals (e.g.,
Bluetooth headphones, earbuds, mice, and keyboards) enter an unresponsive or
degraded state on fresh system boots even when Windows displays them as
"connected" causing audio silence, latency, no absolute volume or connection
drops unless Bluetooth is power-cycled. This mod automates that process by
waiting until a device is connected, pausing a configurable few seconds for the
driver stack to settle, and cleanly cycling the Bluetooth radio off and then
back on in the background.
Key Features
- Startup & Manual Turn-On Cycle: Automatically cycles Bluetooth off and
back on at startup if active. If Bluetooth was OFF at boot, it listens for when
you manually turn it ON later and automatically triggers the fast toggle cycle.
- Device-Aware Activation: Optionally only cycles Bluetooth when a
connected Bluetooth device (headset, mouse, keyboard, etc.) is found.
- Continuous Device Monitoring: Optionally monitors for connected devices
and cycles Bluetooth whenever any eligible Bluetooth device connects throughout
the day.
- Per-Device Target Filtering: Supports allowing all connected devices by
default or restricting auto-toggle triggers to specific devices using flexible
keyword and token matching (explicit allowlist or blocklist rules).
- Precise Millisecond Timing: Configurable startup delay, post-connection
delay, and off-to-on toggle duration in milliseconds.
- Dedicated Tool Mod Architecture: Runs in an isolated
windhawk.exe
background tool process without injecting into or hooking explorer.exe or any
other critical system process.
- Cold Boot Hardware Retry: Automatically retries radio enumeration if the
Bluetooth service (
bthserv) or adapter driver is still initializing during
Windows boot.
- State-Safe Cycling: Only toggles radios that are already powered ON
(leaving radios in Airplane mode or turned off alone).
- Safe Power Restoration & Crash Recovery: Minimizes the off window, ensures
radios are commanded back on with retries even if the mod is unloaded mid-cycle,
and persistently tracks in-progress cycles to restore power upon next launch if
interrupted.
- Session-Safe: Remembers the current Windows logon session across tool
process restarts using Windows Terminal Services (WTS) logon timestamps.
- Graceful Lifecycle & Live Testing: Responsive to settings updates, mod
reload, and instant cancellation on shutdown.
Changelog
- v1.4.0
- Added
applyToAllDevices setting (enabled by default) and targetDevices
filter list to allow restricting auto-toggle initiation to specific Bluetooth
devices or excluding unwanted peripherals.
- Added flexible case-insensitive keyword and token matching with
allow/exclude toggles evaluated top-to-bottom.
- Updated startup device detection and the
DeviceWatcher event monitor to
respect per-device filter rules and avoid triggering on excluded peripherals.
- Added crash and interruption recovery tracking (
cycleInProgress) to
automatically restore Bluetooth radios back to ON if a cycle is ever interrupted.
- Added 60-second expiration to dropped-device tracking so subsequent
reconnections are never permanently absorbed.
- v1.3.0
- Added
toggleOnEveryDeviceConnection setting to continuously monitor and
power-cycle Bluetooth on every newly connected Bluetooth device throughout the
session.
- Event-driven device monitoring using Windows Runtime
DeviceWatcher
(System.Devices.Aep.IsConnected) for zero idle CPU overhead.
- Tracks devices dropped during radio cycling (
g_droppedByCycle) so
subsequent reconnection of active devices does not trigger redundant cycles.
- v1.2.0
- Replaced
onlyWhenDeviceConnected with activationMode (deviceConnected
vs startup).
- Added
startupBluetoothState setting to enforce Bluetooth power state (ON /
OFF / Unchanged) at startup.
- Added manual turn-on event detection if Bluetooth starts in an OFF state.
- Reordered initialization flow so radio discovery and power state enforcement
run before device connection checks.
- v1.1.0
- Added
onlyWhenDeviceConnected setting to only cycle when a connected
device is detected.
- Added WTS session logon tracking to persist single-cycle state across
restarts.
- v1.0.0