Jump to content
The simFlight Network Forums

a switch to trigger FSUIPC KeySends for WideClient


Recommended Posts

Greetings,

We’re try’n to configure a MIP rotary switch (via InterfaceIT and WideFS) – so turning it will chose between different window displays of programs ( Squawkbox, FSC, ServInfo, ) that are running on a extra computer with wideclient.

Our idea to get the switch to selectively reopen different program windows ….. is to make appropriate InterfaceIT actions for the switch, to generate different FSUIPC KeySends, that WideClient would then use to send keypresses to the apt program to reopen its display window. Crystal clear eh?

We made code to do this, but it isn’t work’n yet for reasons unknown. Here’s what we did:

Our thought is to use WideClient to send the Alt + spacebar + Enter keystrokes to a corresponding program, which should trigger restoring the display of that program.

In the WideClient ini, we added code to start the different programs, plus some different KeySends code WideClient will use to generate the Alt + spacebar + Enter keystrokes to the corresponding programs. i.e. :

Run(#)=D:\Program Files\SquawkBox3\squawkbox.exe

KeySend1= 32,12,Run# ; to send alt+spacebar keypress to SB

KeySend2=13,8,Run# ; to send Enter-key keypress to SB

In InterfaceIT we added 2 input actions to generate 2 FSUIPC KeySends, when the rotary is moved into that switch position.

Action 1 - Down / On – FSUIPC, byte offset=330F, data=1

Action 2 - Down / On – FSUIPC, byte offset=330F, data=2

In our testing we couldn’t seem to be getting any keypresses being done at all to the programs

Please give any ideas you might have to help, or tell us where you think we’re go’n wrong.

Thanks

Mike Day

Link to comment
Share on other sites

... to generate different FSUIPC KeySends, that WideClient would then use to send keypresses to the apt program to reopen its display window. Crystal clear eh?

We made code to do this, but it isn’t work’n yet for reasons unknown.

Hmm. without writing a program to ask Windows to restore the focus to the program concerned, and maybe also "bringing it to the front" (set foreground window), I don't think anything WideClient can send to it will do.

Our thought is to use WideClient to send the Alt + spacebar + Enter keystrokes to a corresponding program, which should trigger restoring the display of that program.

Why? What do the program do with ALT+Space+Enter? That's a new one on me. I didn't think windows supported anything like that, with two normal (non-shift) keys.

In the WideClient ini, we added code to start the different programs, plus some different KeySends code WideClient will use to generate the Alt + spacebar + Enter keystrokes to the corresponding programs. i.e. :

Run(#)=D:\Program Files\SquawkBox3\squawkbox.exe

KeySend1= 32,12,Run# ; to send alt+spacebar keypress to SB

KeySend2=13,8,Run# ; to send Enter-key keypress to SB

Well, those wouldn't do ALT+Space+Enter, but ALT+Space, then Enter on its own. Is that what you wanted? If you want them altogether you'd need to hold the first two whilst pressing the Enter then release the first two.

In our testing we couldn’t seem to be getting any keypresses being done at all to the programs

How would you know? What happens when they are sent ALT+Space, or Enter, on its own? Are these documented functions in their lists of keyboard commands?

Please give any ideas you might have to help, or tell us where you think we’re go’n wrong.

A program which doesn't have the focus and isn't in the foreground cannot easily make itself so. It is the User's prerogative what windows are active and seen. Programs CAN be cleverly programmed to get into the limelight on requests other than by using the real keyboard or mouse to activate them, but i suspect the ones you are dealing with never thought of adding such functions.

Maybe you are thinking of trying to get Windows to activate the programs. But sending keypresses to be processed by the program's own message processing doesn't accomplish that. In fact i really don't know how you'd accomplish it without cooperation from the programs themselves, or writing a program to try to force the change.

That said, I did manage to get a Lua facility working ( ipc.keypressplus) which is able to switch focus to FS from another program, and, more importantly in this context, from FS back to the original owner. It's a messy business and I'm not even sure it works in all circumstances, but I suppose it could be tried. It would have to be an additional facility in WideClient, a "special" like the PTTs.

Regards

Pete

Link to comment
Share on other sites

That said, I did manage to get a Lua facility working ( ipc.keypressplus) which is able to switch focus to FS from another program, and, more importantly in this context, from FS back to the original owner. It's a messy business and I'm not even sure it works in all circumstances, but I suppose it could be tried. It would have to be an additional facility in WideClient, a "special" like the PTTs.

I've thought further about this and decided it would be a useful facility to add, so I will try to make it work. If I do add it you'd still use KeySend, but the parameters in the WideClient.INI file would be something like:

KeySend1= Focus,Run# ; to change focus to SB

I'll post again when I have something for you to try, assuming I can make it work.

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.