If I understood right, the first part of the code must remain the same, and at the end I can modify the mappings?
Also I tried with another version from the examples above, the one from DerRaphael, but that doesn't start, it gives some error at line 60 (the one with "static" near the end)
Can anyone help?
;PPJoy library ;by Ninja Bob ;January 2, 2010 hModule := 0 PPJ_Init() { hModule := DllCall("LoadLibrary", "str", "PPJoy.dll") Result := DllCall("PPJoy\Initialize") } PPJ_Term() { DllCall("PPJoy\Close") DllCall("FreeLibrary", "UInt", hModule) } PPJ_SetButton(button, state) { DllCall("PPJoy\SetButton", "char", button - 1, "char", state) DllCall("PPJoy\Update") } PPJ_SetAxis(axis, value) { DllCall("PPJoy\SetAxisPercent", "char", axis - 1, "char", value) DllCall("PPJoy\Update") } PPJ_GetButton(button) { Return DllCall("PPJoy\GetButton", "char", button - 1) } PPJ_GetAxis(axis) { Return DllCall("PPJoy\GetAxisPercent", "char", axis - 1) } PPJ_ResetButtons() { DllCall("PPJoy\ResetButtons") DllCall("PPJoy\Update") } PPJ_ResetAxes() { DllCall("PPJoy\ResetAxis") DllCall("PPJoy\Update") } OnExit, ExitHandler CoordMode, Mouse, Screen PPJ_Init() ; Grab the Joystick Loop { MouseGetPos, MouseX, MouseY ; Values must be within 0-100 range YVal := 100-Round(100*(A_ScreenHeight-MouseY)/A_ScreenHeight) XVal := 100-Round(100*(A_ScreenWidth-MouseX)/A_ScreenWidth) PPJ_SetAxis(2, Yval) ;Axis 2 is the Y axis PPJ_SetAxis(1, Xval) ;Axis 1 is the X axis } Return a:: PPJ_SetButton(1,1) ; Set Button 1 True Keywait, a ; Wait for button to be released PPJ_SetButton(1,0) ; Set Button 1 False Return ExitHandler: PPJ_Term() ; Release the Joystick ExitApp