USB Wireless Headset Hangup button

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Amiddaru
Posts: 1
Joined: 21 Apr 2021, 11:44

USB Wireless Headset Hangup button

21 Apr 2021, 12:09

Hello there,

First of all thanks a lot for the help you provide on this board. :clap:

I m really close to make my headset working in order to hang up and hang down a call from an app.

Here is the script :

Code: Select all

SetWorkingDir %A_ScriptDir%
#include ahkhid.ahk
#InstallKeybdHook ;install keyboard hook, enables you to use modifier keys in conjunction with the Powermate

Gui, +LastFound
GuiH := WinExist()

;Intercept WM_INPUT messages
WM_INPUT := 0xFF
OnMessage(WM_INPUT, "InputMsg")

AHKHID_Register(11, 5,GuiH, RIDEV_INPUTSINK) ;register device

InputMsg(wParam, lParam) 
{
    Local devh, key
    Critical    ;or otherwise you could get ERROR_INVALID_HANDLE

	;get handle of device
    devh := AHKHID_GetInputInfo(lParam, II_DEVHANDLE)

	If (devh <> -1)
        And (AHKHID_GetDevInfo(devh, DI_DEVTYPE, True) = RIM_TYPEHID)
        And (AHKHID_GetDevInfo(devh, DI_HID_VENDORID, True) = 27027) ;Replace these three
        And (AHKHID_GetDevInfo(devh, DI_HID_PRODUCTID, True) = 45128) ;numbers with your
        And (AHKHID_GetDevInfo(devh, DI_HID_VERSIONNUMBER, True) = 257) ;devices numbers.
        {

	;get the keycode
	key := (AHKHID_GetInputInfo(lParam, II_MSE_RAWBUTTONS))
	
    If (key <> -1)  ; a
	SendInput {Ctrl down}{Shift down}{a down}{Ctrl up}{Shift up}{a up}
	

	}

}
[Mod edit: [code][/code] tags added.]


The script was working before a modification i made but i m sure it s about those lines :

Code: Select all

    If (key <> -1)  ; a
	SendInput {Ctrl down}{Shift down}{a down}{Ctrl up}{Shift up}{a up}

Besides sorting that out, i would like to add a fonction which is double tap on that button.
The VendorId / ProductID / Version number are correct


How is this possible?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 222 guests