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
;--------------------------------------------------------------------------
;--------------------------------------------------------------------------
;--------------------------------------------------------------------------