Jump to content
The simFlight Network Forums

Question for repeat n-times (button or key)


Recommended Posts

Hi Pete,

I bought FSUIPC4 three days ago and now I ask myself why I haven'd done this years ago and how I lived without it :D

An while I was fooling around with it I thought "profiles would be nice ?" :arrow: and puff, wish granted !

I started with something light and made the Aerosoft Twin Otter thrust reverse work with my CH Throttle Quadrant, perfect.

But now my problem:

In the A2A Boeing 377 Stratocruiser the prop reverse is special coded, they do not use thrust reverse.

So it is not possible to control this with negative THROTTLE AXIS values as normal.

Instead you pull your throttles to idle and then use F2 key to further decrease the throttle into negative pitch.

As long as the (virtual cockpit)throttle lever is in the negative range the joystick axis is disabled.

With F3 key you can increase the (virtual cockpit)throttle lever back to idle and then the axis is enabled again.

BUT if you keep pressing the F3 key, the throttle increases beyond idle and if you use the axis again, the throttle jumps.

If I had now something like:

On button press/hold/release, repeat key n-times

I could programm one button press to go into 25% prop reverse, and exactly back to idle on release,

a second one to go to 50% prop reverse, and exactly back to idle... and so on.

would be nice with cowl flaps or flaps as well.

Maybe inifile coding could be something like this:

0 =P3N5,20,K113,8

1 =U3N5,20,K114,8

with N5 declaring to do 5 repeats in your normal repeat rate.

If it's not possible, no problem.

Anyway thanks alot for your tool,

Regards, Christian

Link to comment
Share on other sites

In the A2A Boeing 377 Stratocruiser the prop reverse is special coded, they do not use thrust reverse.

So it is not possible to control this with negative THROTTLE AXIS values as normal.

Wouldn't prop reversal be done by -ve prop pitch axis values, not throttle? Doesn't that reverse the blades? FSUIPC does support negative prop pitch too.

If I had now something like:

On button press/hold/release, repeat key n-times

Just program it for once then edit the INI file to make it do it n times. But don't use KeyStrokes for this -- use the proper FS control. Or does this add-on aircraft intercept the F2 and F3 keystrokes themselves? F2 is just "Throttle Dec" and F3 is "Throttle Inc" -- the same, in fact, as the 3 and 9 keys on the Numeric Keypad.

I assume they must be intercepting either the keystrokes or the FS controls -- more likely the latter. If the controls go through to FS they operate the same as an axis input would do.

Maybe inifile coding could be something like this:

0 =P3N5,20,K113,8

1 =U3N5,20,K114,8

with N5 declaring to do 5 repeats in your normal repeat rate.

No need. Simply do

0 =P3,20,K113,8

1 =P3,20,K113,8

2 =P3,20,K113,8

3 =P3,20,K113,8

4 =P3,20,K113,8

5 =U3,20,K114,8

6 =U3,20,K114,8

7 =U3,20,K114,8

8 =U3,20,K114,8

9 =U3,20,K114,8

except, providing the controls work, change the K113,8 and K114,8 parts to C65602,0 and C65598,0 respectively. Those are the controls which those keypresses are converted to in FS's assignments.

It's really not worth adding a special facility for repeats as there's not a lot of use for them in general. Sequences of different controls or keypresses are needed at times, so using the multiple entry technique for repeats is sufficient.

Note that once you do something like this in the INI, FSUIPC won't let you edit that button in the on-line options. It would be too easy to get into a mess, and I didn't want to over-complicate the dialogues for minority uses.

Regards

Pete

Link to comment
Share on other sites

Hi Pete,

that was a fast reply.

No problem at all, I earn my money with software development as well...

...and sometimes I'm not as polite as you are when it comes to minority wishes in my project :mrgreen:

Just as info for you (maybe someone else ask's similar things):

I tried Throttle Decr on a button with repeat and as long as the throttle is above idle it moves the lever just fine, but then A2As magic kicks in and the lever only moves further when using F2.

I tried the

0 =P3,20,K113,8

1 =P3,20,K113,8

2 =P3,20,K113,8

3 =P3,20,K113,8

4 =P3,20,K113,8

trick before I started to bug you and it seems as if it is too fast (I counted the keypresses to move the full range of reverse, but with that many lines I only got a fraction of the expected movement.

I think A2A needs some time for their proccessing and in that time they do not listen :?:

Maybe I can suggest a variable delay parameter for the keypress lines ?

(...ok ok, there comes the demanding minority again... :oops: )

Thanks for your quick response,

Regards, Christian

Link to comment
Share on other sites

I tried Throttle Decr on a button with repeat and as long as the throttle is above idle it moves the lever just fine, but then A2As magic kicks in and the lever only moves further when using F2.

Strange. I've no idea what they are doing. Seems a bit limited in usefulness.

Try enabling FSUIPC's Even and Axis logging (Logging tab left hand side) and see what gets through when you are doing these things.

There must surely be a better way?

If it is operating reverse by reverse pitch of the props, why isn't reversing the prop pitch using that axis working?

... it seems as if it is too fast (I counted the keypresses to move the full range of reverse, but with that many lines I only got a fraction of the expected movement. I think A2A needs some time for their proccessing and in that time they do not listen :?:

Odd too, as keypresses only get queued up in the message queue. If they read them, they read them. If they don't they sit in the queue.

Maybe I can suggest a variable delay parameter for the keypress lines ?

Not at all nice to do the way all this is programmed. I'd rather look for the "correct" way.

Have you asked the folks that built the aircraft for a solution? It must surely be something they've thought of -- some way to use their aircraft with hardware.

Oh, BTW, you could quite easily do what you want using a Lua plug-in for FSUIPC. Have you looked at that possibility at all?

Regards

Pete

Link to comment
Share on other sites

They have their AccuSim system.

They sell it as an addon, and it's worth every € they charge for it.

It practically puts a whole simulation layer on top of FSX. If you are interested, this http://a2asimulations.com/forum/viewforum.php?f=37&sid=f1bec788571184c673f6ccbd879c2bc8 is the forum for the B-377.

Strange. I've no idea what they are doing. Seems a bit limited in usefulness.

So Accusim may be the reason for their way to do the reverse.

I solved the problem with the classical multiple line, same button approach and with some testing I got it quite good working.

I indeed thought about doing it in LUA (and maybe I will, later) but currently I take what I have and first do the rest of the configuration.

Try enabling FSUIPC's Even and Axis logging (Logging tab left hand side) and see what gets through when you are doing these things.

Nothing, their special effects don't talk in your log at all.

The thing with the keypresses beeing ommited is just a guess from me, maybe it's not the case and when I tried to count my manual keypresses repeat kicked in....

Do not waste too much time with my request, currently I'm happy (look at the time this was send, practically from my last post until now I kept on configuring all the things that are working as I need them)

The conditional button functions are sooo nice, I use the mode switches on my Saitek X52 and Saitek Commander Unit as condition buttons.

This gives me SIX modes for all the buttons I have on all devices.

When I have finished my first complete setup for the B-377 I'll go to the A2A forum and present my findings there. They are clever guys and maybe they find a way for an even better interaction with your software.

If I have something new I'll come back to this forum and tell you my findings.

Again, thanks alot for your help and your software, it is more than worth it's money as well.

Regards, Christian

Link to comment
Share on other sites

They have their AccuSim system.

They sell it as an addon, and it's worth every € they charge for it.

It practically puts a whole simulation layer on top of FSX.

That's all very well, but they should consider cockpit builders and hardware use when they make these designs.

I solved the problem with the classical multiple line, same button approach and with some testing I got it quite good working.

So, let us in on this method so others can benefit, please.

I indeed thought about doing it in LUA (and maybe I will, later)

Well it is so easy in only a few lines I will do it for you here, for one of the functions:

i = 0
while i < 5 do
   ipc.keypress(113)
   ipc.sleep(500)
   i = i + 1
end

Save that into the Modules folder as, say, Reverse.Lua, then assign your button press to "Lua reverse" (reload buttons first to get the Lua files re-scanned).

You will need to adjust the sleep time to make it work at the speed you need -- the 500 is half a second between each repeat.

When I have finished my first complete setup for the B-377 I'll go to the A2A forum and present my findings there. They are clever guys and maybe they find a way for an even better interaction with your software.

Okay, but let us know here, too, please.

Regards

Pete

Link to comment
Share on other sites

So, let us in on this method so others can benefit, please.

Nothing sophisticated, just raw mass.

The buttons P3, 16-18-20-22 are the lower detend buttons of the corresponding CH axises.

When each lever stops at the upper detent its not exactly idle, but thats no problem on this plane.

When you then pull back each lever it gives ca. +25% of reverse each, putting it back to the upper detent gives -25% reverse each.

With all four pulled you have 100% reverse.

So when they are all back to upper detend, the VC levers are back to idle and the analog axis will move them again.

Because they unplug the axis controls the moment they enter reverse the F2 and F3 keys always move all VC levers. Even with the mouse in VC you cannot move a single VC lever in reverse.

(I hope Scott from A2A will never have to land his baby with one of the inner engines dead on a short runway. He will find that asymetrical reverse thrust cannot be compensated with rudder or steering :mrgreen: )

That's all very well, but they should consider cockpit builders and hardware use when they make these designs.

You're so right, but to talk in their defence, sometimes you need some iteration with your users until you can serve all of their needs in their separate usecases. I think they had the more common user in mind.

I'll try the LUA code tomorrow (thanks, by the way :D ) it will cut back my graveyard of lines....

[Axes.B377 Stratocruiser]
0=0X,256,D,1,0,0,0
1=0Y,256,D,2,0,0,0
2=0Z,256,D,4,0,0,0
3=0U,256,D,21,0,0,0
4=0V,256,D,28,0,0,0
5=0S,256,D,22,0,0,0
6=0P,0,F,66416,0,0,0
7=2X,256,D,7,0,0,0
8=2Y,256,D,8,0,0,0
9=2R,256,D,3,0,0,0
10=3X,256,D,5,0,0,0
11=3Y,256,D,6,0,0,0
12=3Z,256,F,66420,0,0,0
13=3R,256,F,66423,0,0,0
14=3U,256,F,66429,0,0,0
15=3V,256,F,66426,0,0,0

[Buttons.B377 Stratocruiser]
0	=P3,16,K113,8
1	=P3,16,K113,8
2	=P3,16,K113,8
3	=P3,16,K113,8
4	=P3,16,K113,8
5	=P3,16,K113,8
6	=P3,16,K113,8
7	=P3,16,K113,8
8	=P3,16,K113,8
9	=P3,16,K113,8
10	=P3,16,K113,8
11	=P3,16,K113,8
12	=P3,16,K113,8
13	=P3,16,K113,8
14	=P3,16,K113,8
15	=P3,16,K113,8
16	=P3,16,K113,8
17	=P3,16,K113,8
18	=P3,16,K113,8
19	=P3,16,K113,8

20	=U3,16,K114,8
21	=U3,16,K114,8
22	=U3,16,K114,8
23	=U3,16,K114,8
24	=U3,16,K114,8
25	=U3,16,K114,8
26	=U3,16,K114,8
27	=U3,16,K114,8
28	=U3,16,K114,8
29	=U3,16,K114,8
30	=U3,16,K114,8
31	=P1,11,K114,8
32	=U3,16,K114,8
33	=U3,16,K114,8
34	=U3,16,K114,8
35	=U3,16,K114,8
36	=U3,16,K114,8
37	=U3,16,K114,8
38	=U3,16,K114,8


39	=P3,18,K113,8
50	=P3,18,K113,8
41	=P3,18,K113,8
42	=P3,18,K113,8
43	=P3,18,K113,8
44	=P3,18,K113,8
45	=P3,18,K113,8
46	=P3,18,K113,8
47	=P3,18,K113,8
48	=P3,18,K113,8
49	=P3,18,K113,8
50	=P3,18,K113,8
51	=P3,18,K113,8
52	=P3,18,K113,8
53	=P3,18,K113,8
54	=P3,18,K113,8
55	=P3,18,K113,8
56	=P3,18,K113,8
57	=P3,18,K113,8
58	=P3,18,K113,8

59	=U3,18,K114,8
60	=U3,18,K114,8
61	=U3,18,K114,8
62	=U3,18,K114,8
63	=U3,18,K114,8
64	=U3,18,K114,8
65	=U3,18,K114,8
66	=U3,18,K114,8
67	=U3,18,K114,8
68	=U3,18,K114,8
69	=U3,18,K114,8
70	=U3,18,K114,8
71	=U3,18,K114,8
72	=U3,18,K114,8
73	=U3,18,K114,8
74	=U3,18,K114,8
75	=U3,18,K114,8
76	=U3,18,K114,8
77	=U3,18,K114,8
78	=U3,18,K114,8


79	=P3,20,K113,8
80	=P3,20,K113,8
81	=P3,20,K113,8
82	=P3,20,K113,8
83	=P3,20,K113,8
84	=P3,20,K113,8
85	=P3,20,K113,8
86	=P3,20,K113,8
87	=P3,20,K113,8
88	=P3,20,K113,8
89	=P3,20,K113,8
90	=P3,20,K113,8
91	=P3,20,K113,8
92	=P3,20,K113,8
93	=P3,20,K113,8
94	=P3,20,K113,8
95	=P3,20,K113,8
96	=P3,20,K113,8
97	=P3,20,K113,8
98	=P3,20,K113,8

99	=U3,20,K114,8
100	=U3,20,K114,8
101	=U3,20,K114,8
102	=U3,20,K114,8
103	=U3,20,K114,8
104	=U3,20,K114,8
105	=U3,20,K114,8
106	=U3,20,K114,8
107	=U3,20,K114,8
108	=U3,20,K114,8
109	=U3,20,K114,8
110	=U3,20,K114,8
111	=U3,20,K114,8
112	=U3,20,K114,8
113	=U3,20,K114,8
114	=U3,20,K114,8
115	=U3,20,K114,8
116	=U3,20,K114,8
117	=U3,20,K114,8
118	=U3,20,K114,8


119	=P3,22,K113,8
120	=P3,22,K113,8
121	=P3,22,K113,8
122	=P3,22,K113,8
123	=P3,22,K113,8
124	=P3,22,K113,8
125	=P3,22,K113,8
126	=P3,22,K113,8
127	=P3,22,K113,8
128	=P3,22,K113,8
129	=P3,22,K113,8
130	=P3,22,K113,8
131	=P3,22,K113,8
132	=P3,22,K113,8
133	=P3,22,K113,8
134	=P3,22,K113,8
135	=P3,22,K113,8
136	=P3,22,K113,8
137	=P3,22,K113,8
138	=P3,22,K113,8

139	=U3,22,K114,8
140	=U3,22,K114,8
141	=U3,22,K114,8
142	=U3,22,K114,8
143	=U3,22,K114,8
144	=U3,22,K114,8
145	=U3,22,K114,8
146	=U3,22,K114,8
147	=U3,22,K114,8
148	=U3,22,K114,8
149	=U3,22,K114,8
150	=U3,22,K114,8
151	=U3,22,K114,8
152	=U3,22,K114,8
153	=U3,22,K114,8
154	=U3,22,K114,8
155	=U3,22,K114,8
156	=U3,22,K114,8
157	=U3,22,K114,8

Regards, Christian

Link to comment
Share on other sites

In the A2A Boeing 377 Stratocruiser the prop reverse is special coded, they do not use thrust reverse.

So it is not possible to control this with negative THROTTLE AXIS values as normal.

-SNIP-

I assume they must be intercepting either the keystrokes or the FS controls -- more likely the latter. If the controls go through to FS they operate the same as an axis input would do.

-SNIP-

Regards

Pete

To answer this question, Pete...

The B-377 code uses "On Key=" code for F2 and F3, sending "K:THROTTLE_DECR" and "K:THROTTLE_INCR" Key events to FSX while also setting

L:variables to note the reverse state conditions.

Paul

Link to comment
Share on other sites

The B-377 code uses "On Key=" code for F2 and F3, sending "K:THROTTLE_DECR" and "K:THROTTLE_INCR" Key events to FSX while also setting

L:variables to note the reverse state conditions.

Wonder why not process the THROTTLE DECR and INCR key events themselves, then? FS itself converts F2 and F3 into those in any case, if the default assignments are left. It would seem more normal to utilise the controls rather than specific key presses which can be re-assigned, normally.

Regards

Pete

Link to comment
Share on other sites

  • 3 weeks later...
Yesterday I had actually time to TEST my setup for prop reverse of the A2A B-377...

...and it worked just fine :mrgreen:

Haven't yet tried the LUA method :oops:

What was the solution you tested? if it's listed in the thread above I can't pick it out as

there are several possible 'solutions'....

I'm currently using a couple of controls on my X-45 throttle to generate the repeating F3 & F3 keystrokes.

I have both my X-45 and Saitek Pro dual throttle quadrants attached. The X-45 throttle axis is dormant.

Currently I'm having a problem attempting to generate keystrokes via FSUIPC buttons mapping or with Lua.

Any attempt to send a keystroke codes results in FSX crashing with a "ntdll.dll" error, offset 00018fea Code:0xc0000005.

I have no idea what may have changed on my system to cause this fault as I'm sure I used to be able

to may keystrokes via FSUIPC.

This is the code from the FSUIPC.ini that I used to test this: ( doesn't matter which aircraft I use to test )

[buttons.Beech Baron 58 w G1000]

0=P0,8,K113,8

So, injecting actual keystrokes via the X-45, which FSX sees as keyboard inputs, works OK but

injecting key codes does not.

Paul

Link to comment
Share on other sites

Currently I'm having a problem attempting to generate keystrokes via FSUIPC buttons mapping or with Lua.

Any attempt to send a keystroke codes results in FSX crashing with a "ntdll.dll" error, offset 00018fea Code:0xc0000005.

The offset isn't any use, but the code indicates an access violation. Usually those are caused by bad pointers.

I have no idea what may have changed on my system to cause this fault as I'm sure I used to be able

to may keystrokes via FSUIPC.

This is the code from the FSUIPC.ini that I used to test this: ( doesn't matter which aircraft I use to test )

[buttons.Beech Baron 58 w G1000]

0=P0,8,K113,8

Does it crash with all keystrokes, or just that one (which is F2)? There's no problem here sending keystrokes from button presses. Have you tried enabling Key logging in FSUIPC's logging page to see if it gets through FSUIPC? If so it is whatever is seeing that keystroke which is crashing. Maybe some other add-on?

So, injecting actual keystrokes via the X-45, which FSX sees as keyboard inputs, works OK but

injecting key codes does not.

All keycodes, or just that one?

If you come back with any more information, it would help, please, if you stated FS and FSUIPC version numbers. Also, it might be worth trying the latest Update (in the announcements) first.

Pete

Link to comment
Share on other sites

OK Pete, I just did a couple of tests. FSUIPC Version 4.425, registered

I started the log and sent some "F7" keys to FSX-Acelleration using my Saitek X-45 and the keyboard.

The X-45 software profile sends "F7" when I press a particular button.

No problems with either entry method as FSX sees them as the same thing, a keyboard input.

I then assigned a button on my Saitek Pro quadrant in FSUIPC to send a non-repeating "F7".

As soon as I activate that button FSX freezes and the error screen eventually appears.

Here is the log file with my comments added after the fact. Note that the last event is a FSUIPC

"SendKeyToFS".

It doesn't seem to matter which keystroke I attempt to assign in FSUIPC. I've tried F1, F2, F3 and now F7,

all with the same results.

I'm almost certain that I USED to be able to send keystrokes to FSX using FSUIPC but haven't

used that facility for some time as I use the Saitek profile software for my X-45 but I

do NOT use the software for the Saitek Pro yoke and quadrants.

Also, I assign FS functions to buttons from within the FSX controls menu as well.

For the B-377 'special case', the F2/F3 keys need to be sent and repeated. I have done this

from within my X-45 profile but it is cumbersome as I must remove my hand from

my Pro throttles to the X-45 throttle, activate the 'F2' button then after I've slowed, the F3

button, then get back on the Pro throttles to keep my engines plugs from fouling.

Thus it would behove me to have the F2/F3 repeating functions on the Pro throttle.

I don't use the Saitek software on the Pro as it is not compatible with the X-45 software,

thus FSUIPC id the only method for accomplishing these key presses from the Pro throttle.

Below is the log excerpts.

Regards,

Paul


  • ********* FSUIPC4, Version 4.425 by Pete Dowson *********
    User Name="**********"
    User Addr="*********"
    FSUIPC4 Key is provided
    WIDEFS7 not user registered, or expired
    [Continuation log requested by user]
    Running inside FSX (SimConnect Acc/SP2 Oct07)
    ... FSX has been renamed as "fsx_Propliner"
    Module base=61000000
    Wind smoothing fix is fully installed
    428641 System time = 17:26:09, FSX time = 12:37:37 (17:37Z)
    431610 KEYDOWN: VK=118, Waiting=0, Repeat=N, Shifts=0
    431610 .. Key not programmed -- passed on to FS
    431610 *** EVENT: Cntrl= 65758 (0x000100de), Param= 0 (0x00000000) FLAPS_INCR // X-45 button press to send F7
    431735 KEYUP: VK=118, Waiting=0
    436235 KEYDOWN: VK=118, Waiting=0, Repeat=N, Shifts=0
    436235 .. Key not programmed -- passed on to FS
    436235 *** EVENT: Cntrl= 65758 (0x000100de), Param= 0 (0x00000000) FLAPS_INCR // Keyboard button press of F7
    436281 KEYUP: VK=118, Waiting=0
    440031 KEYDOWN: VK=117, Waiting=0, Repeat=N, Shifts=0
    440031 .. Key not programmed -- passed on to FS
    440031 *** EVENT: Cntrl= 65759 (0x000100df), Param= 0 (0x00000000) FLAPS_DECR // X-45 button press
    440188 KEYUP: VK=117, Waiting=0
    442641 KEYDOWN: VK=117, Waiting=0, Repeat=N, Shifts=0
    442641 .. Key not programmed -- passed on to FS
    442641 *** EVENT: Cntrl= 65759 (0x000100df), Param= 0 (0x00000000) FLAPS_DECR // X-45 button press
    442719 KEYUP: VK=117, Waiting=0
    447797 *** Entered Buttons option page ***
    447797 FirstButtonChange res=00000020 (0.0, 32)
    448000 FirstButtonChange res=00000020 (0.0, 32)
    448250 FirstButtonChange res=00000020 (0.0, 32)
    448500 FirstButtonChange res=00000020 (0.0, 32)
    448750 FirstButtonChange res=00000020 (0.0, 32)
    449000 FirstButtonChange res=00000020 (0.0, 32)
    449250 FirstButtonChange res=00000020 (0.0, 32)
    449500 FirstButtonChange res=00000020 (0.0, 32)
    449750 FirstButtonChange res=00000020 (0.0, 32)
    450000 FirstButtonChange res=00000020 (0.0, 32)
    450250 FirstButtonChange res=00000020 (0.0, 32)
    450500 FirstButtonChange res=00000020 (0.0, 32)
    450750 FirstButtonChange res=00000020 (0.0, 32)
    450985 FirstButtonChange res=00000008 (0.0, 8)
    451000 FirstButtonChange res=00000008 (0.0, 8)
    451250 FirstButtonChange res=00000008 (0.0, 8)
    ---------- A whole lot of these deleted to save space ----------
    462500 FirstButtonChange res=00000008 (0.0, 8)
    462750 FirstButtonChange res=00000008 (0.0, 8)
    463000 FirstButtonChange res=00000008 (0.0, 8)
    463000 *** Exiting Buttons option page ***
    463313 Button changed: bRef=0, Joy=0, Btn=8, Released
    463313 [buttons] 2=P0,8,K118,8
    468406 KEYDOWN: VK=118, Waiting=0, Repeat=N, Shifts=0
    468406 .. Key not programmed -- passed on to FS
    468406 *** EVENT: Cntrl= 65758 (0x000100de), Param= 0 (0x00000000) FLAPS_INCR // X-45 button press to send F7
    468610 KEYUP: VK=118, Waiting=0
    471235 KEYDOWN: VK=117, Waiting=0, Repeat=N, Shifts=0
    471235 .. Key not programmed -- passed on to FS
    471235 *** EVENT: Cntrl= 65759 (0x000100df), Param= 0 (0x00000000) FLAPS_DECR // X-45 button press
    471360 KEYUP: VK=117, Waiting=0
    474406 Button changed: bRef=0, Joy=0, Btn=8, Pressed // Saitek quadrant button press programmed via FSUIPC for F7
    474406 [buttons] 2=P0,8,K118,8
    474406 SendKeyToFS(00000076=[F7], KEYDOWN) ctr=0

Link to comment
Share on other sites

I started the log and sent some "F7" keys to FSX-Acelleration using my Saitek X-45 and the keyboard.

The X-45 software profile sends "F7" when I press a particular button.

No problems with either entry method as FSX sees them as the same thing, a keyboard input.

I then assigned a button on my Saitek Pro quadrant in FSUIPC to send a non-repeating "F7".

As soon as I activate that button FSX freezes and the error screen eventually appears.

Hmmm. There's something strange going on there. The actions after this part of the log:

  • 474406 Button changed: bRef=0, Joy=0, Btn=8, Pressed // Saitek quadrant button press programmed via FSUIPC for F7
    474406 [buttons] 2=P0,8,K118,8
    474406 SendKeyToFS(00000076=[F7], KEYDOWN) ctr=0

haven't changed in FSUIPC3 or FSUIPC4 for many years -- it uses a facility in Windows called "SendInput" to recreate the same effect as pressing keys on the keyboard.

I've just programmed a button here to send an F7. Here's excerpts from my log:

  • ********* FSUIPC4, Version 4.425 by Pete Dowson *********
    ...
    Running inside FSX (SimConnect Acc/SP2 Oct07)
    ...
    163938 Button changed: bRef=0, Joy=174, Btn=7, Pressed
    163938 [buttons] 12=P174,7,K118,8
    163938 SendKeyToFS(00000076=[F7], KEYDOWN) ctr=0
    163938 JoystickValues joynum=0, dwCount=1, data[2]={000000ae 00000080}
    163938 Sending WM_KEYDOWN, Key=118 (Scan code 65), Ctr=1
    164000 KEYDOWN: VK=118, Waiting=0, Repeat=N, Shifts=0
    164000 .. Key not programmed -- passed on to FS
    164000 *** EVENT: Cntrl= 65758 (0x000100de), Param= 0 (0x00000000) FLAPS_INCR
    164047 SendKeyToFS(00000076=[F7], KEYUP) ctr=0
    164063 Sending WM_KEYUP, Key=118 (Scan code 65), Ctr=1
    164110 KEYUP: VK=118, Waiting=0
    164172 Button changed: bRef=0, Joy=174, Btn=7, Released
    164172 [buttons] 12=P174,7,K118,8
    164172 JoystickValues joynum=0, dwCount=1, data[2]={000000ae 00000000}

That's how it should look, with all the blue parts following the part where your system is hanging.

I've got no other reports like this, so I'm worried that there's something corrupted or interfering with this on your system somehow. Looking at my code, the early parts of the sequence after the "SendKeyToFS" action, as logged in my log, are actually carried out in a different thread. I'm wondering if there's some glitvh here which is very time-sensitive.

I'll look to see if I can add a little extra logging to narrow it down -- though if it is very timing sensitive that might not help isolate it, of course.

Later

Oh, could you post here the main [buttons] section from your FSUIPC4.INI file, please? I need to see whether there are any parameters which may influence this.

Pete

Link to comment
Share on other sites

Oh, could you post here the main [buttons] section from your FSUIPC4.INI file, please? I need to see whether there are any parameters which may influence this.

Found it! I think. That line above prompted me to pore through the paths in the code taken with specific [buttons] options changes.

Look in your [buttons] section of the INI. Do you have a PollInterval= parameter there? If so, is it by any chance set to 50 or more?

If so, try setting it to any number less than 50 (or just delete the line so it defaults to 25 as usual).

Here, with 50 or more I get exactly the same results as you. Looking at the code, there's an "ancient" path through which differs for poll rates or 20/sec or less (as indeed an interval of 50 will achieve). I'll fix this. It looks like it was designed to avoid creating a thread for button presses when the poll rate was only about the same, or less, than the normal Windows "tick" rate in any case (18/sec or 55 mSecs). I think I must have thought it wasteful of resources.

However, some few releases ago i made the key-sending sequence a separate thread too, to get a smoother result for key sequences, and consequently I had to arrange an interlock between the threads when accessing the same data -- that for keystrokes resulting from button presses.

Oh, what a tangled web we weave;-)

Anyway, if this is indeed what is causing your problem, you can fix it easily with that parameter, and I will fix it this end by making Button polling always threaded. Threading suits modern PCs in any case with their often under-utilised other cores!

Regards

Pete

Link to comment
Share on other sites

Hi Gypsy Baron,

just in case you haven´t done it already, this is my B-377 section of FSUIPC4.ini:

[Profile.B377 Stratocruiser]
0	=Boeing 377 Pregnant Guppy, Paint 1
1	=Boeing Stratocruiser, PAN AM
2	=Boeing Stratocruiser, BOAC
3	=Boeing Stratocruiser, AOA
4	=Boeing Stratocruiser, NWA
5	=Boeing Stratocruiser, QEA
6	=Boeing Stratocruiser, Transocean
7	=Boeing Stratocruiser, UNITED AIR LINES
8	=Boeing Stratocruiser, TWA
9	=Boeing Stratocruiser, USAF
10	=Boeing Stratocruiser, USAF1
11	=Boeing Stratocruiser, MATS
12	=Boeing Stratocruiser, CATHAY
13	=Boeing Stratocruiser, USCG
14	=Boeing Stratocruiser, PAN AM 1
15	=Boeing Stratocruiser, Early BOAC

[Axes.B377 Stratocruiser]
0=0X,256,D,1,0,0,0
1=0Y,256,D,2,0,0,0
2=0Z,256,D,4,0,0,0
3=0U,256,D,21,0,0,0
4=0V,256,D,28,0,0,0
5=0S,256,D,22,0,0,0
6=0P,0,F,66416,0,0,0
7=2X,256,D,7,0,0,0
8=2Y,256,D,8,0,0,0
9=2R,256,D,3,0,0,0
10=3X,256,D,5,0,0,0
11=3Y,256,D,6,0,0,0
12=3Z,256,F,66420,0,0,0
13=3R,256,F,66423,0,0,0
14=3U,256,F,66429,0,0,0
15=3V,256,F,66426,0,0,0

[JoystickCalibration.B377 Stratocruiser]
ExcludeThrottleSet	=Yes
ExcludeMixtureSet	=Yes
ExcludePropPitchSet	=Yes
SepRevsJetsOnly	=No
;ApplyHeloTrim	=No
ApplyHeloTrim	=Yes
FlapsSetControl	=0
FlapDetents	=No
ReverserControl		=66292
Reverser1Control	=66422
Reverser2Control	=66425
Reverser3Control	=66428
Reverser4Control	=66431
MaxThrottleForReverser	=256
AileronTrimControl	=66731
RudderTrimControl	=66732
CowlFlaps1Control	=66162
CowlFlaps2Control	=66163
CowlFlaps3Control	=66164
CowlFlaps4Control	=66165
SteeringTillerControl	=0
MaxSteerSpeed	=60
Aileron	=-16380,-512,512,16380/8
Elevator	=-16380,-512,512,16380/8
ElevatorTrim	=-16383,-512,512,15602/24
SlopeElevatorTrim	=5
Rudder	=-16319,-512,512,16383/8
SlopeRudder	=2
Rudder Trim	=-16384,-512,512,16383/8
SlopeRudder Trim	=5
LeftBrake	=-15000,16383/24
SlopeLeftBrake	=5
RightBrake	=-15000,16383/24
SlopeRightBrake	=5
PropPitch=-14433,16383/8
Mixture=-14432,16383/8
Throttle=-12000,16383/8

[Buttons.B377 Stratocruiser]
0	=P3,16,K113,8
1	=P3,16,K113,8
2	=P3,16,K113,8
3	=P3,16,K113,8
4	=P3,16,K113,8
5	=P3,16,K113,8
6	=P3,16,K113,8
7	=P3,16,K113,8
8	=P3,16,K113,8
9	=P3,16,K113,8
10	=P3,16,K113,8
11	=P3,16,K113,8
12	=P3,16,K113,8
13	=P3,16,K113,8
14	=P3,16,K113,8
15	=P3,16,K113,8
16	=P3,16,K113,8
17	=P3,16,K113,8
18	=P3,16,K113,8
19	=P3,16,K113,8

20	=U3,16,K114,8
21	=U3,16,K114,8
22	=U3,16,K114,8
23	=U3,16,K114,8
24	=U3,16,K114,8
25	=U3,16,K114,8
26	=U3,16,K114,8
27	=U3,16,K114,8
28	=U3,16,K114,8
29	=U3,16,K114,8
30	=U3,16,K114,8
31	=U3,16,K114,8
32	=U3,16,K114,8
33	=U3,16,K114,8
34	=U3,16,K114,8
35	=U3,16,K114,8
36	=U3,16,K114,8
37	=U3,16,K114,8

38	=P3,18,K113,8
39	=P3,18,K113,8
50	=P3,18,K113,8
41	=P3,18,K113,8
42	=P3,18,K113,8
43	=P3,18,K113,8
44	=P3,18,K113,8
45	=P3,18,K113,8
46	=P3,18,K113,8
47	=P3,18,K113,8
48	=P3,18,K113,8
49	=P3,18,K113,8
50	=P3,18,K113,8
51	=P3,18,K113,8
52	=P3,18,K113,8
53	=P3,18,K113,8
54	=P3,18,K113,8
55	=P3,18,K113,8
56	=P3,18,K113,8
57	=P3,18,K113,8

58	=U3,18,K114,8
59	=U3,18,K114,8
60	=U3,18,K114,8
61	=U3,18,K114,8
62	=U3,18,K114,8
63	=U3,18,K114,8
64	=U3,18,K114,8
65	=U3,18,K114,8
66	=U3,18,K114,8
67	=U3,18,K114,8
68	=U3,18,K114,8
69	=U3,18,K114,8
70	=U3,18,K114,8
71	=U3,18,K114,8
72	=U3,18,K114,8
73	=U3,18,K114,8
74	=U3,18,K114,8
75	=U3,18,K114,8
76	=U3,18,K114,8
77	=U3,18,K114,8

78	=P3,20,K113,8
79	=P3,20,K113,8
80	=P3,20,K113,8
81	=P3,20,K113,8
82	=P3,20,K113,8
83	=P3,20,K113,8
84	=P3,20,K113,8
85	=P3,20,K113,8
86	=P3,20,K113,8
87	=P3,20,K113,8
88	=P3,20,K113,8
89	=P3,20,K113,8
90	=P3,20,K113,8
91	=P3,20,K113,8
92	=P3,20,K113,8
93	=P3,20,K113,8
94	=P3,20,K113,8
95	=P3,20,K113,8
96	=P3,20,K113,8
97	=P3,20,K113,8

98	=U3,20,K114,8
99	=U3,20,K114,8
100	=U3,20,K114,8
101	=U3,20,K114,8
102	=U3,20,K114,8
103	=U3,20,K114,8
104	=U3,20,K114,8
105	=U3,20,K114,8
106	=U3,20,K114,8
107	=U3,20,K114,8
108	=U3,20,K114,8
109	=U3,20,K114,8
110	=U3,20,K114,8
111	=U3,20,K114,8
112	=U3,20,K114,8
113	=U3,20,K114,8
114	=U3,20,K114,8
115	=U3,20,K114,8
116	=U3,20,K114,8
117	=U3,20,K114,8

118	=P3,22,K113,8
119	=P3,22,K113,8
120	=P3,22,K113,8
121	=P3,22,K113,8
122	=P3,22,K113,8
123	=P3,22,K113,8
124	=P3,22,K113,8
125	=P3,22,K113,8
126	=P3,22,K113,8
127	=P3,22,K113,8
128	=P3,22,K113,8
129	=P3,22,K113,8
130	=P3,22,K113,8
131	=P3,22,K113,8
132	=P3,22,K113,8
133	=P3,22,K113,8
134	=P3,22,K113,8
135	=P3,22,K113,8
136	=P3,22,K113,8
137	=P3,22,K113,8

138	=U3,22,K114,8
139	=U3,22,K114,8
140	=U3,22,K114,8
141	=U3,22,K114,8
142	=U3,22,K114,8
143	=U3,22,K114,8
144	=U3,22,K114,8
145	=U3,22,K114,8
146	=U3,22,K114,8
147	=U3,22,K114,8
148	=U3,22,K114,8
149	=U3,22,K114,8
150	=U3,22,K114,8
151	=U3,22,K114,8
152	=U3,22,K114,8
153	=U3,22,K114,8
154	=U3,22,K114,8
155	=U3,22,K114,8
156	=U3,22,K114,8

If you have a look at the [buttons.B377 Stratocruiser] section, you can see four sets of

0 =P3,16,K113,8

.....

19 =P3,16,K113,8

20 =U3,16,K114,8

.....

37 =U3,16,K114,8

joystick #3 is my "CH Throttle Quadrant USB" and each axis has a lower detend with a corresponding button, which is clicked when the detend is reached.

So each axis produces a series of F2 key presses when it is in its lower detend (which moves the virtual levers 25% of the reverse way), and produces a series of F3 key presses when the detend is left.

So with pulling one of the CH levers to reverse I get 25% reverse, two get me 50%, all get me 100%.

Regards, Christian

Link to comment
Share on other sites

this is my B-377 section of FSUIPC4.ini:

[Profile.B377 Stratocruiser]
0	=Boeing 377 Pregnant Guppy, Paint 1
1	=Boeing Stratocruiser, PAN AM
2	=Boeing Stratocruiser, BOAC
3	=Boeing Stratocruiser, AOA
4	=Boeing Stratocruiser, NWA
5	=Boeing Stratocruiser, QEA
6	=Boeing Stratocruiser, Transocean
7	=Boeing Stratocruiser, UNITED AIR LINES
8	=Boeing Stratocruiser, TWA
9	=Boeing Stratocruiser, USAF
10	=Boeing Stratocruiser, USAF1
11	=Boeing Stratocruiser, MATS
12	=Boeing Stratocruiser, CATHAY
13	=Boeing Stratocruiser, USCG
14	=Boeing Stratocruiser, PAN AM 1
15	=Boeing Stratocruiser, Early BOAC

How did that "0 = " line get into the Profile? My code starts the list with 1. I don't think I read a "0 =" line.

Also just a suggestion. If you set "ShortAircraftNameOK=Substring" in the [General] section, then you could simplify that Profile list to just:

[Profile.B377 Stratocruiser]
1	=Stratocruiser

I've removed the "0 =" line because I don't think it should work. Or does it? Let me know and I'll re-check my code.

Regards

Pete

Link to comment
Share on other sites

Found it! I think. That line above prompted me to pore through the paths in the code taken with specific [buttons] options changes.

Look in your [buttons] section of the INI. Do you have a PollInterval= parameter there? If so, is it by any chance set to 50 or more?

If so, try setting it to any number less than 50 (or just delete the line so it defaults to 25 as usual).

Version 4.426, in the Updates announcement now, fixes this little bug. I hope I found the cause of your troubles, Please let me know.

Regards

Pete

Link to comment
Share on other sites

-SNIP-

Look in your [buttons] section of the INI. Do you have a PollInterval= parameter there? If so, is it by any chance set to 50 or more?

If so, try setting it to any number less than 50 (or just delete the line so it defaults to 25 as usual).

-SNIP-

Oh, what a tangled web we weave;-)

-SNIP-

Regards

Pete

BINGO!!

[buttons]

EliminateTransients=Yes

PollInterval=50 <------------------------- will change this

1=P3,9,C65909,0

ButtonRepeat=20,10

Thanks for the quick analysis and help Pete! I really appreciate your staying on top of

all the various ways FSx,y,or z can come back to bite us :)

Paul

EDIT: I just tested with the verion I had yeaterday, setting PollInterval to 45....it worked.

I then loaded todays version ( 29th ) and tested with PollInterval= 50 and it also worked so

you nailed this one! Thanks again, Pete.

======================================

Hi Gypsy Baron,

just in case you haven´t done it already, this is my B-377 section of FSUIPC4.ini:

-SNIP-

joystick #3 is my "CH Throttle Quadrant USB" and each axis has a lower detend with a corresponding button, which is clicked when the detend is reached.

So each axis produces a series of F2 key presses when it is in its lower detend (which moves the virtual levers 25% of the reverse way), and produces a series of F3 key presses when the detend is left.

So with pulling one of the CH levers to reverse I get 25% reverse, two get me 50%, all get me 100%.

Regards, Christian

Thanks Christian. I'll implement this on my Saitek Pro quadrants. This will be a big help

on those occasions when I need to stop that beast in a hurry :)

Paul

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.