Jump to content
The simFlight Network Forums

Recommended Posts

Posted

I have build a module for FS that works perfectly. Now I would like to create a module that allows me to pushback the plane.

Does any one know, which FS variables should I look to? or if any one could give a little pice of code or example, I will really apreciate that.

I´m using VC++

Regards

Thomas

Posted
I have build a module for FS that works perfectly. Now I would like to create a module that allows me to pushback the plane.

Does any one know, which FS variables should I look to? or if any one could give a little pice of code or example, I will really apreciate that.

There are FS controls to do that -- the one normally assigned to Shift+P, for start/stop, optionally followed by keyboard keys 1 or 2 to select direction. From a module or gauge just send appropriate Key Events.

Pete

Posted
I have build a module for FS that works perfectly. Now I would like to create a module that allows me to pushback the plane.

Does any one know, which FS variables should I look to? or if any one could give a little pice of code or example, I will really apreciate that.

There are FS controls to do that -- the one normally assigned to Shift+P, for start/stop, optionally followed by keyboard keys 1 or 2 to select direction. From a module or gauge just send appropriate Key Events.

Pete

You are right, I havet thought about that.

Now I having an other problem with the

"GAUGESLINKAGE Linkage"

The problem is that if I want my module to be compatible with FS2002, I have to tell de GAUGESLINKAGE which version should look at, and for FS2004 is the same, but how could I make my module compatible with both FS?

Do you have a function o something that could help me out?

Thanks a lot.

Best Regards

Thomas.

Posted

The problem is that if I want my module to be compatible with FS2002, I have to tell de GAUGESLINKAGE which version should look at, and for FS2004 is the same, but how could I make my module compatible with both FS?

Do you have a function o something that could help me out?

I just search the Window title for "98", "2000" or "2002", else it's 2004. I think I will make it more foolproof in future though by reading the main EXE module's Version information. ;-)

Pete

Posted

The problem is that if I want my module to be compatible with FS2002, I have to tell de GAUGESLINKAGE which version should look at, and for FS2004 is the same, but how could I make my module compatible with both FS?

Do you have a function o something that could help me out?

I just search the Window title for "98", "2000" or "2002", else it's 2004. I think I will make it more foolproof in future though by reading the main EXE module's Version information. ;-)

Pete

Thanks, I'll try that.

And sorry a boder you again, but now, I´m trying to use the following fucntion "SetKeyboardState" to send keys to flight sim, but I cant compile the file, I keep geting error like:

"cannot convert parameter 1 from 'const int' to 'unsigned char *'"

Is there any other way to send keys to FS, with out using FSUIPC, (no offence, :wink: )

Best Regards

Thomás

Posted

And sorry a boder you again, but now, I´m trying to use the following fucntion "SetKeyboardState" to send keys to flight sim, but I cant compile the file, I keep geting error like:

"cannot convert parameter 1 from 'const int' to 'unsigned char *'"

Seems that the answer is clearly stated in the error message -- you need to provide a pointer to a character or an array of characters and you are not, you are providing a constant. Really you should be able to read that yourself.

Is there any other way to send keys to FS, with out using FSUIPC

Yes, send the correct sequence of messages to FS's Window, of course. Look up "PostMessage", "WM_KEYDOWN", "WM_KEYUP", "WM_CHAR", and "SendInput".

Please see if you can find some books on Windows programming. They will be more appropriate than trying to learn here. I am trying to support my programs and develop them too, as well as maybe fly just now and then if possible. I hope you understand that I really cannot carry on an elementary Windows programming course here -- I really am not a good teacher, I have insufficient patience and understanding of learner's needs. I'm very sorry.

Regards,

Pete

Posted

And sorry a boder you again, but now, I´m trying to use the following fucntion "SetKeyboardState" to send keys to flight sim, but I cant compile the file, I keep geting error like:

"cannot convert parameter 1 from 'const int' to 'unsigned char *'"

Seems that the answer is clearly stated in the error message -- you need to provide a pointer to a character or an array of characters and you are not, you are providing a constant. Really you should be able to read that yourself.

Is there any other way to send keys to FS, with out using FSUIPC

Yes, send the correct sequence of messages to FS's Window, of course. Look up "PostMessage", "WM_KEYDOWN", "WM_KEYUP", "WM_CHAR", and "SendInput".

Please see if you can find some books on Windows programming. They will be more appropriate than trying to learn here. I am trying to support my programs and develop them too, as well as maybe fly just now and then if possible. I hope you understand that I really cannot carry on an elementary Windows programming course here -- I really am not a good teacher, I have insufficient patience and understanding of learner's needs. I'm very sorry.

Regards,

Pete

Don´t worry, I wont use this forum as a programing school.

Thanks a lot again for your help.

Regards

Thomas

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.