Page 1 of 1

Can't use GetFSUIPCInt

Posted: 11 Nov 2011, 19:07
by funky
Hi Petr,
your utility is a real breakthrough in multiple keyboard handling. However when going to scripting I'm having trouble, but I must say, that I have only little experience in scripting. I could succesfully execute this

HIDMacros.SetFSUIPCInt &H3340, 1, 1

but I'm unable to make this work:

Dim State
Set State = HIDMacros.GetFSUIPCInt &H3340, 1


I always get an error "End of Statement expected". It seems that the compiler does not recognize ...GetFSUIPCInt

What am I doing wrong?

Re: Can't use GetFSUIPCInt

Posted: 13 Nov 2011, 09:48
by admin
You're right, the example at scripting page is wrong.
Try using brackets:

Code: Select all

Dim State
Set State = HIDMacros.GetFSUIPCInt(&H3340, 1)

Re: Can't use GetFSUIPCInt

Posted: 13 Nov 2011, 10:38
by funky
Hi Petr,

thanks for the hint, with a better knowledge of VBScript I could have guessed it. However there is still something wrong as I found out that the "Set" must not appear. So at then it's this:

Code: Select all

Dim State
State = CByte(HIDMacros.GetFSUIPCInt(&H3341, 1))
HIDMacros.SetFSUIPCInt &H3341, 1, State OR 4
HIDMacros.sleep(20)
HIDMacros.SetFSUIPCInt &H3341, 1, State
This triggers one of FSUIPC virtual joystick buttons and returns it to its previous state after 20 ms. It allows me using FSUIPC to map keys of an extra keyboard to certain A/C functions. It could have been done by HIDMacros directly but this way I can automate different mappings for different A/C by using FSUIPC's profile function. The CByte typecast is required to allow the binary OR function.

best regards,
Peter