Sign in to follow this  
pve

Push button Single click and hold timer click XML FS9

Recommended Posts

Hi all Need one CLR button to do usual single click command and also hold down for 2 seconds to do another Master CLR. Single click 0 (>L:MsgWarn,number)0 (>L:APT_ICAO_enter,bool)0 (>L:Delete,bool)0 (>L:DirTO_cont,bool) 0 (>L:DirTO,bool) 0 (>L:SetValue, number)0 (>L:InputError, number)@DigitErase@InvokeICAOInputMode((@c:FacilityICAO), ' ', 31) I have the click code for the delay (thanks Tom) (M:Event) 'LeftSingle' scmp 0 == if{ (L:Var1,seconds) 0 == if{ @Time (>L:Var1,seconds) 0 (>L:Clear,bool) }els{ (L:Var1,seconds) 2 + @Time < if{ 1 (>L:Clear,bool) } }} How do I combine the two click commands.

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi,Not sure what you need, but may be something like this (not tested):(M:Event) 'LeftSingle' scmp 0 == if{ 0 (>L:MsgWarn,number) 0 (>L:APT_ICAO_enter,bool) ... etc.(P:absolute time,seconds) 2 + (>L:Var1,seconds) } (M:Event) 'Leave' scmp 0 == if{ (P:absolute time,seconds) (L:Var1,seconds) > if{ 0 (>L:MsgWarn,number) 0 (>L:APT_ICAO_enter,bool) ... etc. } } ???Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Paul,Try this:(M:Event) 'LeftSingle' scmp 0 == if{ (L:Var1,seconds) 0 == if{ @Time (>L:Var1,seconds) 0 (>L:MsgWarn,number)0 (>L:APT_ICAO_enter,bool)0 (>L:Delete,bool)0 (>L:DirTO_cont,bool) 0 (>L:DirTO,bool) 0 (>L:SetValue, number)0 (>L:InputError, number)@DigitErase@InvokeICAOInputMode((@c:FacilityICAO), ' ', 31)0 (>L:Clear,bool)}els{ (L:Var1,seconds) 2 + @Time < if{ 1 (>L:Clear,bool) } }} All the zero assignments, @DigitErase and @InvokeICAOInputMode will be processed on the first pass only.I'm not sure whether this would suit for @InvokeICAOInputMode Tom

Share this post


Link to post
Share on other sites

Hi guys This what I got (M:Event) 'LeftSingle' scmp 0 == if{ 0 (>L:MsgWarn,number) 0 (>L:APT_ICAO_enter,bool) 0 (>L:Delete,bool) 0 (>L:DirTO_cont,bool) 0 (>L:DirTO,bool) 0 (>L:SetValue, number) 0 (>L:InputError, number)@DigitErase @InvokeICAOInputMode((@c:FacilityICAO), ' ', 31) }(P:absolute time,seconds) 4 + (>L:MSG,seconds) > (M:Event) 'Leave' scmp 0 == if{ (P:absolute time,seconds) (L:MSG,seconds) if{ 1 (>L:MasterMsgWarn,bool) } } This one resets top multiple values and L:MasterMsgWarn,bool with single click, It resets multiple values with hold down and L:MasterMsgWarn,bool on release. I am trying to reset multiple values with single click (less than 2 secs) and L:MasterMsgWarn,bool with hold after 2 secs. Nearly there Toms code resets both on single click

Share this post


Link to post
Share on other sites

Hi,Small correction: (M:Event) 'LeftSingle' scmp 0 == if{ 0 (>L:MsgWarn,number) 0 (>L:APT_ICAO_enter,bool) 0 (>L:Delete,bool) 0 (>L:DirTO_cont,bool) 0 (>L:DirTO,bool) 0 (>L:SetValue, number) 0 (>L:InputError, number)@DigitErase @InvokeICAOInputMode((@c:FacilityICAO), ' ', 31) (P:absolute time,seconds) 4 + (>L:MSG,seconds) } (M:Event) 'Leave' scmp 0 == if{ (P:absolute time,seconds) (L:MSG,seconds) > if{ 1 (>L:MasterMsgWarn,bool) } } Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Paul,It's basically the same...(M:Event) 'LeftSingle' scmp 0 == if{ (L:MSG,seconds) 0 == if{ @Time (>L:Var1,seconds) 0 (>L:MsgWarn,number) 0 (>L:APT_ICAO_enter,bool) 0 (>L:Delete,bool) 0 (>L:DirTO_cont,bool) 0 (>L:DirTO,bool) 0 (>L:SetValue, number) 0 (>L:InputError, number) @DigitErase @InvokeICAOInputMode((@c:FacilityICAO), ' ', 31) } els{ (L:MSG,seconds) 2 + @Time < if{ 0 (>L:MasterMsgWarn,bool) } } }(M:Event) 'LeftSingle' scmp 0 == if{ 0 (>L:MSG,seconds) } This code resets a bunch of values only once, and, after being held for more than 2 seconds, resets (L:MasterMsgWarn,bool) as well (or it should be set to 1?).Note that if hold is released before two seconds, MasterMsgWarn will NOT reset.Tom

Share this post


Link to post
Share on other sites

Tom, Jan I got them both working now, I changed Jans to LeftRelease. I expected the long hold to change without release but now I understand. Thanks to you both. Paul

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
Sign in to follow this