Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hi

Is it possible to program a button press on a joystick to send a virtual button (button 9) at offset H3340. I have tried sending to x3340 with parameter x9 but it does not seem to work.

I am wanting to do this so I can detect the joystick button being pressed in a program of my own over a network with WideFS using VB.net and FSUIPCDotNetClient1.3, FSUIPC 3.81, Widefs (from log) version 6.763.

My program can see virtual button 9 being pressed using the buttons in widefs over the network so that part seems to be working ok just having difficulty getting FSUIPC to send if.

Hope you can help or point me in the right direction should I have missed something.

Dave Lidge

Posted
Hi

Is it possible to program a button press on a joystick to send a virtual button (button 9) at offset H3340. I have tried sending to x3340 with parameter x9 but it does not seem to work.

Because the value "9" is binary 1001 which is TWO bits -- bit 0 and bit 3, so switching both those buttons on.

Button 9 is bit 2^9, or value 512 -- if you write 2 bytes to 3340. Or you could view it as bit 1 (9-1) in the next byte (3341) and write 2^1 = 2 to 3341 instead.

Bear in mind that this only switches the button ON. To switch it off you'd need to write 0 to that bit. Also bear in mind that by writing a byte you affect 8 buttons (8 bits in a byte), by writing a word you affect 16 buttons. You should really read the byte, OR this bit in (to switch on), or AND the bit out (to switch it off) then write it back.

If you are programming a button via FSUIPC options then just assign it to Offset Byte Setbits with offset 3341 and parameter 2 to set the button ON, and Offset Byte Clearbits with the same offset and parameters to switch it OFF. If you want to toggle it on and off alternately with one button you could use Offset Byte Togglebits.

Regards

Pete

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.