Jump to content
Sign in to follow this  
Guest dirk1000

Help wanted with delay code for a XML gauge

Recommended Posts

Guest taipan_daz

XML Gods...Guys I want to use this sort of loop to install a "reversion" - if a button is pressed but after two seconds there has been no entry made, the system reverts to its previous state.Is there a key trap I can use? Maybe something like an 'if no event then' type loop?Cheers.

Share this post


Link to post
Share on other sites

Hi,If what you want is to detect if a key is pressed like when entering data on the GPS, or a specific is executed,it would be simple. Now, if the reversion must be canceled upon ANY event or keypress is done, it would be a tough work :-)Tom

Share this post


Link to post
Share on other sites
Guest taipan_daz

Hi Tom,I feared as much. Situation is this: In my PFD page on my MFD, five of the buttons allow input (CRS, ADF, bearing 1 and 2, heading bug, etc). If one of these buttons is pressed a submenu appears. If, however, after two seconds, nothing is entered, the submenu disappears and the original page is restored.I know this would be tough work - the company I'm building this for may just have to settle for my work around of click once to change, click again to cancel.Cheers.

Share this post


Link to post
Share on other sites

If you are checking for character typing, this could be an approach (pseudocode)In Mouse section :Button1 --> CRSClick= 1(>LSbMenuActive) (PAbsoluteTime) (>LTime)Button2 --> ADFClick= 1(>LSbMenuActive) (PAbsoluteTime) (>LTime)etcIn Update section: (LTime) 0 != if{ (LTime) 2 + (PAbsoluteTime) < if{ 0 (>LSbMenuActive) 0 (>LTime) } }In Element section (SubMenu):Visible = (LSbMenuActive)In Keys section:On Key (alphanumeric, etc)Process the key (PAbsoluteTime) (>LTime)Tom

Share this post


Link to post
Share on other sites
Guest taipan_daz

Yeah, I guess that could work. Because I have a few buttons that do it I could turn the initial couple of lines into a Macro and call it on each click.... hmm, plan forming in head...Thanks Tom, I'll let you know.Daz.

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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...