input via keypresses

Gents, we are kind of stuck on something and hope there is somebody here that can point us in the right direction.

We got a gauge that includes a keyboard and we need to use that to enter a frequency (like 123.45) but right now we got problems understanding how to do so. We know how to do so in C (like in the accel F-18), but we need it in XML.

Mathijs Kok
Aerosoft
 
I'm not an expert, but perhaps the g1000.cab file and g1000pdf.xml fiile can help. It shows an example of keymap and trigger to use keyboard inputs.
 
I'm not an expert, but perhaps the g1000.cab file and g1000pdf.xml fiile can help. It shows an example of keymap and trigger to use keyboard inputs.
Yes, the issue is more how to merge 5 key presses into one string (not sure, I am not the developer but that is how it is explained to me).
 
Hey Mathijs,




Here is the FS9 XML Keys section from the FS9 GPS 500.



Code:
	<Keys>
		<On Event="GPS_NEAREST_BUTTON">@NRSTButton</On>
		<On Event="GPS_OBS_BUTTON">@OBSButton</On>
		<On Event="GPS_MSG_BUTTON">@MSGButton</On>	
		<On Event="GPS_FLIGHTPLAN_BUTTON">@FPLButton</On>
		<On Event="GPS_TERRAIN_BUTTON">@TerrainButton</On>
		<On Event="GPS_PROCEDURE_BUTTON">@PROCButton</On>
		<On Event="GPS_ZOOMIN_BUTTON">@ZOOMINButton</On>
		<On Event="GPS_ZOOMOUT_BUTTON">@ZOOMOUTButton</On>
		<On Event="GPS_DIRECTTO_BUTTON">@DTOButton</On>
		<On Event="GPS_MENU_BUTTON">@MENUButton</On>
		<On Event="GPS_CLEAR_BUTTON">@CLRButton</On>
		<On Event="GPS_CLEAR_ALL_BUTTON">@CLRALLButton</On>
		<On Event="GPS_ENTER_BUTTON">@ENTButton</On>
		<On Event="GPS_CURSOR_BUTTON">@PushCRSRButton</On>
		<On Event="GPS_GROUP_KNOB_INC">@TopRightKnob</On>
		<On Event="GPS_GROUP_KNOB_DEC">@TopLeftKnob</On>
		<On Event="GPS_PAGE_KNOB_INC">@BottomRightKnob</On>
		<On Event="GPS_PAGE_KNOB_DEC">@BottomLeftKnob</On>
		<On Key="AlphaNumeric">
			<Visible>10 19 (C:fs9gps:enteringInput) rng 31 (C:fs9gps:enteringInput) == or</Visible>
			(M:Key) chr (>C:fs9gps:IcaoSearchEnterChar) @InitBlinker
		</On>
		<On Key="Ascii">
			<Visible>110 119 (C:fs9gps:enteringInput) rng 131 (C:fs9gps:enteringInput) == or</Visible>
			(M:Key) chr (>C:fs9gps:NameSearchEnterChar) @InitBlinker
		</On>
		<On Key="Backspace">
			<Visible>(C:fs9gps:enteringInput)</Visible>
			10 19 (C:fs9gps:enteringInput) rng 31 (C:fs9gps:enteringInput) == || if{ -1 (>C:fs9gps:IcaoSearchBackupChar) @InitBlinker quit }
			110 119 (C:fs9gps:enteringInput) rng 131 (C:fs9gps:enteringInput) == || if{ -1 (>C:fs9gps:NameSearchBackupChar) @InitBlinker quit }
		</On>
		<On Event="GPS_CLEAR_BUTTON_DOWN">(@g:clrButtonDown) 0 == if{ 1 (>@g:clrButtonDown) 0 (>@g:clrButtonCount) }</On>
		<On Event="GPS_CLEAR_BUTTON_UP">(@g:clrButtonDown) 1 == if{ 0 (>@g:clrButtonDown) (@g:clrButtonCount) @CLRButtonDelay &lt; if{ @CLRButton } }</On>
		<On Event="GPS_MSG_BUTTON_DOWN">(@g:msgButtonDown) 0 == if{ 1 (>@g:msgButtonDown) 0 (>@g:msgButtonCount) }</On>
		<On Event="GPS_MSG_BUTTON_UP">(@g:msgButtonDown) 1 == if{ 0 (>@g:msgButtonDown) (@g:msgButtonCount) @MSGButtonDelay &lt; if{ @MSGButton } }</On>
	
</Keys>
I looked for the < Key> section in the FSX G1000 XML's and didnt see anything on the keys, unless they are interwritten in the Macros themselves, but no key section at the bottom, as like the FS9 GPS 500.

Note the Macros linking on the above code. Those are in the first part of the FS9 GPS XML. You can use Notepad Find to quickly find each Macro section.

Hope that helps.

Bill
LHC
 
Last edited:
Bill,

Can you help figure out

C:fs9gps:enteringInput

Where is this macro/variable? - or is it part of the dll for the guage. I see this also as (@g:enteringInput) in other parts of FSX guage code.

Mathijs,

You would have to store the numbers in a L:var
Then translate into BCD
Then send to guage using a similar code to C++ to XML example Cabin Comfort. Like maybe ... Boy my brain is hurting.
 
Last edited:
Ron,

You are surely asking Bill Leaming, as I am not an expert in it. But if Bill doesnt know, I would see if Susan could ansere this question. She is the GPS guru at Aces and would be able to ansere just about anything on it.

Her call sign in the Blogs is 'Engauged'.


Bill
LHC
 
Yes I meant you. You've got a great little tutorial on GMAX out - so of course your an expert on everything FS.;)

Think I figure part of it out. This has to be one of those undocumented custom variables (C:fs9gps:enteringInput) and earlier in the file i saw the macro

<Macro Name="c">C:fs9gps</Macro>
<Macro Name="g">C:fs9gps</Macro>

so @g:enteringInput is just short for C:fs9gps:enteringInput.

I'm going to assume that custom varibles are available to all XML guages, for now, till I find out different. The SDK is just like the internet - seems I can follow a thought from one point and end up somewhere totally unrelated. I started off looking a GMAX animations and got into custom variables on guages.:eek:

Back to my animation.
 

taguilo

Resource contributor
Think I figure part of it out. This has to be one of those undocumented custom variables (C:fs9gps:enteringInput) and earlier in the file i saw the macro

<Macro Name="c">C:fs9gps</Macro>
<Macro Name="g">C:fs9gps</Macro>

so @g:enteringInput is just short for C:fs9gps:enteringInput.

I'm going to assume that custom varibles are available to all XML guages, for now, till I find out different.
Yes, all "custom" variables must be referenced by a C: prefix, following the name of the custom class in where they are defined. In case of FS GPS, its name is fs9gps, and it's located in gps.dll

They can be accesed from any XML gauge. In GPS example, some of them maintain their values across the panelset, but the majority are local to each gauge in where they are defined.

Tom
 
Yes I meant you. You've got a great little tutorial on GMAX out - so of course your an expert on everything FS.

RonH
Thanks Ron, but I dont know that much. :D Making Mesh and painting them is my thing. With gauges, I am back in Kindergarten.

But.. I had seen the Macro on that. I hope it helps.

Its good fun making custom animations in Gmax though. It would be very very awesome to link them to instruments so you could make entirely new forms of animations (in both FS9 and FSX) via 2D gauge XML triggers on a panel or VC location. This, at least for me, would be awesome.



Yes, all "custom" variables must be referenced by a C: prefix, following the name of the custom class in where they are defined. In case of FS GPS, its name is fs9gps, and it's located in gps.dll

They can be accesed from any XML gauge. In GPS example, some of them maintain their values across the panelset, but the majority are local to each gauge in where they are defined.

Tom

Tom,

Is it possible to 'shadow' a copy of the GPS.DLL setup by making a new DLL that would have its programming within it, and thus enable something that could 'talk' with a model mesh through an XML gauge?


Bill

EDIT: Dont even ansere.. Sounds too far out. I have been wanting to interact gauges with the mesh, and with making sounds work via gauges for ages now. Never been this close to it though.
 

taguilo

Resource contributor
Its good fun making custom animations in Gmax though. It would be very very awesome to link them to instruments so you could make entirely new forms of animations (in both FS9 and FSX) via 2D gauge XML triggers on a panel or VC location. This, at least for me, would be awesome.


Tom,

Is it possible to 'shadow' a copy of the GPS.DLL setup by making a new DLL that would have its programming within it, and thus enable something that could 'talk' with a model mesh through an XML gauge?

Bill

EDIT: Dont even ansere.. Sounds too far out. I have been wanting to interact gauges with the mesh, and with making sounds work via gauges for ages now. Never been this close to it though.
Bill, it is perfect possible to interact XML gauges with model animated parts, using local L: variables instead of aircraft variables A:

For example, I'm using a custom variable to control an engine fan rotation (N1) instead of the normal aircraft variable that is commonly used in this case. Then, if I stop my engine in flight, I can still see the fan rotate because of drag effect, which I am simulating in an XML gauge on my panel. The aircraft var will show no rotation with the engine shut, no matter being on ground or in flight, which is one of many unrealistic features in FS.
This is good also for simulating failures, like flaps assimetry, landing gear incomplete deploy, etc.

Tom
 
Awesome...

I am glad this is doable.

Thanks Tom for the heads up.

Sorry guys for deviating the direction of this thread. My apologies.



Bill
 
Top