Thanks for the fix suggestion. I'm trying to port.
BTW, in your test code, to test buttons...
You probably hit a limitation I did - AHK does not natively support coloured buttons or even changing text colour on button.
My solution was this:
1) Use a text box instead of a button.
2) Set the variable associated with each button to something like "Button1"
3) set the g-label to each button to the same subroutine eg ButtonClicked
4) Set ButtonClicked to pull the variable name and strip "Button" from the front, just leaving a number:
StringTrimLeft, var, A_GuiControl, 6
This should save you needing 32 subroutines in your test app...
Started to get Axlar's library working with UJR.
I modded VJoy_init() in VJoy_lib.ahk thus:
So if you make a Lib folder in the same folder as the script, and in there x86 and x64 folders with the relevant DLLs in each, it should automatically load the correct DLL.
I won't do any more than displaying an error to people who missed to deploy the DLL.
I think it is sufficient if people have installed different bit-version of VJoy and AHK_L, script will be guide to use the appropriate DLL from SDK.
Reason 1, Because I hate redistributing DLLs or specify how to deploy DLLs that was made by other developer.
Reason 2, I want to simplify the deploy plan in readme by omitting installing DLL in SDK.
(Referencing 112244's case, I think the VJoy SDK unnecessary because client has 64-bit dll that is deployed in VJoy install destination directory already.)
case1) client OS is 64-bit, installed VJoy 64-bit && using AHK_L 64-bit
= use installed 64-bit dll(SDK unnecessary. client can omit to download SDK.)
case2) client OS is 32-bit, installed VJoy 32-bit && using AHK_L 32-bit
= use installed 32-bit dll(SDK unnecessary. client can omit to download SDK.)
case3) client OS is 64-bit, installed VJoy 64-bit && using AHK_L 32-bit
= use 32-bit dll from SDK, displaying an error message.
Things are a bit more complicated though:
How come the values to set axis are between 0 and 32767, whereas AHK's GetKeyState presents 0 to 100?
Yeah, I know I can easily mult by 327.67 but it just seems excessive. I guess it is just because of the word size of the register that holds joystick values?
In the sample(VJoy_Test.ahk), script doesn't hold axis values.
O.K, I plan to hold values belong to each Device defined by class.