-
-
Notifications
You must be signed in to change notification settings - Fork 4
Radio Frequency Keypad Instructions
The radio frequency entry pages provide a keypad-like interface for typing in a numeric value (frequency in MHz, or transponder code) and then sending that new value to MSFS after it is fully entered. This is a somewhat "advanced" collection of Touch Portal Buttons, Values, and Flows which are all required to provide the functionality. Once imported, the keypad features can be copied or duplicated as desired.
The "radio stack" is just a collection of buttons to display radio data and provide some interactive functionality. One of those (optional) functions is to open the frequency editor keypad and let you enter a new standby frequency for the various radios (or a transponder code). All the elements in the "radio stack" page can be used on their own -- the keypad function/page is not required, and you could copy/paste any of these parts to other pages as desired.
I'm describing them both here because they are related and together provide a "complete package," but ultimately these are separate entities, if you will, and neither is dependent on the other.
- If you want to see current ADF, COM3, NAV3/4 frequencies or transponder code(s) at top of the keypad editor, and/or if you want the "radio stack"
display to fully work, some simulator variables need to be requested which are not included in the plugin by default. I have prepared a custom
state request .INI file which has all relevant variables and is commented as to which ones are used where. This is not technically required,
but some displayed values will be empty if the data is not available. The file can be loaded via any of the usual methods (at startup with Settings or the "Load Variable Definitions From File" action), or you can copy/paste whatever you need into an existing custom config file.
(If you have no idea what I'm talking about, please read Using Custom States and Simulator Variables.) - Download: CustomRadioStates.ini
- Accumulates typed digits in a temporary global TP Value until the user is ready to do something with that Value (like send it to the simulator as a radio frequency change event).
- Validates entered value based on the type of radio selected (COM/NAV/ADF, or XPNDR code).
- Rejects invalid entries as they're being typed (eg. trying to start a NAV frequency with "12", which would be out of valid range).
- Checks and rejects invalid frequencies again before sending to the simulator (eg. in case the frequency is below valid range).
- Adapts to the type of data being entered -- for example when editing XPNDR code, digits 8 and 9 disappear, a VFR button is added, and an option to send code and IDENT is given.
- "Smart typing assist" will pre-enter "1" for COM/NAV frequencies, automatically put in the decimal point where needed (if user didn't type it), and likewise will backspace over the decimal point when deleting the last fractional digit.
- Builds the correct SimConnect Event to send to MSFS based on the radio component/channel/system being edited (eg. COM2 STDBY), and properly formats the data
(eg. BCD format is required for some frequencies while others can use actual Hz).
- The event is sent once user finishes editing the frequency and presses "SEND" or "XFER" buttons (or "IDENT" for transponder).
- In the case of XFER this takes care of the "frequency swap" event as well (or engaging IDENT for transponder).
- Determines and shows the name and current frequency of whichever component is being edited. Eg. if "COM2 STBY" is selected, this will be shown above the keypad along with the current value of that channel from the simulator. (Displaying COM3, NAV3-4, ADF, and XPNDR data requires custom SimVar requests as noted at the top of this page.)
The frequency keypad can currently handle active and standby COM 1-3, NAV 1-4 and ADF 1/2 components, as well as codes for XPNDR 1/2. TACAN is not currently supported, though adding it should be just some copy/paste and changing the SimConnect event and SimVar names as needed.
Video showing an earlier (unpublished) version in action: https://youtu.be/2lwvp7Zzwvg
Here is where things get a little tricky. As of Touch Portal v3.1b8 (and previous), there are some issues/bugs when importing pages which use global Values, and, especially Flows. More specifically, you must not import multiple versions of Values or Flows. Doing so creates duplicates in your TP setup, resulting in a non-working mess that needs to be cleaned up manually. Once you have imported the page once (along with the Values and Flows), you can make as many copies as you want.
I've provided the keypad page in 2 versions. ONLY IMPORT ONE OF THEM!
-
Includes the full version of the keypad (with buttons to select component/channel), as well as the "radio stack" elements on the same page. The idea here is you get all the parts in one place and can copy them to new pages as needed. To create a "popup" version of the keypad, just make a duplicate of the whole page, delete the radio displays and extra buttons, and simply reduce the column/row count of the page as desired. Same for the radio stack, but you'll need to move the buttons over before being able to shrink the page down.
-
A simpler version of the keypad meant to be used as a temporary page to edit a selected frequency/code and then return to the original page it was used from. This has all the features of the full keypad version from the previous page, w/out the white component/channel selection buttons. After importing this page you could then have button(s) on other pages which open the keypad with the desired component/channel already selected.
-
Download: MSFS_Frequency_Keypad_-_Popup_4x6-v2.tpz
Once you decide which version of the keypad you want to import, just go ahead and do that in TP, and make sure the Value and Flows option is selected during import.
If you want to re-import a page, or switch which version you import, you must first:
- Go into the TP Values tab and delete every Value with the "MSFS Keypad" name prefix.
- In the FLows tab, delete every Flow with "MSFS - Frequency Keypad" name prefix.
- You can keep the first page you imported if you want, but it will cease to function since all the Flows will be gone and will not link properly to the newly imported ones.
- After re-import, you will need to go through the initial setup steps (below) for a popup version to work again.
-
If you imported the full version of the keypad, the keypad part of this page should work "out of the box" with no further setup. Meaning you can select a component/channel to edit using the white buttons, enter a value and hit SEND (or XFER/IDENT) and it should work as intended. There's even a "debug" window at the bottom to show you what the keypad is sending to the plugin (the Event name and value). You don't even need to be connected to the simulator, though of course it won't show you any current frequencies in that case (or they will be from the last Sim session).
-
If you imported the popup version, or you want to create buttons for a popup version, or you're also using my standalone "Radio Stack" page, you'll need a couple steps to get that wired up properly.
- First decide which will be your "popup page". Any page with the keypad stuff on it will work (or w/out the keypad, but that wouldn't be very useful now, would it?).
- Go to the Flows tab, find the "MSFS - Frequency Keypad - Open Popup Page" Flow and edit it (double-click/r-click -> edit). You'll see something like the image at right (there are some comments at the top I cut out for this shot).
- In the first, "Go To Page," action in that flow, select the page you want to use for the popup keypad version.
- That's it, save the Flow.
- Now you can "hook up" buttons to actually open the keypad with desired component/channel selected. This is done by
executing that Flow you just edited (which perhaps is not very surprising given its name). To tell the Flow which
component/channel we want to edit, we first set some Local Values before executing the Flow.
- If you installed the "Kaypad and Radio" version or the standalone "Radio Stack" page, there are already examples
such buttons on the left side of each radio display (they even have little keypad icons... cute, right?).
Here is a screenshot of one of them being edited.
These buttons must be edited to select the correct Flow before they will work.
- If you installed the "Kaypad and Radio" version or the standalone "Radio Stack" page, there are already examples
such buttons on the left side of each radio display (they even have little keypad icons... cute, right?).
Here is a screenshot of one of them being edited.
- In any case, the setup is as shown in the screenshot.
- You need to, at least, set
Local Value 10
to the name of the system you want, and then execute the "Open Popup Page" Flow.- The component names are one of, exactly:
COM
,NAV
,ADC
, orXPNDR
.
(These correspond to the SimConnect Event IDs used to set the corresponding values.TACAN
may also work but I have not tested it.)
- The component names are one of, exactly:
- You need to, at least, set
- By default this will open Channel 1 of the Standby version of the specified component (except for XPNDR which has no "standby" concept).
- To specify a different channel, set
Local Value 09
to the desired channel number (1
,2
, etc), as shown in the screenshot here. - To open the keypad with the Active component selected, set
Local Value 08
to0
(meaning "not standby"). This is not shown here but use your imagination.
- To specify a different channel, set
That's it! To read some more details about what the different parts of the keypad do, scroll down to last section.
- Each radio's display is actually 3 buttons:
- Left side opens the frequency keypad to edit the current Standby frequency, or transponder code.
- Middle part swaps frequencies, or cycles Transponder mode.
- Right side toggles audio for that radio, or engages transponder IDENT.
- Indicators on right side show audio status (white), transmit status (on COMs, yellow), and IDENT status (on XPNDR, yellow).
- Shows tuned radio station ICAO codes and type/name.
- Transponder shows current mode, reported radio altitude and flight call sign.
- HSI (waypoint, bearing, distance, etc) data is displayed at the top. This part needs some work with formatting and such, and/or maybe to be replaced with pure GPS data like on a PFD.
This part is a lot simpler! Just download and import it. If you don't want the keypad popup entry feature, then nothing else needs to be done.
- Download: MSFS_Radio_Stack_1-4x7.tpz
This is actually also described above in "Popup Setup" section. More specifically:
- Edit the "Open Popup Page" Flow as described above in Edit the "Open Popup Page" Flow section above.
- On the Radio Stack page, edit each of the buttons which have the keypad icon on them (left side of each radio display) and select the "Open Popup Page" Flow for each one. The link gets lost during the import process, making this step necessary.
That's it!
(This is also described in notes in the downloadable page version, not shown in the screenshots.)
Keypad operates in two modes: "Normal" and "Popup". The white keys force "normal" mode and the radio stack buttons (at right) force "popup" mode.
In "popup" mode the Cancel/Back button appears and using SEND or XFER buttons will navigate to the "Previous Page" after using them.
The gray, black, and red buttons all provide keypad functionality. Their look/icons can be changed as desired as long as the Actions they perform stay the same.
The white buttons just switch between components and channels, they are not required for core keypad operation. Likewise the "MSFS - Frequency Keypad - Set Component Btn Visuals" Flow is only used for these particular buttons and is otherwise not required.
The LCD display shows current entry value and signals errors by flashing red. It is also responsible for triggering the Flows which show the currently selected component name/channel and current frequency above the LCD. The visuals can be changed but all the current On Event handlers in there should stay. If you're not a fan of the flashing LCD on errors, those events can be removed or changed as desired.
Above the LCD are two information-only buttons showing currently selected component and its current frequency. This is not technically required for operation.
The display under the keypad is just for testing and shows what the keypad sends to the plugin once Send or XFER/IDENT is pressed.
It can also be removed entirely, or placed somewhere else (all it does is display the ${value:msfs.keypad.debug}
global Value).