;Modified from Joystick Test at
http://www.autohotkey.com/docs/scripts/JoystickTest.htm
; JoystickNumber = 0 causes the joystick number to be auto-detected:
; If you want to unconditionally specificy a joystick number, change
; the following value to the number of the joystick (1-32).
JoystickNumber = 0
; Auto-detect the joystick number if called for:
if JoystickNumber <= 0
{
Loop 32 ; Query each joystick number to find out which ones exist.
{
GetKeyState, JoyName, %A_Index%JoyName
if JoyName <>
{
JoystickNumber = %A_Index%
break
}
}
if JoystickNumber <= 0
{
MsgBox The system does not appear to have any joysticks.
ExitApp
}
}
#SingleInstance
GetKeyState, joy_buttons, %JoystickNumber%JoyButtons
if joy_buttons <= 6
MsgBox Roland thinks your joypad sucks, and will sell you a better one for 30 bucks.
;Gooey
Gui, Add, Text, x76 y7 w80 h20,Play
Gui, Add, Text, x166 y7 w80 h20,Sit
Gui, Add, Text, x256 y7 w80 h20,Lobby
Gui, Add, Text, x346 y7 w80 h20,Dialogue
Loop, %joy_buttons%
{
y := (30*a_index)+7
Gui, Add, Text, x6 y%y% w60 h20 vGUI_buttonlabel%a_index%, Button%a_index%
Gui, Add, DropDownList, x76 y%y% w80 vplay_Command%a_index%, none||Fold|Call|Raise|Don't Post|Wait to Post|Post
Gui, Add, DropDownList, x166 y%y% w80 vsit_Command%a_index%, none||Take Seat|Cancel Table|Waitlist Bug
Gui, Add, DropDownList, x256 y%y% w80 vlobby_Command%a_index%, none||Wait for Focused table|Wait for next table
Gui, Add, DropDownList, x346 y%y% w80 vdialogue_Command%a_index%, none||Accept Table|Deny Table
}
Gui, Show, autosize, Joystick Config
SetTimer, ButtonConfig, 100
Return
;;End autoexec;;
;Check all the buttons and highlight appropriate rows.
ButtonConfig:
;reset variables
buttons_down =
;Go through all the buttons
Loop, %joy_buttons%
{
;if down
GetKeyState, joy%a_index%, %JoystickNumber%joy%a_index%
if joy%a_index% = D
{
;Highlight the textbox
Gui, Font, cRed Bold ;Choose the font
GuiControl, Font, GUI_buttonlabel%a_index% ;Apply the font
}
;if up
else
{
;Unhighlight the textbox
Gui, Font, cBlack norm;Choose the font
GuiControl, Font, GUI_buttonlabel%a_index% ;Apply the font
}
}
return