Jump to content
The simFlight Network Forums

Joystick number

Recommended Posts


In your write up for adding joystick calls in FSUIPC Client DLL it states that joystick numbers can only be from (0-15). My problem is that when using a program SpadNext to send a virtual joystick button signal to FSUIPC the lowest number I can get is 64 and these joystick numbers can go to over 1000. FSUIPC has no trouble seeing these numbers but they are unusable in FSUIPC Client Dll. Is there any way to add a joystick number higher than 15. Below is an example of a joystick number over 1000.

excerpt from your manual

◆ AddJoystickButtonPress()

void AddJoystickButtonPress ( string  ID,
    byte  JoystickNumber,
    byte  ButtonNumber,
    StateChange  StateChangeToDetect 

Adds a joystick button press to be detected. Sink the ButtonPressed event to detect then the user pressed this button.

ID A string that you will use to identity and detect this button press.
JoystickNumber The number of the Joystick (0-15) to detect.
ButtonNumber The number of the Button to detect.

Which states to detect.





Thanks Ken




Link to comment
Share on other sites

I'll let Paul answer the questions about the facility in his DLL, but the example picture you show is from a WideClient-connected Joystick, not one local to the simulator PC.

Jpysticks 0-15 are the only ones representing true DirectInput joysticks which are scanned regularly on the Sim PC.

64-72 are "virtual buttons" only. These are really just offsets which are changed by FSUIPC applications.  You can monitor those using Offset reading facilities. For the correct offsets please check the Offsets list PDF in your FSUIPC Documernts folder.



Link to comment
Share on other sites

Further to Pete's reply, the DLL facility is just a wrapper over the joystick scanning facility in FSUIPC provided at offset 0x2910. As Pete says, this can only read real Joysticks 0-15.

I can see offset 0x3340 deals with Virtual joysticks but there is no wrapper in the DLL for this. You'll need to access this offset directly.

I recommend declaring an offset of type BitArray (4 bytes) for each Joystick. Then you can directly access each bit (button) as being 'true' or 'false' without needing to do bitwise masking.

Each joystick will be at increments of 4 from the base offset of 3340. e.g. 3340, 3344, 3348, 334C etc...


Link to comment
Share on other sites

Thanks a lot for your help. It only took a couple of minutes to enter the needed info into the form as I only need one button press

private Offset<Byte> Vjoystick = new Offset<Byte>(0x03340);

//27. Vjoystick
                    txtVjoystick.Text = this.Vjoystick.Value.ToString("D");


This works a treat


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.