Jump to content
The simFlight Network Forums

conditional key programing


Recommended Posts

Dear forum members!

I want to use one key (for example the L-key) for two actions: a standard fs assignment (i.e. light switch) and an assignment of a third-party addon.

To achive this I tried to use a joystick button as a switch between two positions (x=P0,0,Cx510066C0,x00010001).

If the value is zero the L-key shall act like the standard light toggle (x=B66C0=0 76,8,65574,0).

When B66C0=1 the L-key shall work according to the assignment of the external program.

Unfortunately this idea doesn't meet my requirement. The assignment of the third-party program obtains higher priority than the fs assignment, the program doesn't recognize the toggle switch and therefore pushing the L-key always leads to executing the command of the external program. I thought of assigning another key for the instruction "toggle light" (24,8 for example) but I worry that this is a dead end.

Does a solution exist where I can say: when pushing the key "76,8" and the bit is set accordingly process the content of the key "24,8" - else do the external function? Or is there another possibility I haven't thought about?

The goal is to use only 1 key conditionally for a standard assignment and an assignment of an external program.

Thanks in advance

a simFlyer looking for help

Link to comment
Share on other sites

To achive this I tried to use a joystick button as a switch between two positions (x=P0,0,Cx510066C0,x00010001).

It would have been easier to use the Flag facilities provided.

Unfortunately this idea doesn't meet my requirement. The assignment of the third-party program obtains higher priority than the fs assignment, the program doesn't recognize the toggle switch and therefore pushing the L-key always leads to executing the command of the external program.

This is because in order to get a key press whilst not having the keyboard focus the external program has to use the Windows "hot key" facility, which steals the key press away from FS -- so neither FS nor FSUIPC ever sees it. You cannot use the same keypresses.

You say you tried to use a joystick button as a switch. If you have a spare button why not use that to operate the light, via the FS control for it (not a keypress).

I thought of assigning another key for the instruction "toggle light" (24,8 for example) but I worry that this is a dead end.

Why? With FSUIPC keypress assignments to can assign all sorts of key combinations which won't interfere with anything else. But you don't program them to send key presses, but FS controls.

Does a solution exist where I can say: when pushing the key "76,8" and the bit is set accordingly process the content of the key "24,8" - else do the external function?

No, not if the external program is grabbing the keypresses using Windows hot key facilities. Nothing else can see such keys.

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.