Jump to content
The simFlight Network Forums
abz

Mouse macros for a self centering switch

Recommended Posts

Pete: Here goes. After I opened my flight I opened FSUIPC. I checked off logging for buttons and keys. After that I went to Create Macro and named it APUtest. When I clicked OK, it went back to the main FSUIPC window but I had this small square window pop up in the center of the FSUIPC window that said:

"Saving and/or reloading FSUIPC settings. Please wait." Unfortunately, this message NEVER disappeared --- until I closed FS. What is this?

I went ahead and created the Macro. The only thing different this time was the fact that after I mouse clicked the APU on, it came back to NORM. I made a macro anyway but it failed to respond to the TAB key. I did the same with the APU off - created a macro for it - same no response to the TAB key. I then went ahead and assigned a switch to these 2 macros and neither worked with the APU. I have included the Log file below:

44476 KEYDOWN: VK=18, Waiting=0, Repeat=N, Shifts=4

44476 .. Key not programmed -- passed on to FS

44585 KEYUP: VK=18, Waiting=0

49983 *** Entered Buttons option page ***

49998 FirstButtonChange res=00000220 (0.2, 32)

66175 *** Exiting Buttons option page ***

71136 Mouse by function: RX70280*X8bcc Module="ESDG_CitationX.GAU"

71370 Mouse by function: RX70280*X8bcc,17 Module="ESDG_CitationX.GAU"

74912 KEYUP: VK=255, Waiting=0

75348 KEYUP: VK=65, Waiting=0

75816 KEYUP: VK=80, Waiting=0

76784 KEYUP: VK=85, Waiting=0

76924 KEYUP: VK=16, Waiting=0

77564 KEYUP: VK=79, Waiting=0

77876 KEYUP: VK=78, Waiting=0

82197 KEYUP: VK=8, Waiting=0

82368 KEYUP: VK=8, Waiting=0

82805 KEYUP: VK=83, Waiting=0

83148 KEYUP: VK=84, Waiting=0

83741 KEYUP: VK=65, Waiting=0

84162 KEYUP: VK=82, Waiting=0

84428 KEYUP: VK=84, Waiting=0

89778 User Macro: APUstart=RX70280*X8bcc,17 (Module="ESDG_CitationX.GAU")

89981 KEYUP: VK=13, Waiting=0

93039 Mouse by function: RX70310*X8bcc Module="ESDG_CitationX.GAU"

93195 Mouse by function: RX70310*X8bcc,17 Module="ESDG_CitationX.GAU"

95457 KEYUP: VK=65, Waiting=0

95800 KEYUP: VK=80, Waiting=0

96393 KEYUP: VK=85, Waiting=0

96533 KEYUP: VK=16, Waiting=0

96939 KEYUP: VK=79, Waiting=0

97625 KEYUP: VK=70, Waiting=0

97875 KEYUP: VK=70, Waiting=0

102758 User Macro: APUoff=RX70310*X8bcc,17 (Module="ESDG_CitationX.GAU")

102961 KEYUP: VK=13, Waiting=0

105862 KEYDOWN: VK=18, Waiting=0, Repeat=N, Shifts=4

105862 .. Key not programmed -- passed on to FS

105971 KEYUP: VK=18, Waiting=0

113366 *** Entered Buttons option page ***

113366 FirstButtonChange res=00000220 (0.2, 32)

117812 *** Exiting Buttons option page ***

123865 KEYDOWN: VK=17, Waiting=0, Repeat=N, Shifts=2

123865 .. Key not programmed -- passed on to FS

123958 KEYDOWN: VK=67, Waiting=0, Repeat=N, Shifts=2

123958 .. Key not programmed -- passed on to FS

124489 System time = 14:48:55, FS2004 time = 19:16:31 (00:16Z)

124489 *** FSUIPC log file being closed

Memory managed: 64 Allocs, 7505 Freed

********* FSUIPC Log file closed ***********

Share this post


Link to post
Share on other sites
Pete: Here goes. After I opened my flight I opened FSUIPC. I checked off logging for buttons and keys. After that I went to Create Macro and named it APUtest. When I clicked OK, it went back to the main FSUIPC window but I had this small square window pop up in the center of the FSUIPC window that said:

"Saving and/or reloading FSUIPC settings. Please wait." Unfortunately, this message NEVER disappeared --- until I closed FS. What is this?

Never disappeared? Even when you exited the FSUIPC settings?

It is merely a progress message, to stop folks thinking FS or FSUIPC has hung when changes are being made to the INI file -- or it is being re-scanned. I added it because things can take noticeably longer now, with Profiles and larger programming facilities like macros and Lua plug-ins.

Here it disappears quickly with a small INI file, but it takes longer with a big one. I've never had it stay put forever, even after you close FSUIPC options! Didn't you try clicking the mouse some place else -- it might just be a redrawing thing, based on focus. Let me know, I'll check into that.

I went ahead and created the Macro. The only thing different this time was the fact that after I mouse clicked the APU on, it came back to NORM.

Isn't that supposed to happen? I though the problem we were trying to sort out was it being stuck in APU on position. Doesn't it hold in the APU on position whilst you hold the button down?

I made a macro anyway but it failed to respond to the TAB key.

It sounds like the two macro calls:

71136 Mouse by function: RX70280*X8bcc Module="ESDG_CitationX.GAU"

71370 Mouse by function: RX70280*X8bcc,17 Module="ESDG_CitationX.GAU"

are programmed with the same name, APU on. Let's see the Macro file entries. You want just the "RX70280*X8bcc" on programmed as APU on, and the "RX70280*X8bcc,17" one programmed as APU Norm.

I think the problem is that you presumably have to release the mouse in order to deal with the macro name details, and that creates the release action.

I'm not sure how to get around that by any automatic means. You could try moving the pointer AWAY from the switch before releasing the mouse button. But that won't help programming the release, only the press.

I think I'll just have to ignore the release action when programming on screen, and let folks do the APU Norm part by editing the Macro file and creating the APU Norm entry themselves from the APU On entry, adding the ,17 (which means "button released").

It's promising, but I fear the automatic method won't work. Let me know how you get on, and please show me the Macro file.

Regards

Pete

Share this post


Link to post
Share on other sites

Hey Pete: This is like talking on the phone with you.

1. Regarding the behavior of the switch, I was just reporting to you what I saw different from the last time. You're right. This is what we want to happen.

2. That message - NEVER DISAPPEARED. I just went back and tried it again and it remained even after I closed FSUIPC and even after I clicked on the desktop with the mouse. It remained there (all by itself) until I closed out FS. It then closed.

3. Here are the two Macro file entries:

1=APUstart=RX70280*X8bcc,17

2=APUoff=RX70310*X8bcc,17

I cannot create one for the Norm, since the switch just self centers after I release the mouse.

4. Yes I have to release the mouse to deal with the macro file details. If I hold down the mouse, I just get the macro name entry colored window flashing between the two colors.

Thanks, Al

Share this post


Link to post
Share on other sites

2. That message - NEVER DISAPPEARED. I just went back and tried it again and it remained even after I closed FSUIPC and even after I clicked on the desktop with the mouse. It remained there (all by itself) until I closed out FS. It then closed.

That's weird. I wonder what's different on your system?

3. Here are the two Macro file entries:

1=APUstart=RX70280*X8bcc,17

2=APUoff=RX70310*X8bcc,17

As I said in the last message, the first one should be the usual, without the ",17". They look wrong anyway. In the Log you showed me there was most certainly this, too:

71136 Mouse by function: RX70280*X8bcc Module="ESDG_CitationX.GAU"

that would be the "Start" one.

Look, let's make this easier. Going back a few messages I see you had this, once:

21=APU Start=RX70280*X8bcc

22=APU Norm=RX70280*X8bcc

23=APU Off=RX70310*X8bcc

Now, I think, to make that work, just edit it to look like this:

21=APU Start=RX70280*X8bcc

22=APU Norm=RX70280*X8bcc,17

23=APU Off=RX70310*X8bcc

In other words, the "Norm" setting is by releasing the mouse.

Please try that. I thought I did explain this in the last message, but evidently not well enough. :-(

I cannot create one for the Norm, since the switch just self centers after I release the mouse.

And I explained that too!

I'll have a think about what might be keeping that progress message on screen. That's a weird one. It sounds like the DestroyWindow message is getting lost somehow.

Pete

Share this post


Link to post
Share on other sites

I edited the previous macro file line 22 by adding ",17" as suggested and this did not change how the switch functioned.

When I use the switch on my CH throttle quad to put the APU switch to the start position, the switch just goes there and stays there; it does not return to Norm with release of the CH switch. If I switch APU off it goes to off and stays there.

Some additional information for you about that progress window staying on.

I noticed, for example, when I checked off "Buttons and Keys" in the logging window, when I said OK to exit, I saw that progress window flash very briefly before the main FSUIPC window closed. It did not stay on. If I open FSUIPC and then immediately close it, that window again very briefly flashes before going off. So it is working correctly some times. It was only when doing the create macro file that it stayed on.

Al

Share this post


Link to post
Share on other sites
I edited the previous macro file line 22 by adding ",17" as suggested and this did not change how the switch functioned.

When I use the switch on my CH throttle quad to put the APU switch to the start position, the switch just goes there and stays there; it does not return to Norm with release of the CH switch. If I switch APU off it goes to off and stays there.

That's very disappointing, as that is the only thng I can see that would be happening with the real mouse.

I'll scrap the whole attempt. Sorry. It just won't work.

I noticed, for example, when I checked off "Buttons and Keys" in the logging window, when I said OK to exit, I saw that progress window flash very briefly before the main FSUIPC window closed. It did not stay on. If I open FSUIPC and then immediately close it, that window again very briefly flashes before going off. So it is working correctly some times. It was only when doing the create macro file that it stayed on.

Ah, thanks. That's a good clue. I'll see what might be happening.

Regards

Pete

Share this post


Link to post
Share on other sites

Pete: Thanks so much for all your hard work to try to find a solution to get this switch to work. Even though it did not work, I hope you learned something new from this experiment. I certainly did. Take care and thanks again. Have a great weekend. Al

Share this post


Link to post
Share on other sites
Pete: Thanks so much for all your hard work to try to find a solution to get this switch to work. Even though it did not work, I hope you learned something new from this experiment. I certainly did. Take care and thanks again. Have a great weekend. Al

SUCCESS!

I got really annoyed about this, why I couldn't get it working, so I went and bought the Citation just so I could sort it out. (It's the most expensive aircraft I've ever bought for FS, and it's only FS9 which I don't even use. Sigh).

The flag needed is number 11, not 17 -- when you release the button FS sends an 11 THEN the 17! The 11 means "LEAVE" (which I would have taken to mean move the mouse away from the switch). The 17 is the left-button-up.

Anyway, this works:

21=APU Start=RX70280*X8bcc

22=APU Norm

22.1=RX70280*X8bcc,11

22.2=RX70310*X8bcc,11

23=APU Off=RX70310*X8bcc

Assign Start to the Press and Norm to the Release of a start button,

Assign Off to the Press and Norm to the Release of an Off button.

I've found and fixed the bug with the Progress window sticking when you start a macro creation -- it was actually creating two identical windows because of the path being taken through the Macro filename request dialogue. I'll release an update later this weekend.

The above macros will work with the current main release (3.85) as they don't use any newer facilities. I won't be able to offer the ,11 creation facilities anyway, they have to be by editing.

Regards

Pete

Share this post


Link to post
Share on other sites

Pete: Just read your PM. Thank you so much. Was busy taking care of my granddaughter yesterday. Talk about support; this is the ultimate in support. You are a genius. This is great news and I can't even try it out since I am now at work and have to wait till tonight to give it a try. Agree it is an expensive plane but this business jet is really nice to fly. I am hooked on it right now. Will report back after I try your new macro assignments.

I will tell you that I have gotten almost all switches and push buttons to work in this plane using your mouse macro program. Now we can add the APU switch as well. However, there are still 2 switches (actually push buttons) I have not been able to program. I was not going to try any further with them and just keep using my mouse. I know you are very busy with everything else but maybe now that you have the plane you can give them a quick try. It is the left and right engine start push buttons and the the XTIE (battery cross tie) push button - all are on the same tilt panel. I tried them but never had any success. Everything else seems to work fine.

Thanks again and will be back in touch after I try the APU switch. Al

Share this post


Link to post
Share on other sites
... there are still 2 switches (actually push buttons) I have not been able to program. I was not going to try any further with them and just keep using my mouse. I know you are very busy with everything else but maybe now that you have the plane you can give them a quick try. It is the left and right engine start push buttons and the the XTIE (battery cross tie) push button - all are on the same tilt panel. I tried them but never had any success.

They also need another line, it seems, but not the ",11" flag but the ",17" one -- the one I thought would have been needed in the first place, meaning "button up". It seems they only make a "click" on "button down", then another click and the action on "button up". Odd sort of programming, but I suppose they have reasons.

The way to do these is to set about making a macro as before, then edit the MCRO file. Change the

n==XXXXXXX*XXXXX

line to

n=

and move the rest to a new line below it:

n.1=XXXXXXX*XXXXX

That's step one. The action is identical, but now you can add more lines for the same macro. So add:

n.2=XXXXXXX*XXXXX

with the same details, and append either ,11 or ,17 -- that's the experimental part. You can't know without trying which the gauge actually needs.

Take a look at the solution for the APU switch. You'll get the idea.

Regards

Pete

Share this post


Link to post
Share on other sites

Take a look at the solution for the APU switch. You'll get the idea.

I'm using the Citation example in an additional section for the FSUIPC User Guide, in the next full release. This is what it looks like, hope it helps:

Variations for Mouse activated switches which might be made to work by editing the Macro file

From experimentation, it seems that some switches operate not only from the mouse button being pressed, but also (or instead) when it is released. Because of the way I’ve tried to semi-automate the creation of macros, it is not possible for FSUIPC to detect these—especially when the action of the button pressed is to hold a spring-loaded switch in order to operate a starter, for example.

The only way to deal with these is to make the macro, as described above, and follow it through to completion but ignoring, for now, the failure of the “TAB test”. End the macro making session via the options, then load the macro file into a text editor, such as Notepad. The file will be named “xxxx.mcro”, where “xxxx” is the name you gave it.

The file will look something like this (from a real example:

  • [Macros]
    Module="XXXXXXXX.GAU"
    1=APU Start=RX70280*X8bcc
    2=APU Normal=RX70280*X8bcc
    3=APU Off=RX70310*X8bcc
    4=L Eng Start=RX4a470*X8bcc
    5=R eng Start=RX4a4f0*X8bcc
    6=XTIE=RX66560*X8bcc

These just happen to be the only awkward switches and buttons on a popular add-on aircraft. Here, the APU Start and APU Off macros merely get the switch stuck in those positions – it doesn’t spring back to centre. The Engine start and XTIE switches just make a click and do nothing else.

The problem with the APU starter is that the macro generated for the “Off” position is actually the same as that for the Start one – it could have been the same as the “Off” one if the macros had been created in a different order. What is happening here is that the gauge is detecting the release of the mouse button, and the FSUIPC macro isn’t reproducing that.

The macro facility is actually equipped to indicate variations on the mouse action, and this is achieved by appending another number. The numbers relevant here are 11 meaning “leave” and 17 meaning “release”

It isn’t possible to know in advance which of these, if either, are needed. It might even be both. Experimentation is needed.

Before we start experimenting, prepare the file for multiple-line macros, as follows:

  • [Macros]
    Module="XXXXXXXX.GAU"
    1=APU Start=RX70280*X8bcc
    2=APU Normal=
    2.1=RX70280*X8bcc
    3=APU Off=RX70310*X8bcc
    4=L Eng Start
    4.1=RX4a470*X8bcc
    5=R eng Start
    5.1=RX4a4f0*X8bcc
    6=XTIE
    6.1=RX66560*X8bcc

All I’ve done here is changed the lines we know don’t work by leaving the name on its own line, and inserting the extra .1 lines with the mouse action assigned. The file is actually identical in its effect to the original, but now we can add more actions.

With the “APU Normal” switch, we want it to return to the normal position on button “leave” or “release” from either “Start” or “Off”. So the first thing to do is extend its part with the Off code as well, so it does both:

  • 2=APU Normal=
    2.1=RX70280*X8bcc
    2.2=RX70310*X8bcc

By experimentation, the solution for this is the “leave” code, 11:

  • 2=APU Normal=
    2.1=RX70280*X8bcc,11
    2.2=RX70310*X8bcc,11

This works! But it turned out that the other three needed ,17:

  • 4=L Eng Start
    4.1=RX4a470*X8bcc
    4.2=RX4a470*X8bcc,17
    5=R eng Start
    5.1=RX4a4f0*X8bcc
    5.2=RX4a4f0*X8bcc,17
    6=XTIE
    6.1=RX66560*X8bcc
    6.2=RX66560*X8bcc,17

There, all done.

When you are trying things and testing the results, remember that you can edit the MCRO file then go into FSUIPC’s Buttons or Keys tab and tell it to reload the settings. It will re-process your MCRO files including any changes. You don’t have to keep reloading FS.

Share this post


Link to post
Share on other sites

Thanks Pete: You are the greatest! I am still at work, noon here. Cannot wait to get home to try these out. Wish I could leave a little early, like right now but I still have 5 hours to go. Report back to you as soon as I try these new macros. Al

Share this post


Link to post
Share on other sites

Great work Pete!!! Success-Success! Your dedication and determination to find a solution made it work. All the switches work perfect. Really like the engine start switches working now. And that APU switch returning to center is really nice. I cannot thank you enough for all your support on this little project. I certainly had a lot of fun working with you on it. And it seems that you learned a few new things for FSUIPC. And BTW, that Progress Window works fine now. Take care, Al

Share this post


Link to post
Share on other sites

Pete: Need some advice and maybe some help. I have been enjoying my GoFlight modules with the Eaglesoft Citation X2 after you helped me get all this working with your mouse macros. Eaglesoft just came out with an update (Hotfix 1.6) which is basically a reinstall. This went well. However, now all my GoFlight modules no longer work. When I open the plane and go into FSUIPC and click Airplane Specific under Buttons and Switches, all the buttons and switches are still recognized (under Select for FS control) but they do not work in the plane. Any idea how to debug this? I would hate to think of starting all over. Thanks, Al

Share this post


Link to post
Share on other sites
I have been enjoying my GoFlight modules with the Eaglesoft Citation X2 after you helped me get all this working with your mouse macros. Eaglesoft just came out with an update (Hotfix 1.6) which is basically a reinstall. This went well. However, now all my GoFlight modules no longer work. When I open the plane and go into FSUIPC and click Airplane Specific under Buttons and Switches, all the buttons and switches are still recognized (under Select for FS control) but they do not work in the plane. Any idea how to debug this? I would hate to think of starting all over. Thanks, Al

Sounds like there's been some code changes and things have moved. You'll need to re-create the macros.

The way these macros work is by finding out where, in actual code, the mouse clicking actually gets any action done. The number stuff recorded in the Macro file is merely an offset into a named Gauge file where FSUIPC has to actually jump to to make the action occur. The first two bytes of the location it jumps to are also recorded so that FSUIPC can check that this is still the correct place when, as you've done, the Gauge code is replaced by different code.

It may be that the code has only moved a little way, but there is no safe way for my code to automatically find it. The only way it can find the right place is to trap and record the real, correct, places by hooking the actual mouse operations -- which is exactly what mouse macro creation does.

Sorry, you need to create them again. At least you know about the more complicated ones now, and what to do.

Regards

Pete

Share this post


Link to post
Share on other sites

Hi Pete: Back with a question about Mouse Macros. Finally switched over to FSX and now have the FSX Cessna Citation (by Eaglesoft) that we discussed at length for FS9 regarding the self centering APU switch.

I am using FSUIPC 4.53. I have programmed all the macros for the Citation (as I did for the FS9 version of the plane) and everything works great except for the APU self centering switch. I even have the XTIE and Engine start switches working perfect using the 17 modifier, as you discovered in our previous discussions and experiments with the FS9 plane. However, the APU switch does not work as it did in FS9 using the 11 modifier.

I have the following in my Macro file:

21=APU Start=RXadf90*X55cc

22=APU Normal

22.1=RXadf90*X55cc,11

22.2=RXae000*X55cc,11

23=APU Off=RXae000*X55cc

Essentially the same as in FS9 but just different #'s.

When I program one of my CH throttle switches for APU Start - it works - but the APU switch does not return to the Normal center position.

Turning off the APU also works but it does not return to the Normal center position. Using the same switches as I did in FS9.

Any recommendation as to what I could do to further investigate this small problem?

Thanks, Al

Share this post


Link to post
Share on other sites
When I program one of my CH throttle switches for APU Start - it works - but the APU switch does not return to the Normal center position.

Turning off the APU also works but it does not return to the Normal center position. Using the same switches as I did in FS9.

But I thought the switch was self-centering? How does it manage to stay set elsewhere?

Any recommendation as to what I could do to further investigate this small problem?

Sorry, without the actual aircraft to experiment with I can't really say. You'd need to experiment.

There is a small chance we could get enough information on what the switch does with the mouse by some extra logging. Add these lines to the [General] section of the FSUIPC4.INI file:

Debug=Please

LogExtras=4097

LogButtons=Yes

(replacing any similar lines if already there).

Then load FSX and operate the APU switch with the mouse -- remembering exactly what you did, i.e. the order you did things. Keep the session short and don't do anything else.

You can disable the extra logging later in the Logging tab -- set the "Extras" number to 0, for instance, and uncheck the Buttons/Keys logging.

Regards

Pete

Share this post


Link to post
Share on other sites

Pete: Thanks, I'll do this but it may need to wait to next Monday as I am going out of town.

What I mean by the APU Start switch "works" - it does turn on the APU but the switch just stays in the up position after I release my CH switch. I can then

mouse click it to center. The same thing when shutting down the APU, the APU will turn off but the switch just stays in the down position and can only be

placed in the center position by mouse clicking it to center. In other words, the switch does not self center after Start or Off like it did before. Al

Share this post


Link to post
Share on other sites

What I mean by the APU Start switch "works" - it does turn on the APU but the switch just stays in the up position after I release my CH switch.

Yes, I understood that.

We need to find the sequence needed in the macros to do the same thing. Hence the logging I mentioned, or more trial and error on your part.

Pete

Share this post


Link to post
Share on other sites
Pete: Are there any modifiers other than the 17 and 11 that we used before? Al

Sorry, I don't recall what we used before. The possibly useful ones are listed in the Advanced Users document for FSUIPC, in the mouse macro section.

Regards

Pete

Share this post


Link to post
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

×

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.