Jump to content
Sign in to follow this  
MikePineTree

XML Help needed - keypresses

Recommended Posts

HiI am working on a project, in which I want a few complex aircraft controls (i.e. NAV2_RADIO_FRACT_DEC, or COM_STBY_RADIO_WHOLE_INCREASE ) to be executed on a single keypress.I was thinking about creating a gauge (or using the radio gauge itself) to "enslave" a key to execute that function, but I'm having a little trouble with it.My testing gauge for now is the nav lights gauge, to which I added a few lines after the <Mouse> event it had (that still works), but It doesn't work as it is (my guess: wrong code..ups) <Mouse> <Help ID="HELPID_GAUGE_LIGHT_SWITCH_NAV"/> <Cursor Type="Hand"/> <Click Event="TOGGLE_NAV_LIGHTS"/> </Mouse> <Keys> <On Key="m">"TOGGLE_NAV_LIGHTS"</On> </Keys></Gauge> Can someone help, please?Thank you..Ok, already found out what I did wrong with the code, and now use this: <Keys> <On Key="m">(>K:TOGGLE_NAV_LIGHTS)</On> </Keys>However, as noted on another thread, this kind of code (embeded in a gauge) only works if the panel where the gauge is placed is visible.How can I make it work independently of the panel being or not visible?(To be noted that I am using an aircraft which was not made by me - EADS Socata TB30 by Kilian Bernard)Thanks again

Share this post


Link to post
Share on other sites

Add the gauge to a VCockpit section of the panel.cfg file. They load no matter the view. If you don't want it visible in the VC add a transparent version instead.Hope this helps,

Share this post


Link to post
Share on other sites
Add the gauge to a VCockpit section of the panel.cfg file. They load no matter the view. If you don't want it visible in the VC add a transparent version instead.Hope this helps,
Hi Tom,I'm afraid it has nothing to do with the gauge already loaded or not.For FS9, OnKey (unlike OnEvent) only works if the panel window in which the gauge is defined, is active (2D window of VC).For FSX, it's even worse: OnEVent doesn't work either if the window isn't active.To the OP:the only way I know of to do what you want, is to define the gauge with the OnKey code, in a panel window that you keep "forced" open all the time; meaning that you have to make an invisible gauge and place that in a transparant window.To keep that window "forced" open, you have to create an XML gauge that checks the window status (and place that in a VC section); when the window is closed (eg. after view switching), open it again. All based on the windowident of that window.However, in XML there's no way to test the open/closed status of a window, so this means you have to continuously give the Panel_Id_Open event; but this induces the infamous "continuous event" problem.To solve that, you need a gauge that tests the status of a panel window; like Doug Dawson's gauge dsd_window_status.gau.Rob

Share this post


Link to post
Share on other sites

ThanksMy main problem was really to get the key to work, the other isn't so critical.Another thing: is it possible to assign a joystick key, or an axle, in the gauge XML code? If so, how can I do it?Thanks

Share this post


Link to post
Share on other sites
ThanksMy main problem was really to get the key to work, the other isn't so critical.Another thing: is it possible to assign a joystick key, or an axle, in the gauge XML code? If so, how can I do it?Thanks
Not that I know of..Rob

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...