Code:
; AutoHotkey Version: 1.2362501456
; Language: English
; Platform: Win9x/NT
; Author: ST
;
; Script Function: Transforms XBDRC input into computer control
;some helpful hints if you don't read the AutoHotKey quickstart
;'^' = ctrl
;'#' = window key
;'!' = alt
;';' = comment out a line of code
;**************************
;Mouse emulation
;uses both numpadRight and Numpad6 for use when NumLock is on or off
;**************************
^#NumpadRight::MouseMove, 50, 0, 0, R
^#Numpad6::MouseMove, 50, 0, 0, R
^#NumpadLeft::MouseMove, -50, 0, 0, R
^#Numpad4::MouseMove, -50, 0, 0, R
^#NumpadUp::MouseMove, 0, -50, 0, R
^#Numpad8::MouseMove, 0, -50, 0, R
^#NumpadDown::MouseMove, 0, 50, 0, R
^#Numpad2::MouseMove, 0, 50, 0, R
^#Enter::MouseClick,left
;****************************
;All Function Buttons Begin Here.
;****************************
^!0:: ;Open/Close Toggle (Display Button)
IfWinExist Player Window ;check to see if winamp is open
{
IfWinNotActive, Player Window, , WinActivate, Player Window, ;highlight winamp
WinWaitActive, Player Window,
Send, {ALTDOWN}{F4}{ALTUP} ;send shortcut to close
}
else ;if not open
{
Run %A_ProgramFiles%\Winamp\Winamp.exe ;Change this line to reflect the program that you want to run
}
Exit
^!X:: ;Play. (Play Button)
IfWinExist Player Window ;check to see if winamp is open
{
IfWinNotActive, Player Window, , WinActivate, Player Window, ;highlight winamp
WinWaitActive, Player Window,
Send, x ;send shortcut to play
Send, {ALTDOWN}{TAB}{ALTUP} ;send alt+tab
}
else ;if not open
{
Run %A_ProgramFiles%\Winamp\Winamp.exe ;Change this line to reflect the program that you want to run
WinWait, Player Window, ;wait until winamp is up
IfWinNotActive, Player Window, , WinActivate, Player Window, ;make sure that winamp is selected
WinWaitActive, Player Window,
Send, x ;hit the play button (shortcut x)
Send, {ALTDOWN}{TAB}{ALTUP} ;send alt+tab
}
Exit
^!T:: ;Selects Winamp. (Title Button)
IfWinExist Player Window ;check to see if winamp is open
{
IfWinNotActive, Player Window, , WinActivate, Player Window, ;highlight winamp
}
else ;if not open
{
Run %A_ProgramFiles%\Winamp\Winamp.exe ;Change this line to reflect the program that you want to run
WinWait, Player Window, ;wait until winamp is up
IfWinNotActive, Player Window, , WinActivate, Player Window, ;make sure that winamp is selected
WinWaitActive, Player Window,
}
Exit
^!C:: ;Pause Toggle. (Pause Button)
IfWinExist Player Window ;check to see if winamp is open
{
IfWinNotActive, Player Window, , WinActivate, Player Window, ;highlight winamp
WinWaitActive, Player Window,
Send, c ;send shortcut to pause
WinWait, Player Window,
Send, {ALTDOWN}{TAB}{ALTUP} ;send alt+tab
}
else ;if not open
{
}
Exit
^!V:: ;Stop. (Stop Button)
IfWinExist Player Window ;check to see if winamp is open
{
IfWinNotActive, Player Window, , WinActivate, Player Window, ;highlight winamp
WinWaitActive, Player Window,
Send, v ;send shortcut to pause
WinWait, Player Window,
Send, {ALTDOWN}{TAB}{ALTUP} ;send alt+tab
}
else ;if not open
{
}
Exit
^!L:: ;Skip Forward 5 Seconds. (Forward Button)
IfWinExist Player Window ;check to see if winamp is open
{
IfWinNotActive, Player Window, , WinActivate, Player Window, ;highlight winamp
WinWaitActive, Player Window,
Send, {LEFT} ;send shortcut to pause
WinWait, Player Window,
Send, {ALTDOWN}{TAB}{ALTUP} ;send alt+tab
}
else ;if not open
{
}
Exit
^!R:: ;Skip Back 5 Seconds. (Reverse Button)
IfWinExist Player Window ;check to see if winamp is open
{
IfWinNotActive, Player Window, , WinActivate, Player Window, ;highlight winamp
WinWaitActive, Player Window,
Send, {RIGHT} ;send shortcut to pause
WinWait, Player Window,
Send, {ALTDOWN}{TAB}{ALTUP} ;send alt+tab
}
else ;if not open
{
}
Exit
^!Z:: ;Skip Back Song. (Skip-)
IfWinExist Player Window ;check to see if winamp is open
{
IfWinNotActive, Player Window, , WinActivate, Player Window, ;highlight winamp
WinWaitActive, Player Window,
Send, z ;send shortcut to pause
WinWait, Player Window,
Send, {ALTDOWN}{TAB}{ALTUP} ;send alt+tab
}
else ;if not open
{
}
Exit
^!B:: ;Skip Forward Song. (Skip+)
IfWinExist Player Window ;check to see if winamp is open
{
IfWinNotActive, Player Window, , WinActivate, Player Window, ;highlight winamp
WinWaitActive, Player Window,
Send, b ;send shortcut to pause
WinWait, Player Window,
Send, {ALTDOWN}{TAB}{ALTUP} ;send alt+tab
}
else ;if not open
{
}
Exit