Jump to content
The simFlight Network Forums

Hot Joystick Buttons


Recommended Posts

I've read part of the FSUIPC for programmers documentation and had a question I was hoping someone here could answer.

In the Hot Key's for Applications, in byte 2 (bit 1), there is a flag that keeps a hot key from being passed onto Flight Sim. This traps the key and keeps it from being used in FS? Or does it work in some other way?

Also, my main question, is there the same trapping support with the Hot Joystick Buttons?

I have used FSInterrogate to monitor joystick buttons (specifically the hat switch) and found that it works to the extent that it will tell if a button is pushed, released, or both.

Thanks,

-cainan

Link to comment
Share on other sites

In the Hot Key's for Applications, in byte 2 (bit 1), there is a flag that keeps a hot key from being passed onto Flight Sim. This traps the key and keeps it from being used in FS? Or does it work in some other way?

No, you are correct, that is the way it works.

Also, my main question, is there the same trapping support with the Hot Joystick Buttons?

No, sorry, I can't do that. with keys it is easy, as I simply have ot intercept the Windows messages which arrive for key presses in any case. The non-pass option simply means that I discard the message after processing instead of passing them on as I would with 99% of other messages.

With joysticks, I have my routines reading the buttons, and FS has its own. This doesn't use any Windows messages I can intercept, and I really wouldn't want to go messing deep in FS's directInput code to find out how to remove buttons there. It might have been feasible back in FS2000 days and before when FS used the same Windows interface as me (the Windows Joy API), but since FS2002 it uses directInput, which gets pretty complex real fast.

Regards

Pete

Link to comment
Share on other sites

Thanks for you answer, Pete!!

No, sorry, I can't do that. with keys it is easy, as I simply have ot intercept the Windows messages which arrive for key presses in any case.

This makes sense. I didn't realize that the joystick wouldn't be creating messages whereas key presses will.

directInput, which gets pretty complex real fast.

Does it ever! :lol:

Here's a follow up question.

In your programming section in FSUIPC for buttons + switches, you can program a joystick button to Pan Right, Down, Up, etc. Is it possible to do a fsuipc_write to an offset like 0x3126 (view control) and make FS pan in whatever direction I want (in virtual cockpit)? Or is there any other way to send the Pan commands?

What I want to do is have my application work like a aircraft TV or Infared sensor. Using the hatswitch I could move the virtual cockpit around acting as the sensor, but I don't want to be able to move it 360 degrees either up or down. This would not be realistic at all. If I could find a way to get the joystick under my control I could put in some "mechanical stops" and keep the "sensor" from being upside down.

Thanks again!

-cainan

Link to comment
Share on other sites

In your programming section in FSUIPC for buttons + switches, you can program a joystick button to Pan Right, Down, Up, etc. Is it possible to do a fsuipc_write to an offset like 0x3126 (view control) and make FS pan in whatever direction I want (in virtual cockpit)? Or is there any other way to send the Pan commands?

Use offset 3110. You can send any FS commands you like.

Regards,

Pete

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.