Sign in to follow this  
Guest dko60202

XML guages - one button, two functions?

Recommended Posts

Is it possible to have a single mouse area do two different things based on right/left mouse click? I've tried (1) two different items (using type="SingleLeft" and type="SingleRight")in the same , or (2) two different s with the same coordinates, neither is working for me.Thanks!

Share this post


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

Yep.... it sure is possible :-)Use the same click area just once. (M:Event) 'LeftSingle' scmp 0 == if{ DO THE THING FOR THE LEFT CLICK } (M:Event) 'RightSingle' scmp 0 == if{ DO THE THING FOR THE RIGHT CLICK }Regards,Roman(KGRB)Not a Pilot, but did stay at a holiday inn last night :-)

Share this post


Link to post
Share on other sites

Ahhh...I didn't think of checking the (M:Event). That's perfect, thanks Roman!Douglas

Share this post


Link to post
Share on other sites

Now, if I could just figure out how to implement a "press and hold for two seconds" functionality in XML....Douglas

Share this post


Link to post
Share on other sites

DouglasI too needed some kind of functionality like that and if you're interested it follows:It uses just 1 G:Var. It doesn't use the FS time perse as it would be alot more code. It will work even if paused. It does rely on the to increment the G:Var1 to act as a timer. In these examples the Update Freq. is 6, for other values of freq. just change the activation and limit values for G:var1. Fully tested for operation. Single purpose button, 2 second hold for activation-- (M:Event) 'LeftSingle' scmp 0 == (G:Var1) 120 == ! & if{ (G:Var1) ++ (>G:Var1) (G:Var1) 12 > if{ 120 (>G:Var1) (DO THE OPERATION WITH 2 SECOND PUSH REQUIREMENT) } } (M:Event) 'LeftRelease' scmp 0 == if{ 0 (>G:Var1) }Dual Purpose button, single click for #1 operation ( NON REPEATABLE, must click each time, for instance, to increase some value incrementally) and 2 second hold for activation #2.(M:Event) 'LeftSingle' scmp 0 == (G:Var1) 120 == ! & if{ (G:Var1) ++ (>G:Var1) (G:Var1) 12 > if{ 120 (>G:Var1) (DO THE OPERATION WITH 2 SECOND PUSH REQUIREMENT) } } (M:Event) 'LeftRelease' scmp 0 == if{ (G:Var1) 120 == if{ 0 (>G:Var1) } els{ (DO THE OPERATION WITH SINGLE CLICK REQUIREMENT) 0 (>G:Var1) } }You could also mix and match these two versions to make one click area to do up to 4 operations by nearly adding the same code but using the RightCick+RightRelease click kinds and arguments still only using the 1 G:Var. ( Cause you cannot click two areas at once! )If copying and pasting code from here,,,,, WATCH the spaces... Regards,Roman(KGRB)

Share this post


Link to post
Share on other sites

Roman,That looks sweet...I'll give it a try tonight. I'm working on a replacement B/K radio stack (to be offered as freeware, eventually, if there's interest) with restored visual and functional fidelity, and this will be great to add that extra bit of realism.Shame on you, you're making this too easy on me... :)Douglas

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