Previously I just used this script for "Activate Next Table" and "Activate Bottom Table", but I had a huge RSI prob today and decided to try to get this script going with a gamepad. My right wrist is seriously useless, so I really need help. I understand that the script doesn't currently recognize the D-Pad up/down/left/right directions, so I'm trying to remap them to send arrow keys like so... (stolen from AHK Site)
http://www.autohotkey.com/docs/misc/RemapJoystick.htm
Code:
#Persistent ; Keep this script running until the user explicitly exits it.
SetTimer, WatchPOV, 5
return
WatchPOV:
GetKeyState, POV, JoyPOV ; Get position of the POV control.
KeyToHoldDownPrev = %KeyToHoldDown% ; Prev now holds the key that was down before (if any).
; Some joysticks might have a smooth/continous POV rather than one in fixed increments.
; To support them all, use a range:
if POV < 0 ; No angle to report
KeyToHoldDown =
else if POV > 31500 ; 315 to 360 degrees: Forward
KeyToHoldDown = Up
else if POV between 0 and 4500 ; 0 to 45 degrees: Forward
KeyToHoldDown = Up
else if POV between 4501 and 13500 ; 45 to 135 degrees: Right
KeyToHoldDown = Right
else if POV between 13501 and 22500 ; 135 to 225 degrees: Down
KeyToHoldDown = Down
else ; 225 to 315 degrees: Left
KeyToHoldDown = Left
if KeyToHoldDown = %KeyToHoldDownPrev% ; The correct key is already down (or no key is needed).
return ; Do nothing.
; Otherwise, release the previous key and press down the new key:
SetKeyDelay -1 ; Avoid delays between keystrokes.
traytip,,%keyToHoldDown%,1 ; Added by Cheese to show D-Pad keypress
if KeyToHoldDownPrev ; There is a previous key to release.
Send, {%KeyToHoldDownPrev% up} ; Release it.
if KeyToHoldDown ; There is a key to press down.
Send, {%KeyToHoldDown% down} ; Press it down.
return
This uses the send command to monitor the D-Pad of a joystick (JOYPOV in AHK) and then sends the appropriate arrow key using the "Send" command. Wrist is hurting so bad that it hurts for me to click around searching for an answer. I forget why the "send" command won't trigger "arrow keys" (from the remapped D-Pad). Can someone help me with this? Do I need to do a keyboardhook or something to trick XP into thinking that I *really* am pressing the arrow keys?
Also, can anyone else share their gamepad settings, or give me a little more info as to their mouse free setup? I have StarsAssistant (v.88) running to highlight the active table, and have enabled the control-clicking option to send a click/show mouse pointer when the active table has moved, but moving the table with the arrow keys (what I'd like to do with the D-Pad) doesn't trigger StarsAssistant's highlighter to move.
FWIW, when I play with the mouse I typically stack between 16-30 tables in the 1st quadrant of my middle monitor, and have extra mouse buttons XButton1 and XButton2 bound to Activate the Next Table (though I also have stars set to auto activate urgent table). I've written a script that when I CTRL-Click a table, it moves it to the first vacant quadrant (I'll post this some time) so that I can see showdowns or focus on the tourney bubble, etc. Because of this, I'd like the gamepad to be able to both cycle thru stacked or all tables (easy, just bind Activate Next Table to Joy12 or something) as well as use the d-pad to move among them (like using the code I posted to remap the joystick to arrow keys, only having it work, and also having this highligh the current table so that I know which one is active.)