Masterius Posted October 7, 2020 Report Posted October 7, 2020 (edited) I'm running registered copy of FSUIPC4, v4975a, along with LINDA, v3.1.1.854. I usually have no difficulty programming buttons, keys, axis, etc, either through FSUIPC, LINDA, or lua scripts. But I'm encountering a problem with button programming using conditional flags for the Saitek Pro Flight Yoke mode switch. The mode switch is seen and recognized both by FSUIPC (as axis A, buttons 8, 9, and 10) and by LINDA (where I can set UNSHIFTED, SHIFTED ONE and SHIFTED TWO). Here is the relevant section of fsuipc4.ini: [Buttons.B-17] 0=RA,32,C65734,0 -{PAN_UP}- 1=RA,34,C65672,0 -{PAN_RIGHT}- 2=RA,36,C65735,0 -{PAN_DOWN}- 3=RA,38,C65671,0 -{PAN_LEFT}- 4=PA,10,C1003,10 -{BUTTON FLAG Set: Joy A Button 10}- 5=UA,10,C1004,10 -{BUTTON FLAG Clear: Joy A Button 10}- 6=PA,9,C1003,9 -{BUTTON FLAG Set: Joy A Button 9}- 7=UA,9,C1004,9 -{BUTTON FLAG Clear: Joy A Button 9}- 8=PA,8,C1003,8 -{BUTTON FLAG Set: Joy A Button 8}- 9=UA,8,C1004,8 -{BUTTON FLAG Clear: Joy A Button 8}- 10=CP(F+A,9)PA,1,C66507,101 ;//OpenPanel101-DBG 11=CP(F+A,9)PA,1,C66507,1064 ;//OpenPanel1064-Norden 12=CP(F+A,10)PA,1,C66508,101 ;//ClosePanel101-DBG 13=CP(F+A,10)PA,1,C66508,1064 ;//ClosePanel1064-Norden The intention is that when the mode switch is set to "MODE 2" and yoke button 1 is pressed, then panels #101 and 1064 open, and when the mode switch is set to "MODE 3" and yoke button 1 is pressed, then the panels will close. Unfortunately, that's not what happens...which is nothing at all. Any help will be appreciated! Edited October 7, 2020 by Masterius Problem has been solved
spokes2112 Posted October 7, 2020 Report Posted October 7, 2020 Bunch of ideas, Perhaps the bold red "P" is a syntax error. Each line already knows it's a press with the beginning call ( #=CP ). Try removing them. 10=CP(F+A,9)PA,1,C66507,101 ;//OpenPanel101-DBG 11=CP(F+A,9)PA,1,C66507,1064 ;//OpenPanel1064-Norden 12=CP(F+A,10)PA,1,C66508,101 ;//ClosePanel101-DBG 13=CP(F+A,10)PA,1,C66508,1064 ;//ClosePanel1064-Norden ------------------------------------------------------------------------------------------------ If that doesn't work, I wonder if the "up" (U) listeners are clearing the flag before it can be used.. ( original post, lines 5, 7 & 9 ) IE the physical button or the yoke software treats it a "one shot" press. Maybe something like the following may work, it sets the flag for the current button but clears the flags for all others, the flag(s) would become a "latch". The following removes the second "P" too. 4=PA,10,C1003,10 -{BUTTON FLAG Set: Joy A Button 10}- ; MODE 3 5=PA,10,C1004,9 -{BUTTON FLAG Clear: Joy A Button 9}- 6=PA,10,C1004,8 -{BUTTON FLAG Clear: Joy A Button 8}- 7=PA,9,C1003,9 -{BUTTON FLAG Set: Joy A Button 9}- ; MODE 2 8=PA,9,C1004,10 -{BUTTON FLAG Clear: Joy A Button 10}- 9=PA,9,C1004,8 -{BUTTON FLAG Clear: Joy A Button 8}- 10=PA,8,C1003,8 -{BUTTON FLAG Set: Joy A Button 8}- ; MODE 1 = Normal operations? 11=PA,8,C1004,9 -{BUTTON FLAG Clear: Joy A Button 9}- 12=PA,8,C1004,10 -{BUTTON FLAG Clear: Joy A Button 10}- 13=CP(F+A,9)A,1,C66507,101 ;//OpenPanel101-DBG 14=CP(F+A,9)A,1,C66507,1064 ;//OpenPanel1064-Norden 15=CP(F+A,10)A,1,C66508,101 ;//ClosePanel101-DBG 16=CP(F+A,10)A,1,C66508,1064 ;//ClosePanel1064-Norden ------------------------------------------------------------------------------------------------ Another option is to use direct button polling without flags. 4=CP(-A,8)(+A,9)(-A,10)A,1,C66507,101 ;//OpenPanel101-DBG, MODE 2 5=CP(-A,8)(+A,9)(-A,10)A,1,C66507,1064 ;//OpenPanel1064-Norden, MODE 2 6=CP(-A,8)(-A,9)(+A,10)A,1,C66508,101 ;//ClosePanel101-DBG, MODE 3 7=CP(-A,8)(-A,9)(+A,10)A,1,C66508,1064 ;//ClosePanel1064-Norden, MODE 3 8=CP(+A,8)(-A,9)(-A,10)A,1,<some control> ;//Available control for MODE 1 9=CP(-A,8)(-A,9)(-A,10)A,1,<some control> ;//Normal assigned control for button 1 Just a hunch or 2 , hope it may help.. Good luck. Roman
Masterius Posted October 7, 2020 Author Report Posted October 7, 2020 1 hour ago, spokes2112 said: Perhaps the bold red "P" is a syntax error. Each line already knows it's a press with the beginning call ( #=CP ). Try removing them. Bulls-eye!! Dead in the black. That problem's been vexing me for a while now. Thanks a heap! 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now