Hi Constell,
My post may have been a little misleading, it is not for remapping the joy buttons, but rather more for a keyboard control layout in which the trigger buttons become modifier keys for the other joy buttons. Where in my example if you press the A button on the controller with no triggers held, it will send key one. Then if holding the left trigger it will send key five, and key nine for right and seven for both triggers. The difference with my example from the one Lexikos posted, is mine is not actually mapping the triggers to a button, but using them as sort of shift keys for the rest of the buttons giving you four variations for each button.
Edit: I also cleaned a syntax error in my first post.
Matze, what you want to do to get this script to work is download the xinput.ahk AND the JSON.ahk, then put them in the same directory with the script that YOU write. At the top of your script put:
Code:
#include xinput.ahk
#include JSON.ahk
And what you should know is, these scripts do not remap any of the buttons/axis/triggers but simply give you the ability to access them as they were intended to. You can get the button information from the controller with these scripts as well, but they are represented as an accumulating value, which is why using the remap joystick script is a good idea for the actual buttons. You should look over the remapping joystick and joystick as a mouse scripts for the best way to remap the actual buttons. The xinput is best used for the axis controls like the left and right joysticks, and the triggers, and also gives you access to the vibration feature in the controller as demonstrated in Lexikos first post. To give you some idea of how it goes, try this in your script that is in the same folder as xinput and JSON:
Code:
#include xinput.ahk
#include JSON.ahk
XInput_Init()
Loop {
Loop, 4 {
if XInput_GetState(A_Index-1, State)=0 {
LT := json(State,"bLeftTrigger")
RT := json(State,"bRightTrigger")
BT := json(State,"wButtons")
XInput_SetState(A_Index-1, LT*257, RT*257)
}
}
Tooltip LTrigger-%LT% RTrigger-%RT%`n Button Info-%BT%
Sleep, 100
}
This is a small script that generates a tooltip to display information about the buttons and triggers being pressed, it also makes the respective motors vibrate when the trigger is pressed.
Lexikos, I have been looking over the GetKeystroke functions on MSDN and will try to follow your examples to see if I can get those funtions to work. I was also wondering if you have yet to see any info on the chatpad ever being supported at all in windows?
Thanks
