简体   繁体   中英

How can I create a button (or hotkey) that will automatically connect my bluetooth headset?

I have a bluetooth headset that I would like to be able to quickly switch between connection from my laptop(running windows 8) to my phone. I downloaded autohotkey to help me make a hotkey that would connect to my bluetooth headset, but I was only able to make a hotkey that would open the bluetooth control panel for my specific headset, which is not what I was trying to accomplish. What I am trying to accomplish is a hotkey that would immediately connect my headset when typed.

The code I used in autohotkey, to open the bluetooth control panel(by clicking Ctrl + Alt + B ) is:

^!b:: run "C:\Program Files\WIDCOMM\Bluetooth Software\BTWUIExt.exe"  /deviceAddr=445ef3aa5294

this code won't work for you as the numbers and letters on the end are a uniqe idendifier for my specific headset. You can find your unique id by opening bluetooth in the control panel and right clicking your headset, selecting properties, clicking the bluetooth tab (remove the dots and colons).

There is very little information to give exact solution. But from given information I can say:

  1. You can automate GUI with AutoHotkey so that script will go to the place where unique id is located. In fact, AutoHotkey allows any GUI automation (conventional or non conventional GUI).

  2. If the unique id is there as a text and you can copy it, then it also can be automated by several ways. If unique id cant be coped and is as image, then it is slightly complicated and you need to use some OCR techniques. In that case you need to make screenshot of that region and use some OCR script getting text out of it. Or with AutoHotkey pass image to OCR software and get text from it.

  3. After you have text, you can manipulate it the way you like. Most powerfull solution is Regular Expressions which are supported by AutoHotkey.

  4. When unique id is ready to use, you can use it in Run command this way:

    ^!b:: run "C:\\Program Files\\WIDCOMM\\Bluetooth Software\\BTWUIExt.exe" %MyUnicIDVariable%

This worked to connect the first bluetooth device in the list (Windows 10)

#SingleInstance,force
;https://autohotkey.com/board/topic/83571-autohotkey-connect-to-bluetooth/
^F1::
Run, bthprops.cpl
Sleep, 2000
Send, {tab}{tab}{enter}{tab}{enter}
Sleep, 200
Send,!{Tab}
return

Turns out that the code I have works on its own. If I just wait for about 10 seconds after typing out the hotkey, the headphones connect, and the control panel that opened automatically closes. Quite convenient actually as I didn't expect it to connect or to auto-close the window.

Thanks for the effort anyway!

Try to install [Broadcom Bluetooth 4.0 Driver for Windows 8.1 ] LINK=>> 1 ! At least works fine on my HP-EliteBook-8570p with stereo "BlueDio 99B" headset. After switching the headset ON the Windows connect the device automatically, and switch Audio-Stream into new-attached device. Optimal! PS - Unfortunately it is still the Problem with Windows 8.1 + Skype( MIC-Problem) :( Windows 8 is the first OS, than not support Skype at all! ;)

蓝牙耳机AUDIOIN音频输出

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM