Remap Bluteooth Headset Buttons (AVRCP)

Get help with using AutoHotkey and its commands and hotkeys
mm412
Posts: 1
Joined: 04 Apr 2020, 10:25

Remap Bluteooth Headset Buttons (AVRCP)

04 Apr 2020, 10:36

Hi,

I posted this Reddit a while ago, but got no replies. Maybe here is someone with an idea:

I'd like to remap my bluetooth headset (JBL Live 500) remote controls. The headset has three buttons , volume up and down (which work as next/previous track when pressed for two seconds) and play/pause and is connect via the Audio Video Remote Control Profile (AVRCP).
In particular I want the play/pause-button to mute/unmute the microphone).

Right now I have trouble to get the key in AHK. At first I tried the InstallKeybdHook-Method as well as the Script for Detecting Scan Codes, but the headset buttons are not recognized.

Then I found this thread that mentions AHKHID and a related post on reddit. Unfortunately I cant find my bluetooth device using the examples provided by AHKHID. Here is the output of Example 1: https://imgur.com/a/ac3fhin

There are 6 *other* devices found - the first two seem to be keyboard related, the next three to my mouse (vendor id belongs to logitech) and the last one to my monitor (vendor id is Eizo).

I tried listening to all of the devices using Example2, but no event is registered.

Here is another post on reddit with the same problem, but no solution.

When I connect the headset to my Linux laptop I can get the media buttons via `xev`. But on Linux it uses the Hands Free Profile (HFP), so that should be a whole other thing.


Any idea to achieve this is appreciated.
Thanks in advance,
mm412
Last edited by gregster on 04 Apr 2020, 10:48, edited 1 time in total.
Reason: Reddit links fixed.
BNOLI
Posts: 548
Joined: 23 Mar 2020, 03:55

Re: Remap Bluteooth Headset Buttons (AVRCP)

06 Apr 2020, 05:01

https://docs.microsoft.com/en-us/windows-hardware/drivers/bluetooth/general-bluetooth-support-in-windows
There are a bunch of videos available that are dealing with missing/replacing/corrupted BT device drivers under Win10. If JBL won't provide a driver on its own check out if you can identify its BT chipset and check its manufacturer for a driver:

https://www.runonpc.com/jbl-driver-downloads/15/ :silent: :shifty: :crazy:

Probably disabeling the "handsfree"-option will make it work with AVRCP instead?
https://superuser.com/questions/1471581/jbl-bluetooth-headset-sounds-bad-on-windows-10-when-using-it-with-skype
Remember to use [code]CODE[/code]-tags for your multi-line scripts. Stay safe, stay inside, and remember washing your hands for 20 sec !
diegocamarotta
Posts: 1
Joined: 26 Oct 2020, 17:55

Re: Remap Bluteooth Headset Buttons (AVRCP)

26 Oct 2020, 18:09

Same headset, looking for the same solution. I was able to find the button mapping via the below script

https://autohotkey.com/board/topic/21105-crazy-scripting-scriptlet-to-find-scancode-of-a-key/?p=196187

My current solution is the below

vkB3::^+m

This causes the media_play_pause button to press Ctrl+Shift+M which is the default mute shortcut (at least in Teams and Discord),I am currently for a DLL hook to see if i can emulate the Mute button on headsets so the action is systemwide and doesnt depend on the app being on focus and having that same shortcut

Hopefully this helps you, ill let you know about that hook for muting if i find it

Return to “Ask For Help”

Who is online

Users browsing this forum: fiendhunter, Google [Bot], Jmori, Moa, viv, XMCQCX and 56 guests