简体   繁体   English

如何创建自动连接蓝牙耳机的按钮(或热键)?

[英]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. 我有一个蓝牙耳机,希望能够在从笔记本电脑(运行Windows 8)到手机的连接之间快速切换。 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. 我下载了autohotkey来帮助我制作一个可以连接到我的蓝牙耳机的热键,但是我只能制作一个可以打开我的特定耳机的蓝牙控制面板的热键,而这并不是我想要实现的。 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: 我在自动热键中用来打开蓝牙控制面板(通过单击Ctrl + Alt + B )的代码是:

^!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). 您可以通过以下方法找到唯一的ID:在控制面板中打开蓝牙,右键单击耳机,选择属性,然后单击蓝牙选项卡(删除点和冒号)。

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. 您可以使用AutoHotkey自动执行GUI,以便脚本将转到unique id所在的位置。 In fact, AutoHotkey allows any GUI automation (conventional or non conventional GUI). 实际上,AutoHotkey允许任何GUI自动化(常规或非常规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. 如果unique id以文本形式存在,并且您可以复制它,那么也可以通过多种方式将其自动化。 If unique id cant be coped and is as image, then it is slightly complicated and you need to use some OCR techniques. 如果无法解决unique id且将其作为图像的情况,那么它会有些复杂,您需要使用一些OCR技术。 In that case you need to make screenshot of that region and use some OCR script getting text out of it. 在这种情况下,您需要制作该区域的屏幕截图,并使用一些OCR脚本从该区域中提取文本。 Or with AutoHotkey pass image to OCR software and get text from it. 或使用AutoHotkey将图像传递到OCR软件并从中获取文本。

  3. After you have text, you can manipulate it the way you like. 收到文字后,您可以按自己喜欢的方式进行操作。 Most powerfull solution is Regular Expressions which are supported by AutoHotkey. 最强大的解决方案是AutoHotkey支持的正则表达式。

  4. When unique id is ready to use, you can use it in Run command this way: 准备使用unique id ,可以通过以下方式在“运行”命令中使用它:

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

This worked to connect the first bluetooth device in the list (Windows 10) 这可以连接列表中的第一个蓝牙设备(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. 如果我在键入热键后仅等待约10秒钟,则耳机将连接,并且打开的控制面板将自动关闭。 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 ! 尝试安装[适用于Windows 8.1的Broadcom蓝牙4.0驱动程序] LINK = >> 1 At least works fine on my HP-EliteBook-8570p with stereo "BlueDio 99B" headset. 至少在带有立体声“ BlueDio 99B”耳机的HP-EliteBook-8570p上可以正常工作。 After switching the headset ON the Windows connect the device automatically, and switch Audio-Stream into new-attached device. 在打开耳机后,Windows会自动连接设备,然后将Audio-Stream切换到新连接的设备。 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! ;) PS-不幸的是,Windows 8.1 + Skype仍然是问题(MIC-Problem):( Windows 8是第一个操作系统,根本不支持Skype!

蓝牙耳机AUDIOIN音频输出

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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