Go to System Preferences → Bluetooth and for your AirPods choose Options and set ‘Connect to This Mac’ to ‘When Last Connected to This Mac’.
Now your AirPods won't automatically switch away from your iPhone to your Mac. Make the equivalent change on your iPhone to stop the other way round.
Then your AirPods will always connect to the last device and you can ...
If you have airpods apple just started supported automatic device switching with the newest software versions (fall 2020). Here is a link to read more about it,
If you don't have airpods and new devices then you may be out of luck for now. Some other bluetooth devices use a button to switch between ...
There is a third-party utility named blueutil that makes it easy:
blueutil --power toggle
Toggles the Bluetooth power state.
See the Usage section on the linked webpage for additional usage information.
Note: If you do toggle the power state, turning Bluetooth off, make sure you can control your Mac's keyboard via USB or built-in if a notebook.
Unless you have one of the very early Intel Macs, the Windows Support Software is suppose to be available to the Windows installer during the installation process. This is so the Windows installer can access any drivers included in the Windows Support Software that are not already part of the installation software provided by Microsoft.
If you have an older ...
Karabiner + Blueutil Solution
I do something like this using a bluetooth cli tool named blueutil. Here is a complex modification you could use in Karabiner.
"title": "Bluetooth Connect",
"description": "Connect to AirPods",
I solved my Bluetooth Mice issue in Windows 10 Boot Camp as of Feb 2021 with latest macOS Big Sur update by following:
Update macOS and follow steps here to install Windows Support Software: https://support.apple.com/en-au/HT204923
Update Windows. Went to Settings, Device Manager, Bluetooth and update driver for all Bluetooth radio and everything. Restart.