Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Controlling media players from Logitech G35 headset


  • Please log in to reply
24 replies to this topic
KeyOh
  • Members
  • 9 posts
  • Last active: Mar 20 2015 08:47 PM
  • Joined: 14 May 2009
This script can control gom player, vlc media player or Windows Media Player from the G35 headset.

Priority order is: GOM player, VLC, WMP
So if both VLC and WMP is running the script will control VLC, and if GOM player is running GOM will be controlled.

I know it's bulky but at least it works in Windows 7 =)

To make it work some settings needs to be done in the G35 settings.
Change the G-button handling to:
G1 -> WinDVD 9.0 -> Fast Forward
G2 -> WinDVD 9.0 -> Play / Pause
G3 -> WinDVD 9.0 -> Rewind


G1 will forward 10 s in gom and vlc, and fast forward in wmp
G2 will toggle play/pause
G3 will rewind 10 s in gom and vlc, and rewind in wmp

Hope this was helpful for someone =)

;G1 - forward
SC121::
IfWinExist, ahk_class GomPlayer1.x ;Gom player
{
DetectHiddenWindows, On
ControlSend, ahk_parent, {Right}, ahk_class GomPlayer1.x
DetectHiddenWindows, Off
return
}

IfWinExist, ahk_class QWidget ;VLC
{
DetectHiddenWindows, On
ControlSend, ahk_parent, !{Right}, ahk_class QWidget
DetectHiddenWindows, Off
return
}

IfWinExist, ahk_class CWmpControlCntr ;Windows Media Player fullscreen
{
DetectHiddenWindows, On
PostMessage,   0x111, 32813, 0,, ahk_class WMPlayerApp
DetectHiddenWindows, Off
return
}

IfWinExist, ahk_class WMP Skin Host ;Windows Media Player boxed
{
DetectHiddenWindows, On
PostMessage,   0x111, 32813, 0,, ahk_class WMPlayerApp
DetectHiddenWindows, Off
return
}
return


;G2 - Play/Pause
SC139::
IfWinExist, ahk_class GomPlayer1.x ;Gom player
{
DetectHiddenWindows, On
ControlSend, ahk_parent, {Space}, ahk_class GomPlayer1.x
DetectHiddenWindows, Off
return
}

IfWinExist, ahk_class QWidget ;VLC
{
DetectHiddenWindows, On
ControlSend, ahk_parent, {space}, ahk_class QWidget
DetectHiddenWindows, Off
return
}

IfWinExist, ahk_class CWmpControlCntr ;Windows Media Player fullscreen
{
DetectHiddenWindows, On
PostMessage,   0x111, 32808, 0,, ahk_class WMPlayerApp
DetectHiddenWindows, Off
return
}

IfWinExist, ahk_class WMP Skin Host ;Windows Media Player boxed
{
DetectHiddenWindows, On
PostMessage,   0x111, 32808, 0,, ahk_class WMPlayerApp
DetectHiddenWindows, Off
return
}
return


;G3 - rewind
SC113::
IfWinExist, ahk_class GomPlayer1.x ;Gom player
{
DetectHiddenWindows, On
ControlSend, ahk_parent, {Left}, ahk_class GomPlayer1.x
DetectHiddenWindows, Off
return
}

IfWinExist, ahk_class QWidget ;VLC
{
DetectHiddenWindows, On
ControlSend, ahk_parent, !{Left}, ahk_class QWidget
DetectHiddenWindows, Off
return
}

IfWinExist, ahk_class CWmpControlCntr ;Windows Media Player fullscreen
{
DetectHiddenWindows, On
PostMessage,   0x111, 32812, 0,, ahk_class WMPlayerApp
DetectHiddenWindows, Off
return
}

IfWinExist, ahk_class WMP Skin Host ;Windows Media Player boxed
{
DetectHiddenWindows, On
PostMessage,   0x111, 32812, 0,, ahk_class WMPlayerApp
DetectHiddenWindows, Off
return
}
return


specter333
  • Members
  • 627 posts
  • Last active: Oct 07 2016 07:43 AM
  • Joined: 15 Jan 2007
Very cool, I have to get one of these now. :D

A couple of things you might be interested in.

With the WinAmp library it would be very easy to add WinAmp to your script.
http://www.autohotke...ighlight=winamp

And not that it matters but if you didn't want to use shortcuts to control VLC here is a partial list of HTTP commands.
http://www.autohotke...7&highlight=vlc

So I saw your are using the buttons as special hotkeys (I think that's the term). Is your head set seen as a Keyboard? If not how are the keys being received? I've been trying to use other devices for input and would like to keep it simple like as hotkeys but haven't had any luck.

Great script, looks handy.

KeyOh
  • Members
  • 9 posts
  • Last active: Mar 20 2015 08:47 PM
  • Joined: 14 May 2009

Very cool, I have to get one of these now. :D

A couple of things you might be interested in.

With the WinAmp library it would be very easy to add WinAmp to your script.
http://www.autohotke...ighlight=winamp

And not that it matters but if you didn't want to use shortcuts to control VLC here is a partial list of HTTP commands.
http://www.autohotke...7&highlight=vlc

So I saw your are using the buttons as special hotkeys (I think that's the term). Is your head set seen as a Keyboard? If not how are the keys being received? I've been trying to use other devices for input and would like to keep it simple like as hotkeys but haven't had any luck.

Great script, looks handy.


Hi thank's, good that you liked it. I can't take full credit though =)
The special hotkeys I found here:
<!-- m -->http://logitech.lith... ... d-p/424838<!-- m -->

and most of the media player controls was borrowed from arround this forum. The script is however quite straight forward so it should be simple to update it with whatever functions you would prefer.

Input from different devices can easily be controlled in autohotkey using similar shortcuts. The special hotkeycode can be found by using the keyhistory i autohotkey: AHK main window -> View -> Key history and script info

Scroll down to the bottom of the page. Activate your chosen input and press F5. Note the recently activated SC codes and you could use those codes in your script. It's a little trail by error but it works =)

specter333
  • Members
  • 627 posts
  • Last active: Oct 07 2016 07:43 AM
  • Joined: 15 Jan 2007
Wow, Thanks. I can't believe with all the time I've spent looking in to this and all the questions I've asked in the forum I didn't know about keyhistory. Unfortunately it only saw 3 of the keys on my remote so it doesn't help me any, but it's good to know.

What caught my eye with your script is I was looking for input methods I could incorporate into a script I'm working on. It's basically for assigning inputs to functions without having to know how to script. I just posted a preview version to get some input and ideas for it. Take a look if you like.
https://ahknet.autoh...EasyAuto V1.zip

Let me know what you think. I'm getting ideas now because I'm at that point where it's not yet too late to go back and rewrite it.

Do they make that headset in a wireless version?

KeyOh
  • Members
  • 9 posts
  • Last active: Mar 20 2015 08:47 PM
  • Joined: 14 May 2009
Wow, that's a lot of AHK scripts. Don't have any ideas on top of my head though =)

BTW I updated the G35 headset script, to also include the active soundcard fast switch (win key + F4), as that is very usefull together with the headset. Also I did some organisation of the script to make it easier to edit, and added Spotify control when none of the videoplayers are running. Note iTunes support are included at the bottom of the script, and can easily replace the Spotify controls.

Still looking for how to include the soundcard fastswitch into one of the G-buttons but still haven't figured out how.

Unfortunately some of the text is in Norwegian.

;--------------------------------------------------------------------------
;--------------------------------------------------------------------------
;  G35 knapper - kontroller gom player, vlc eller WMP
;--------------------------------------------------------------------------
;--------------------------------------------------------------------------
#InstallKeybdHook
SetTitleMatchMode 2

#F4::
 gosub byttlydkort
 return


;G1
SC121::
 IfWinExist, ahk_class GomPlayer1.x ;Gom
 {
  gosub GomForwardTen
  return
 }
  IfWinExist,VLC media player ;Vlc
 {
 gosub VlcForwardTen
 return
 }
 IfWinExist, ahk_class CWmpControlCntr ;Wmp fullscreen
 {
  gosub WmpNext
  return
 }
 IfWinExist, ahk_class WMP Skin Host ;Wmp boxed
 {
  gosub WmpNext
  return
 }
 gosub SpotifyNext
 gosub SpotifySong
 return


;G2
SC139::
 IfWinExist, ahk_class GomPlayer1.x ;Gom
 {
  gosub GomPlayPause
  return
 }
 IfWinExist,VLC media player ;Vlc
 {
  gosub VlcPlayPause
  return
 }
 IfWinExist, ahk_class CWmpControlCntr ;Wmp fullscreen
 {
  gosub WmpPlayPause
  return
 }
 IfWinExist, ahk_class WMP Skin Host ;Wmp boxed
 {
  gosub WmpPlayPause
  return
 }
 DetectHiddenWindows, On
 IfWinNotExist, ahk_class SpotifyMainWindow
 {
  gosub SpotifyActivate
  return
 }
 DetectHiddenWindows, Off
 gosub SpotifyPlayPause
 gosub SpotifySong
 return


;G3
SC113::
 IfWinExist, ahk_class GomPlayer1.x ;Gom
 {
  gosub GomBackTen
  return
 }
 IfWinExist,VLC media player ;Vlc
 {
  gosub VlcBackTen
  return
 }
 IfWinExist, ahk_class CWmpControlCntr ;Wmp fullscreen
 {
  gosub WmpPrevious
  return
 }
 IfWinExist, ahk_class WMP Skin Host ;Wmp boxed
 {
  gosub WmpPrevious
  return
 }
 gosub SpotifyPrevious
 gosub SpotifySong
 return
;--------------------------------------------------------------------------
;--------------------------------------------------------------------------
;--------------------------------------------------------------------------


;--------------------------------------------------------------------------
;--------------------------------------------------------------------------
;--------------------------------------------------------------------------
; SCRIPTENE
;--------------------------------------------------------------------------
;--------------------------------------------------------------------------
;--------------------------------------------------------------------------



; Bytt lydkort
;--------------------------------------------------------------------------

byttlydkort:
 Run, mmsys.cpl
 WinWait,Sound
 ControlSend,SysListView321,{Down}
 ControlGet, isEnabled, Enabled,,&Set Default
 if(!isEnabled)
 {
  ControlSend,SysListView321,{Down}
 }
 ControlGet, Current, List, Selected, SysListView321
 TrayTip, Aktivt lydkort:,  %current%
 SetTimer, RemoveTrayTip, 1500

 ControlClick,&Set Default
 ControlClick,OK
 WinWaitClose
 SoundPlay, *-1
 return

; iTunes codes
;-------------------------------------------------------------
itunesnext:
 DetectHiddenWindows, On
 ControlSend, ahk_parent, ^{right}, iTunes ahk_class iTunes
 DetectHiddenWindows, Off
 return

itunesprevious:
 DetectHiddenWindows, On
 ControlSend, ahk_parent, ^{left}, iTunes ahk_class iTunes
 DetectHiddenWindows, Off
 return

itunesvolup:
 DetectHiddenWindows, On
 ControlSend, ahk_parent, ^{up}, iTunes ahk_class iTunes
 DetectHiddenWindows, Off
 return

itunesvoldown:
 DetectHiddenWindows, On
 ControlSend, ahk_parent, ^{down}, iTunes ahk_class iTunes
 DetectHiddenWindows, Off
 return


itunesplaypause:
 DetectHiddenWindows, On
 ControlSend, ahk_parent, {space}, iTunes ahk_class iTunes
 DetectHiddenWindows, Off
 return

itunesactivate:
 IfWinNotExist, ahk_class iTunes
 {
  Run %ProgramFiles%\iTunes\iTunes.exe  ;launch program
  return
 }
 IfWinNotActive ; restores window
 WinActivate
 Else
 WinMinimize ; minimizes windows
 return


; Spotify codes
;-------------------------------------------------------------
SpotifyNext:
 DetectHiddenWindows, On
 ControlSend, ahk_parent, ^{Right}, ahk_class SpotifyMainWindow
 DetectHiddenWindows, Off
 return

SpotifyPrevious:
 DetectHiddenWindows, On
 ControlSend, ahk_parent, ^{Left}, ahk_class SpotifyMainWindow
 DetectHiddenWindows, Off
 return

SpotifyVolup:
 DetectHiddenWindows, On
 ControlSend, ahk_parent, ^{up}, ahk_class SpotifyMainWindow
 DetectHiddenWindows, Off
 return

SpotifyVoldown:
 DetectHiddenWindows, On
 ControlSend, ahk_parent, ^{down}, ahk_class SpotifyMainWindow
 DetectHiddenWindows, Off
 return

SpotifyPlayPause:
 DetectHiddenWindows, On
 ControlSend, ahk_parent, {space}, ahk_class SpotifyMainWindow
 DetectHiddenWindows, Off
 return

SpotifyActivate:
 DetectHiddenWindows, On
 IfWinNotExist, ahk_class SpotifyMainWindow
 {
   Run %ProgramFiles%\Spotify\Spotify.exe  ;launch program
   return
 }
 IfWinNotActive ; restores window
 WinActivate
 Else
 WinKill ; minimizes windows
 DetectHiddenWindows, Off
 return

SpotifySong:
 Sleep, 500
 DetectHiddenWindows, On
 SetTitleMatchMode 2
 WinGetTitle, now_playing, ahk_class SpotifyMainWindow
 StringTrimLeft, playing, now_playing, 10
 DetectHiddenWindows, Off

 TrayTip, Spotify spiller:,  %playing%
 SetTimer, RemoveTrayTip, 4000
 return


; Windows Media Player codes
;-------------------------------------------------------------
WMPNext:
DetectHiddenWindows, On
PostMessage,   0x111, 32813, 0,, ahk_class WMPlayerApp
DetectHiddenWindows, Off
return

WMPPrevious:
 DetectHiddenWindows, On
 PostMessage,   0x111, 32812, 0,, ahk_class WMPlayerApp
 DetectHiddenWindows, Off
 return

WMPPlayPause:
 DetectHiddenWindows, On
 PostMessage,   0x111, 32808, 0,, ahk_class WMPlayerApp
 DetectHiddenWindows, Off
 return


; VLC Media Player codes
;-------------------------------------------------------------
VLCForwardTen:
 DetectHiddenWindows, On
 ControlSend, ahk_parent, !{Right}, ahk_class QWidget
 DetectHiddenWindows, Off
 return

VLCBackTen:
DetectHiddenWindows, On
ControlSend, ahk_parent, !{Left}, ahk_class QWidget
DetectHiddenWindows, Off
return

VLCPlayPause:
 DetectHiddenWindows, On
 ControlSend, ahk_parent, {space}, ahk_class QWidget
 DetectHiddenWindows, Off
 return

; GOM Player codes
;-------------------------------------------------------------
GOMForwardTen:
 DetectHiddenWindows, On
 ControlSend, ahk_parent, {Right}, ahk_class GomPlayer1.x
 DetectHiddenWindows, Off
 return

GOMBackTen:
 DetectHiddenWindows, On
 ControlSend, ahk_parent, {Left}, ahk_class GomPlayer1.x
 DetectHiddenWindows, Off
 return

GOMPlayPause:
 DetectHiddenWindows, On
 ControlSend, ahk_parent, {Space}, ahk_class GomPlayer1.x
 DetectHiddenWindows, Off
 return



; Nullify Traytip
;-------------------------------------------------------------
RemoveTrayTip:
 SetTimer, RemoveTrayTip, Off
 TrayTip
 return
;--------------------------------------------------------------------------
;--------------------------------------------------------------------------
;--------------------------------------------------------------------------


specter333
  • Members
  • 627 posts
  • Last active: Oct 07 2016 07:43 AM
  • Joined: 15 Jan 2007

Wow, that's a lot of AHK scripts. Don't have any ideas on top of my head though =)


I probably should have provided some quick start instructions, it's likely a confusing mess when you first look at it.

The only file you need to run is "EasyAuto.ahk" it runs in the background, no gui. Press control f12 to bring up the edit window. All the other scripts are modules, select a type of input module, a function type and a command and EasyAuto.ahk puts them all together for you.

This is an attempt to bring AHK to user who don't know how to write scripts, it likely won't be of any interest to people to people like you or others in this forum who know how to script. But I could do an input module of your script then anyone with a headset could assign the buttons to any function of any of the command modules.

  • Guests
  • Last active:
  • Joined: --
Hello folks,

I'm wondering how to program a script with auto hotkey and the logitech g35 headset.
What I've found is this so far:

<!-- m -->http://logitech.lith... ... d-p/424838<!-- m -->

1. In the G35 Headset Settings Software, set these as your keys in the dropdown lists:



G1 : windvd 9.0 : play/pause

G2: windvd 9.0 : rewind

G3: Windvd 9.0 : fast forward



2. Download the program Autohotkey @ <!-- w -->www.autohotkey.com<!-- w -->



3. Put this into a txt file, then save it as a .AHK file instead of .TXT



#InstallKeybdHook
SC121::msgbox this is one key
SC139::msgbox this is another
SC113::msgbox and this is another

4. Run i and now you see that you have customized each key to do a different action that you have defined in the AHK file.



5. Learn the very very simple basics of AHK so you can customize the keys to do whatever you want by going to <!-- w -->www.autohotkey.com<!-- w --> and asking on the forum, or joining their IRC channel @ irc.freenode.com #ahk

So what I need to figure out is this.

right and left arrow does fast forward and rewind for kmplayer. Play and pause is just the space bar.

I just want one button to do each but can't figure out how to program the macros do to that.

#InstallKeybdHook
SC121sendkey {left arrow}
SC139 sendkey {right arrow}
SC113 sendkey {space}

I have a basic idea but that's about it. If someone could figure the right way to set this up I'd really appreciate it. Thanks!

specter333
  • Members
  • 627 posts
  • Last active: Oct 07 2016 07:43 AM
  • Joined: 15 Jan 2007
You should be able to use the script in the first post almost as is except add the hotkeys for your media player and I don't believe you need the G35 software at all. I don't have one of these(yet) so I could be wrong.

If you don't understand how to add your media player to the script post again and I'll try to help.

Solar
  • Members
  • 345 posts
  • Last active: Jan 15 2012 08:11 PM
  • Joined: 03 May 2009
The G35 software is required. The problem with mapping these buttons to the software functions is that they only fire on the release of the button. So forget trying to emulate keys properly.

I was really looking forward to having a held down event on these buttons. What a shame. :cry:

specter333
  • Members
  • 627 posts
  • Last active: Oct 07 2016 07:43 AM
  • Joined: 15 Jan 2007
Are you saying there is no event for a button push, only a button release?

Use Other HID Info, to double check, there is a box to check to block events named 0 which is usually what a button release is seen as. Use the log on page two with and without the -up box checked and see if the results are any different. Other HID Info reads events that are sent from USB devices and is based on TheGood's AHKHID library.

http://www.autohotke...ght=hid devices

Edit, I don't mean to sound like a know it all but as I understand it the receiver for the headset is USB. That being the case I really don't think the logitech software is needed although it may be blocking the buttons from being seen by other software the same way AHK will keep a hotkey from being used for anything else.

If Other HID Info doesn't see your button presses try uninstalling the software. One thing I have learned about usb is there is nothing that can be sent that windows can't see natively, there is no need to have special drivers or software to see any usb device communication.

Solar
  • Members
  • 345 posts
  • Last active: Jan 15 2012 08:11 PM
  • Joined: 03 May 2009

Are you saying there is no event for a button push, only a button release?

The buttons produce both down and up events but only after releasing the button. This is because the G35 software has no reason to produce the down event while holding a button for actions such as controlling a media player.

On the bright side, there are actions where the down event is sent while the button is held down. For example, on the Ventrilo push-to-talk option. However, since this is handled at the driver level, it can't be seen by AHK. I've tested all of the actions that the G35 has in the latest driver, and out of all of the ones that send key events, none of them produce a down event when the actual button is pressed down; only quick down and up events after the button is released.

There may be an action added in the future that allows this capability. But considering that the G35 was replaced by the G930 this year, I wouldn't count on it.

specter333
  • Members
  • 627 posts
  • Last active: Oct 07 2016 07:43 AM
  • Joined: 15 Jan 2007
That's disappointing since I was going to get one of these headsets. It still may be worth checking with Other HID Info to make sure it is not the logitech software that's causing the strange button press actions.

Solar
  • Members
  • 345 posts
  • Last active: Jan 15 2012 08:11 PM
  • Joined: 03 May 2009

That's disappointing since I was going to get one of these headsets. It still may be worth checking with Other HID Info to make sure it is not the logitech software that's causing the strange button press actions.

I think we're talking about 2 different things. The key presses that the software sends are exactly how I described above. I'm simply saying that basic hotkeys are not going to have this ability because of the way that the G35 software sends the keys. This is not to say by any means that it's not possible to capture the buttons in another way. Like I said before, the buttons themselves seem standard but they are not expressed this way as key presses are sent by the software (nor should they be).

I'm going to look into AHKHID later and I'm sure I'll have some better news for you.

Solar
  • Members
  • 345 posts
  • Last active: Jan 15 2012 08:11 PM
  • Joined: 03 May 2009
Ok, I got some time to work with AHKHID and I can gladly say that we are fully in business. The following code works for all 3 buttons independently with down and up support on the latest driver (from 2010):

/*
G35 Button Control by Solar. Requires AHKHID: http://www.autohotkey.com/forum/viewtopic.php?t=41397
To have your g-buttons work when a specific window is active, add the window check to the prefix loop below.
Otherwise, define global labels as global_1, global_2, global_3. If an Up event is needed, define an
additional label as sPrefix_N_up; where N is the g-button number. e.g. global_1_up OR vlc_1_up
*/

;#Include AHKHID.ahk
SendMode, Input
Gui, +LastFound
hGui := WinExist()
OnMessage(0xff, "WM_INPUT")
AHKHID_Register(12, 1, hGui, RIDEV_INPUTSINK)
SetTimer, prefix, 500

;====================
; User config
;====================

prefix: ; prefix loop
	if (WinActive("ahk_class MozillaWindowClass")
		|| WinActive("ahk_class Chrome_WidgetWin_0")
		|| WinActive("ahk_class IEFrame")
		|| WinActive("ahk_class OperaWindowClass"))
        sPrefix := "browser"
	else if ((wid := WinActive("ahk_class QWidget")))
        sPrefix := "vlc", sHwnd := wid
	else if ((wid := WinActive("ahk_class WMPlayerApp")))
        sPrefix := "wmp", sHwnd := wid
    else sPrefix := "global"
    Sleep, 500
return


global_1:
	PostMessage, 0x5f5, 0x5, 1,, Ventrilo, Disc&onnect ; ptt on
return

global_1_up:
	PostMessage, 0x5f5, 0x5, 0,, Ventrilo, Disc&onnect ; ptt off
return

browser_1:
	Send, {Browser_Refresh}
return

browser_2:
	Send, {Browser_Back}
return

browser_3:
	Send, {Browser_Forward}
return

vlc_1:
	ControlSend,, {Space}, ahk_id %sHwnd% ; play/pause
return

vlc_2:
    Sleep, 500
    if (g2) {
        vlc_speed_2 := 1
        while (g2) {
            ControlSend,, {NumpadSub}, ahk_id %sHwnd% ; speed down
            if (A_Index = 4)
                break
            Sleep, 1500
        }
    }
return

vlc_2_up:
    if (vlc_speed_2) {
        ControlSend,, =, ahk_id %sHwnd% ; speed normal
        vlc_speed_2 := ""
    }
    else ControlSend,, p, ahk_id %sHwnd% ; previous
return

vlc_3:
    Sleep, 500
    if (g3) {
        vlc_speed_3 := 1
        while (g3) {
            ControlSend,, {NumpadAdd}, ahk_id %sHwnd% ; speed up
            if (A_Index = 4)
                break
            Sleep, 1500
        }
    }
return

vlc_3_up:
    if (vlc_speed_3) {
        ControlSend,, =, ahk_id %sHwnd% ; speed normal
        vlc_speed_3 := ""
    }
    else ControlSend,, n, ahk_id %sHwnd% ; previous
return

wmp_1:
	PostMessage, 0x111, 0x8028, 0,, ahk_id %sHwnd% ; play/pause
return

wmp_2:
	PostMessage, 0x111, 0x802a, 0,, ahk_id %sHwnd% ; previous
return

wmp_3:
	PostMessage, 0x111, 0x802b, 0,, ahk_id %sHwnd% ; next
return

;====================
; End user config
;====================

WM_INPUT(wParam, lParam) {
    Local devh, gKey, iData, sLabel
    devh := AHKHID_GetInputInfo(lParam, II_DEVHANDLE)
    if (devh != -1)
        && (AHKHID_GetDevInfo(devh, DI_DEVTYPE, 1) = RIM_TYPEHID)
        && (AHKHID_GetDevInfo(devh, DI_HID_VENDORID, 1) = 1133)
        && (AHKHID_GetDevInfo(devh, DI_HID_PRODUCTID, 1) = 2581)
        && (AHKHID_GetDevInfo(devh, DI_HID_VERSIONNUMBER, 1) = 771)
   {
        iData := AHKHID_GetInputData(lParam, uData)
        if (iData != -1 && NumGet(uData, 1, "uchar") = 16) { ; g-buttons
            if (NumGet(uData, 2, "uchar") = 17) { ; g1 down
                if (!g1)
                    gKey := 1
            } else if (g1) {
                if (IsLabel((sLabel := g1 . "_up")))
                    SetTimer, %sLabel%, -1
                g1 := ""
            }
            if (NumGet(uData, 3, "uchar") = 34) { ; g2 down
                if (!g2)
                    gKey := 2
            } else if (g2) {
                if (IsLabel((sLabel := g2 . "_up")))
                    SetTimer, %sLabel%, -1
                g2 := ""
            }
            if (NumGet(uData, 4, "uchar") = 51) { ; g3 down
                if (!g3)
                    gKey := 3
            } else if (g3) {
				if (IsLabel((sLabel := g3 . "_up")))
                    SetTimer, %sLabel%, -1
                g3 := ""
            }
            if (gKey && IsLabel((sLabel := sPrefix . "_" . gKey))) {
                SetTimer, %sLabel%, -1
                g%gKey% := sLabel
            }
        }
    }
}
Included functions: Ventrilo push to talk, VLC media player control, Windows Media Player control, Browser control (Firefox, Chrome, IE, Opera). These features are active window specific. global labels are fired when no predefined active window is found. Logitech G35 software must be running.

specter333
  • Members
  • 627 posts
  • Last active: Oct 07 2016 07:43 AM
  • Joined: 15 Jan 2007
That's good news, I thought the logitech software was a step that wasn't needed. You were right about talking about two different things, I was thinking of getting it to work with any method and not making myself clear.

Now that it's working here is another script that you might want to try. It is an automation script and it uses AHKHID as one of the input types along with many others. It sort of writes the script for you, just pick an input and pick a command and click Go. Since your using a headset the Voice Commands will come in handy too.
http://www.autohotke...pic.php?t=71046