Jump to content
The simFlight Network Forums
abz

Mouse macros for a self centering switch

Recommended Posts

Hi Pete: I have been using your mouse macro functionality with much success and I thank you very much for this capability through FSUIPC. I just came across a switch that is self centering switch. I hope I can explain this clearly. It is for turning on an APU. Without using a mouse macro, If I mouse click the switch and hold the mouse down for 5 seconds then the motors turns on. I then let off the mouse and the switch goes to its center position automatically. Through FSUIPC, I set up the mouse macro to turn on the switch. I can get the switch to go on but I cannot get it off to go to the self center position. Can this be done through Mouse macro and FSUIPC programming? In other words, I would like to simulate this function by holding up a switch on my CH throttle quad for 5 seconds and when I let go, the switch in the plane self centers. Thanks, Al

Share this post


Link to post
Share on other sites
It is for turning on an APU. Without using a mouse macro, If I mouse click the switch and hold the mouse down for 5 seconds then the motors turns on. I then let off the mouse and the switch goes to its center position automatically. Through FSUIPC, I set up the mouse macro to turn on the switch. I can get the switch to go on but I cannot get it off to go to the self center position.

FSUIPC doesn't detect mouse button releases.

What aircraft is this? If it is something like a 737, then the mouse should be able to select "off" and "on" as well. The "on" position would be the centre position as you describe it. If you then create macros for "off" and "on", as well as "start", then you can program your switch or button to do the same. For a button just program the "press" for the Start macro, and the Release for the "on" macro.

Regards

Pete

Share this post


Link to post
Share on other sites

Thanks Pete. Still cannot get it to work perfectly. It is the new Eaglesoft Cessna Citation 2.0 (fantastic plane). Its APU switch has 3 positions, NORM in the center, Start (up) and Stop (down). If you mouse click the APU on, the switch must be held (with the mouse) for 5 seconds and then released - it then automatically goes back to the center NORM. I have tried to program the back to NORM but it does not work. When I assign a macro to it, the switch does go up but stays up - no big deal since it stills turns on the APU. If I assign the switch release to center, nothing happens. Must be different than the 737 that you mentioned. If I program the 'off' to get the switch back to center, the AP just turns off. I guess it is one of those switches that cannot be simulated perfectly - unless you have another idea for me to try. Thanks, Al

Share this post


Link to post
Share on other sites
Its APU switch has 3 positions, NORM in the center, Start (up) and Stop (down). If you mouse click the APU on, the switch must be held (with the mouse) for 5 seconds and then released - it then automatically goes back to the center NORM. I have tried to program the back to NORM but it does not work. When I assign a macro to it, the switch does go up but stays up - no big deal since it stills turns on the APU. If I assign the switch release to center, nothing happens. Must be different than the 737 that you mentioned. If I program the 'off' to get the switch back to center, the AP just turns off. I guess it is one of those switches that cannot be simulated perfectly - unless you have another idea for me to try.

I'm rather surprised that a sophisticated new add-on aircraft is provided without keyboard shortcuts for such additional switches.

Do you click in different places on the APU switch for the three positions, or is it a sequence, or is it left/centre/right clicking, what? If three different places, then you should be able to create a macro for each of the three positions. You say "if I assign the switch release to center, nothing happens." Are you saying that you cannot create a macro for this, or that you CAN assign a macro for "centre" but it doesn't work?

Tell you what. In FSUIPC's Logging tab, enable Button logging. Then enter the mouse creation mode as if to make the macros (use a temporary filename, like "test"), OK out of the options, and use the mouse to create the macros for this switch as best you can. Then go into the options and end macro making mode. Show me the Log of the button/mouse actions, please.

If the centre mode is sprung-to from both up and down and actually has no mouse "press" action associated with it, it may be I need to intercept mouse button release actions too. I'm not sure about that. Let me see your results first. If it is easy, I'll add it.

Regards

Pete

Share this post


Link to post
Share on other sites

Pete:I just want to make sure I understand what I am doing (never did this before). I went into the logging window. Now when you say enable button logging I assume you mean to place a checkmark in the Buttons and key operations. Correct? Where will I find the Log of the Button/Mouse actions? Will this be the TEST macro file?

FYI. Yes it is a center-to sprung type switch from both the up (ON) and down (OFF) positions. I created the mouse macro when I had it in the up position after creating the macro that kept it up. Then I mouse clicked it down to the center and made a new macro. Still want me to do the test file?

Thanks, Al

Share this post


Link to post
Share on other sites
Pete:I just want to make sure I understand what I am doing (never did this before). I went into the logging window. Now when you say enable button logging I assume you mean to place a checkmark in the Buttons and key operations. Correct?

Yes.

Where will I find the Log of the Button/Mouse actions? Will this be the TEST macro file?

No. All of FSUIPC's logging goes into the FSUIPC log file, which is ALWAYS produced. The options just add more stuff to it, that's all. The log file is a text file and it is in the Modules folder along with the DLL and the INI file.

FYI. Yes it is a center-to sprung type switch from both the up (ON) and down (OFF) positions. I created the mouse macro when I had it in the up position after creating the macro that kept it up. Then I mouse clicked it down to the center and made a new macro. Still want me to do the test file?

Yes, I would need to see the Log to see if there's anything I can do.

Pete

Share this post


Link to post
Share on other sites

Thanks Pete but sorry, one more question please: Since I have already created these 3 macros (ON, Norm and OFF) for this particular switch, and they are there to use in the my Macro file (CX2) for this plane, should I just redo them again exactly as I did before in the same macro file (CX2)? Or are you asking me to remake them in the a new Macro file called Test? Al

Share this post


Link to post
Share on other sites
Thanks Pete but sorry, one more question please: Since I have already created these 3 macros (ON, Norm and OFF) for this particular switch, and they are there to use in the my Macro file (CX2) for this plane, should I just redo them again exactly as I did before in the same macro file (CX2)? Or are you asking me to remake them in the a new Macro file called Test? Al

It doesn't matter to me either way. All I need to see is the log of you making them!

It occurs to me that the gauge might be actively looking for a "Mouse Up" event -- trapping the actual Windows message for this, because, as far as I can see, FS itself does not provide such a call in its mouse operation armoury. I'll look further when I see your log, but if some gauges really do trap the real mouse actions as well, or instead, then the mouse macro facility I'm providing cannot work with those actions.

If it is simply a matter of seeing a "mouse button up" message, and it doesn't care where from, maybe I could provide an extra assignable control to just send Mouse Up messages.

That's another thing you can try. Use the button to set the APU to start, then, with the mouse far away from the switch, preferably somewhere innocuous like in the outside view, click and release the left button. See if the starter releases.

Regards

Pete

Share this post


Link to post
Share on other sites

OK Pete: I made the log. How do I send it to you?

Also, I tried what you suggested about moving the mouse away from the switch.

I left clicked the mouse over the switch and the switch went to the up (start) position. As long as I stayed there the switch stayed up. However, as soon as I moved 2cm away from the switch, even with the left mouse held down, the switch released to the center position. Same thing with the down (off) position.

Al

Share this post


Link to post
Share on other sites
OK Pete: I made the log. How do I send it to you?

If it isn't huge you could just paste it into a message. If you put it in as "Code" it will be in a scrollable section of its own, if big enough. Otherwise you can email it, ZIPped please, as an attachment, to petedowson@btconnect.com.

I left clicked the mouse over the switch and the switch went to the up (start) position. As long as I stayed there the switch stayed up. However, as soon as I moved 2cm away from the switch, even with the left mouse held down, the switch released to the center position. Same thing with the down (off) position.

Hmm. Interesting, but not really useful for me as I'm not using the mouse itself. What I suggested trying was, to repeat with emboldening:

"Use the button to set the APU to start, then, with the mouse far away from the switch, preferably somewhere innocuous like in the outside view, click and release the left button. See if the starter releases." Sorry, it may have been ambiguous.

If the switch release only works by the gauge using mouse capture, then there's no way I'm going to be able to do anything with it. We'll see. I suppose you can't get any help from the aircraft makers themselves? Maybe they've used unpublished tricks in FS and want to keep them quiet for competitive reasons, but on the other hand it may just be something I've missed!

Regards

Pete

Share this post


Link to post
Share on other sites

OK. I set the APU switch up with the assigned button on my GoFlight module. Now what do you mean by "click and release the LEFT button" What LEFT button? Do you mean the left mouse click button?

Also I looked at that log file. It looks small in size to me and looks like the original log file that was there. It is now called FSUIPC.1.log. Maybe I did something wrong in creating it. Under logging, I checked off "button and key operations", "New Log" and "display to normal log file" Correct?

I hope that I am not giving you a headache with my inability to get this correct the first time. Thanks, Al

Share this post


Link to post
Share on other sites
OK. I set the APU switch up with the assigned button on my GoFlight module. Now what do you mean by "click and release the LEFT button" What LEFT button? Do you mean the left mouse click button?

Yes, of course. That's the button which when released on the switch releases it from Start, right? Not the centre button or the right button?

This is why I said (3rd time now?) "with the mouse far away from the switch, preferably somewhere innocuous like in the outside view, click and release the left button.". See? Mouse was the operative word there?

I am trying to see if me sending a Mouse Button Up message might work. I thought I said that way back?

Also I looked at that log file. It looks small in size to me and looks like the original log file that was there. It is now called FSUIPC.1.log. Maybe I did something wrong in creating it. Under logging, I checked off "button and key operations", "New Log" and "display to normal log file" Correct?

No not nearly, really, but it shouldn't have mattered:

As I asked, just enable "button and key logging" -- then and click OK as usual to get out. Nothing else. Why start a new log?

Anyway, the log renamed FSUIPC.1.log is the OLD log, the NEW log, with the button logging in it, will be FSUIPC.log as always. Each time you start a new log it will keep the old one like that. But there's no need at all unless you want a proliferation of files!

The "display to normal log" checkbox in on the Monitor side of the logging tab and is completely and utterly irrelevant unless you are entering offsets in the table there for monitoring.

Why not just check the things I say? Or peruse the user documentation. There's a section on each Tab.

Anyway, another day now. It's late here (02:35 am) and I'm off to bed. Looks like this may take a few weeks! ;-)

Regards

Pete

Share this post


Link to post
Share on other sites

Hope you got a good night sleep.

Pete: Sorry for all this confusion on my part. Just to clarify (I hope), that APU switch is oriented vertically, not left to right. That is why I asked what left button? It is a standard toggle switch on the APU panel.

Actually I am using one of the toggle switches on my CH throttle quad for this (no buttons). I can use the CH switch to make the APU switch move up (it stays there).

The problem is that when I click my CH quad switch down to move the APU switch to the center position, it goes to the down or off position. I can NOT get it to go in the center position. When I created the macro, it goes to the center position but in real life when I actually try it, the APU switch goes down to off, NOT in the center. When I created the macro to go to the center position, there is no way for me to test it with the "TAB" because it was alreay centered. So maybe it never actually created it in the first place.

OK, I can check just 'Key and Logging". I know you said this is all I have to do but do I have to hit "START" before clicking OK to get out?

Thanks, Al

Share this post


Link to post
Share on other sites

The problem is that when I click my CH quad switch down to move the APU switch to the center position, it goes to the down or off position. I can NOT get it to go in the center position. When I created the macro, it goes to the center position but in real life when I actually try it, the APU switch goes down to off, NOT in the center. When I created the macro to go to the center position, there is no way for me to test it with the "TAB" because it was alreay centered. So maybe it never actually created it in the first place.

That's what I thought, and was waiting for the Log to confirm. but I'd also need to see the log to see if there's anything I can do to help. It seems to be forever coming! ;-)

OK, I can check just 'Key and Logging". I know you said this is all I have to do but do I have to hit "START" before clicking OK to get out?

No no no no! JUST do the things I ask. Enable button logging. That's it. Then OK out. I've said exactly this several times now! It's so damned easy. If in any doubt why not read what I write? Or even look in the user documentation supplied with FSUIPC? :-(

Did you try the mouse thing yet at all?

Pete

Share this post


Link to post
Share on other sites

Pete: I created the log and I have included it here since fairly small. Hope I got it right this time. Thanks, Al

DebugStatus=15

764 System time = 17:10:53

764 \\FLTSIM6\Flight Simulator 9\

764 System time = 17:10:53, FS2004 time = 12:00:00 (00:00Z)

1622 C:\Users\ABZ\Documents\Flight Simulator Files\StartupC172.flt

1638 AIRCRAFT\c172\Cessna172SP.air

2059 Aircraft="Cessna Skyhawk 172SP"

7644 Advanced Weather Interface Enabled

7644 Traffic File #14 = "scenery\world\scenery\traffic030528"

24445 C:\Users\AZ\Documents\Flight Simulator Files\CX2.1.flt

24461 AIRCRAFT\Eaglesoft Citation X 2.0\CitationX.air

24664 Aircraft="Eaglesoft Citation X 2.0 N1220M"

26988 Clear All Weather requested: external weather discarded

64319 WeatherOptions set, now 4000B627 (timer=0)

67002 KEYDOWN: VK=18, Waiting=0, Shifts=4

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

72852 *** Entered Buttons option page ***

72852 FirstButtonChange res=00000220 (0.2, 32)

87251 *** Exiting Buttons option page ***

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

124239 Macro: mouse action="ESDG_CitationX.GAU":X70280*X8bcc

133193 User Macro: APU Start=RX70280*X8bcc (Module="ESDG_CitationX.GAU")

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

155158 User Macro: APU Norm=RX70280*X8bcc (Module="ESDG_CitationX.GAU")

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

172599 Macro: mouse action="ESDG_CitationX.GAU":X70310*X8bcc

175719 User Macro: APU Off=RX70310*X8bcc (Module="ESDG_CitationX.GAU")

181944 KEYDOWN: VK=18, Waiting=0, Shifts=4

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

187763 *** Entered Buttons option page ***

187778 FirstButtonChange res=00000220 (0.2, 32)

192193 *** Exiting Buttons option page ***

200648 KEYDOWN: VK=17, Waiting=0, Shifts=2

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

200758 KEYDOWN: VK=67, Waiting=0, Shifts=2

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

201272 System time = 17:14:14, FS2004 time = 19:17:21 (00:17Z)

201272 *** FSUIPC log file being closed

Memory managed: 26 Allocs, 15258 Freed

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

Share this post


Link to post
Share on other sites
Pete: I created the log and I have included it here since fairly small.

These are the important lines:

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

124239 Macro: mouse action="ESDG_CitationX.GAU":X70280*X8bcc

133193 User Macro: APU Start=RX70280*X8bcc (Module="ESDG_CitationX.GAU")

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

155158 User Macro: APU Norm=RX70280*X8bcc (Module="ESDG_CitationX.GAU")

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

172599 Macro: mouse action="ESDG_CitationX.GAU":X70310*X8bcc

175719 User Macro: APU Off=RX70310*X8bcc (Module="ESDG_CitationX.GAU")

and as you can see, the mouse operation, whatever you did for "APU Norm", is exactly the same as the one for "APU Start". I was hoping that either there was some difference, or more likely a different Mouse mode shown (this would be indicated by ",n" with some number n, after the "RX ....X8bcc" part.

So, I'm sorry, but I don't think I can do much for this. You haven't replied about the left mouse button being released elsewhere, so I either assume you tried it to no avail or you still don't understand what I'm getting at. But never mind. Just in case it might work (and it's a very slim chance), I have added "Mouse button 1 up" and "Mouse button 2 Up" controls which you can assign. These are in the latest FSUIPC updates available from the Updates Announcement above.

Regards

Pete

Share this post


Link to post
Share on other sites

Hi Pete: Thank you so much for all your help on this switch question.

1. I did try the left mouse button as you requested and nothing happened. No movement of the switch.

2. Thank you for providing the update for me to try which I will do soon (over the weekend).

Just want to make sure - if I place the updated 3.864 FSUIPC.dll in my modules folder to replace the one I now have, will this have any effect on my current FSUIPC settings? Any thing to back up first?

3. In my current Macro file that I have been generating all these repeat mouse macros for the same function for testing purposes, I see in this file multiple entries as shown below:

21=APU Start

21.1=RX70280*X8bcc

21.2=RX70280*X8bcc

21.3=RX70280*X8bcc

22=APU Norm

22.1=RX70280*X8bcc

22.2=RX70280*X8bcc

22.3=RX70280*X8bcc

22.4=RX70280*X8bcc

23=APU Off

23.1=RX70310*X8bcc

23.2=RX70310*X8bcc

23.3=RX70310*X8bcc

Can I just delete all the extra entries for the same function, like 22.1, 22.2, 22.3, 22.4, etc

Thanks again, Al

Share this post


Link to post
Share on other sites

1. I did try the left mouse button as you requested and nothing happened. No movement of the switch.

In that case the "Mouse button up" controls I've added won't do any good. Sorry.

2. Thank you for providing the update for me to try which I will do soon (over the weekend).

Just want to make sure - if I place the updated 3.864 FSUIPC.dll in my modules folder to replace the one I now have, will this have any effect on my current FSUIPC settings? Any thing to back up first?

Well it is always sensible to keep a backup of your INI file, but, no, FSUIPC won't change anything simply because you updated it, except possibly adding new parameters where stuff has been added.

3. In my current Macro file that I have been generating all these repeat mouse macros for the same function for testing purposes, I see in this file multiple entries as shown below:

Yes, that's why I suggested calling the new file 2test" or something, so you could delete it afterwards. You should delete all the duplicates. You only want one of each -- and since "APU Norm" doesn't work you might as well delete all of that.

Can I just delete all the extra entries for the same function, like 22.1, 22.2, 22.3, 22.4, etc

Well, what would be simplest and quickest to load would be this, instead of all the above:

21=APU Start=RX70280*X8bcc

22=APU Norm=RX70280*X8bcc

23=APU Off=RX70310*X8bcc

except, as i say, you might as well omit the non-working line 22.

Don't you think it might be worth while getting in touch with the aircraft developers, to see if they have any suggestions for a solution to the APU Starter return when not using a mouse? You never know.

Regards

Pete

Share this post


Link to post
Share on other sites

Thanks Pete for the clarification on editing the mouse macro file.

I do have a question. If, for example, I eliminate line 22 (APU Norm) as you suggested, do I have to re-number all entries below, so 23 would become 22, etc? Or do I just leave the remaining numbers as they are?

Another strange thing happened and I was wondering if you could help. I connected up 2 other GoFlight modules to my PC. Now what I had assigned through mouse macros for one GoFlight module seems to have transferred to another one, not the one that I initially did the assignment on. It seems that the joy numbers 174, 175 and 176 have been interchanged. Other than editing all this through the FSUIPC.ini file, do you know if there is a way to reassign the joy numbers of the GoFlight module back to their original? Any idea why they would have changed like that? Thanks, Al

Share this post


Link to post
Share on other sites

I do have a simple question. If, for example, I eliminate line 22 (APU Norm) as you suggested, do I have to re-number all entries below, so 23 would become 22, etc? Or do I just leave the remaining numbers as they are?

Missing numbers don't matter much in these files, so you can just omit the line. There is a maximum number (999 I think in Macro files), that's all.

The only restrictions on missing numbers so far are in the new [Profile. ...] sections of the INI. This is because all of those are scanned every time a flight or aircraft is loaded so scanning to a maximum number would affect performance more noticeably. The other stuff tends to be loaded either only once, or when requested in the Options, or only singly rather than all at once.

Regards

Pete

Share this post


Link to post
Share on other sites
... as you can see, the mouse operation, whatever you did for "APU Norm", is exactly the same as the one for "APU Start". I was hoping that either there was some difference, or more likely a different Mouse mode shown (this would be indicated by ",n" with some number n, after the "RX ....X8bcc" part.

I've been poring through the part of FS which processes the mouse clicking, and I think I've discovered a way which may well solve your problem with mouse macros and the APU switch. I'm working on it now and should have an update for you to try this weekend, probably tomorrow (Sunday). Please look out for it, then try it out. Try programming the APU switch (yet again). I'd like to see the resulting Macro file entries whether it works or not, please.

[LATER]

Okay, the latest FSUIPC updates, in the Updates Announcement, may enable you to get that APU switch working with mouse macros. Please let me know.

Regards

Pete

Share this post


Link to post
Share on other sites

Hi Pete: Sorry, but when I received your reply on Jan 23rd after I tried the left mouse, you replied that "Mouse button up" controls that you added won't do any good (see below). When I read this I did not try any further. I certainly can try your new update. But I will not be able to check it till later this week when I get home. Thanks, Al

FYI: I tried to reply to your PM to me but it just would not send - kept saying no receipient even though I inserted your name. Not sure what the problem was.

"1. I did try the left mouse button as you requested and nothing happened. No movement of the switch.

In that case the "Mouse button up" controls I've added won't do any good. Sorry."

Share this post


Link to post
Share on other sites

I certainly can try your new update. But I will not be able to check it till later this week when I get home.

That's okay, thanks! If you could show me the log too (whether it works or not): enable Button / Key logging (only).

Pete

Share this post


Link to post
Share on other sites

OK Pete: I copied the new (3.865) FSUIPC.dll file into my modules folder. When I do this experiment, is there anything unique that I have to check off or do I just go through the exact same procedure that I did before to make the macros for the APU switch (On, Norm, Off)? I will make a log for you but I just wanted to make sure that I should do exactly the same procedure I followed before. Thanks, Al

Share this post


Link to post
Share on other sites
OK Pete: I copied the new (3.865) FSUIPC.dll file into my modules folder. When I do this experiment, is there anything unique that I have to check off or do I just go through the exact same procedure that I did before to make the macros for the APU switch (On, Norm, Off)? I will make a log for you but I just wanted to make sure that I should do exactly the same procedure I followed before. Thanks, Al

Just enable the Button logging. nothing else. Then make your macros. Try to make them exactly as you want them. fingers crossed! ;-)

Thanks.

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.