Can't use GetFSUIPCInt

Report application bugs here
Post Reply
funky
Posts: 2
Joined: 11 Nov 2011, 19:00

Can't use GetFSUIPCInt

Post by funky » 11 Nov 2011, 19:07

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?

admin
Site Admin
Posts: 735
Joined: 01 Nov 2010, 13:00
Location: Prague, Czech republic
Contact:

Re: Can't use GetFSUIPCInt

Post by admin » 13 Nov 2011, 09:48

You're right, the example at scripting page is wrong.
Try using brackets:

Code: Select all

Dim State
Set State = HIDMacros.GetFSUIPCInt(&H3340, 1)
Petr Medek
LUAmacros author

funky
Posts: 2
Joined: 11 Nov 2011, 19:00

Re: Can't use GetFSUIPCInt

Post by funky » 13 Nov 2011, 10:38

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

Post Reply