Ken Ennis Posted July 10, 2019 Report Posted July 10, 2019 Hi 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 ) inline Adds a joystick button press to be detected. Sink the ButtonPressed event to detect then the user pressed this button. Parameters 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. StateChangeToDetect Which states to detect. Thanks Ken
Pete Dowson Posted July 10, 2019 Report Posted July 10, 2019 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. Pete
Paul Henty Posted July 10, 2019 Report Posted July 10, 2019 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... Paul
Ken Ennis Posted July 11, 2019 Author Report Posted July 11, 2019 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 Ken
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now