AutoHotkey does not support restricting a hotkey to a specific combination of VK and SC.
vkB1 is defined in the Windows SDK as
#define VK_MEDIA_PREV_TRACK 0xB1
i.e. Media_Prev, not Media_Play_Pause.
There is no (standard) Media_Pause button.
I'm certain that vkB1 wouldn't normally have the effect of pausing media, regardless of which scancode it is paired with. So putting that side, or assuming you meant Media_Prev...
For media keys, sc019 (actually sc119, which is just scancode 0x19 with the "extended key" flag) is normally paired with Media_Next (vkB0), not Media_Prev, which would be paired with sc110.
In any case, InputHook provides a way to detect a keypress and determine both its SC and VK:
Code: Select all
ih := InputHook("L0 V")
ih.KeyOpt("{vkB1}", "N")
ih.OnKeyDown := Func("ih_KeyDown")
ih.Start()
ih_KeyDown(ih, vk, sc) {
MsgBox % Format("sc{:03x}", sc)
}
If you want to detect more keys, just add them to the KeyOpt call.
To suppress the key, change "N" to "NS". You cannot conditionally suppress a key, but you can suppress it and then send the key again. In that case, you would need to change
"L0 V" to
"L0 V I" so that the sent key is ignored. Omitting the "I" option allows it to be triggered by Send, which I used for testing.