Other

项目介绍

Fragtality/PilotsDeck 是一个托管在 GitHub 上的开源项目,主要使用 C# 编写,采用 Other 许可证,目前获得 217 个 Star、25 次 Fork。

仓库全名
Fragtality/PilotsDeck
开源许可证
Other
Star 数
217
Fork 数
25
未关闭 Issue
3

README 摘要

PilotsDeck Directly check & control your FlightSim from the StreamDeck! 1 - Introduction PilotsDeck is a Plugin for Elegato's StreamDeck with the Ability to trigger Cockpit-Controls in different Ways and especially reading & displaying a Control's State on the StreamDeck as Text, Image, Bar/Arc or a Combination thereof. It is lean & mean, flexible, completely Open-Source and Free-to-Use. StreamDeck-wise it behaves…

完整内容见 GitHub 原始 README 或本页 。

常见问题

PilotsDeck 用什么语言开发?

主要使用 C# 编写,采用 Other 许可证,目前有 217 个 Star。

PilotsDeck 可以免费商用吗?

仓库标注的许可证为 Other,商用前请先阅读仓库 LICENSE 文件确认授权范围。

如何获取 PilotsDeck 的源码?

可以直接克隆仓库:git clone https://github.com/Fragtality/PilotsDeck.git;安装与运行步骤见仓库 README。

PilotsDeck 最近还在维护吗?

仓库最近一次更新为 6月25日,当前有 3 个未关闭 Issue;Star 数为 217,可作为社区活跃度的参考。

关于

Directly control the FlightSim from your StreamDeck!

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
484
价值分
159
活跃状态
活跃

语言占比

C#
CSS
HTML
JavaScript
Lua
PowerShell
TypeScript

Release

README

PilotsDeck

Directly check & control your FlightSim from the StreamDeck!

1 - Introduction

PilotsDeck is a Plugin for Elegato’s StreamDeck with the Ability to trigger Cockpit-Controls in different Ways and especially reading & displaying a Control’s State on the StreamDeck as Text, Image, Bar/Arc or a Combination thereof. It is lean & mean, flexible, completely Open-Source and Free-to-Use.

StreamDeck-wise it behaves like any other StreamDeck Plugin: it runs alongside other Plugins and you can Drag, Drop, Copy, Paste the Actions like any other Action in the StreamDeck Software between your Folders, Pages or even different StreamDecks. The Action Configuration is done through the standard “Property Inspector” of the StreamDeck UI (for the “classic” Actions) or its own “Action Designer” UI (for the new Composite Action). But regardless of the UI: the Configuration is stored in the StreamDeck Profile - You can create, export and share Profiles with the Plugin’s Actions. On Top of the StreamDeck builtin Copy & Paste, it has also its own Mechanic allowing to share single Actions via Text with someone else.

Installation is done through its own Installer which will check all Requirements and installs them for you if necessary. With the included Profile Manager App you can easily install Profile Packages (containing the Profiles, Images and Scripts) and can map your existing StreamDeck Profiles for specific Airplanes or Simulators so that the Plugin automatically switches the Profile(s) on the StreamDeck(s). You can write Scripts to directly read Values from a Function, or trigger a Function as Command - all in its own internal Lua Engine (Credits to: Neolithos for NeoLua!).
The Plugin supports different StreamDeck Models: Mini, Standard/15-Key, XL, Mobile and Plus. Other Models might work, but an indented Support for Non-Display Models is not planned. The Plugin runs only on Windows. There are no Plans for Linux or macOS Support (the first is not supported by StreamDeck at all, both do not run or support all Sims and some essential .NET Libraries are only available on Windows).

Simulator-wise it supports all major Platforms on Windows - MS Flight Simulator, X-Plane and Prepar3D. Depending on the Sim, it either uses SimConnect, FSUIPC or UDP Connection (remote capable). Either way it will connect automatically as soon as a Simulator is running. All Variables and Commands these Connections allow are usable with the Plugin. You can directly switch from one Sim to another without reconfiguring anything.
For Prepar3D (and theoretically FSX) FSUIPC is a Requirement, for MSFS it is Optional and for X-Plane not used at all. Either Way: you do not need a registered (bought) Copy of FSUIPC to make the Plugin in Work! (Though some old Profiles may require a registered Copy).

It is designed for advanced Sim-Users which “know how to do Stuff”: it does not give you any Lists to select Stuff from. If you know how to read Control-States for your Plane (e.g. which Variables to use) and how to trigger these Controls (e.g. which Command to use), you can quickly define Actions for that on the StreamDeck. Since it does not limit your Selection by a predefined List, you can do everything the Connection/Simulator currently allows 😉
If you don’t: be eager to read & learn! 😅 I’ll try to give some Background in the Readme, but you have to take it from there!

Note: PilotsDeck is 100% free and Open-Source. The Software and the Developer do not have any Affiliation to Flight Panels. You basically spend Money instead of Time to let a Power-User create the Profile(s) for you. That is totally fine - IF you knew you had the Option. Choose the Approach that suits you best! 😃

StreamDeck Clones This Plugin only supports Elegato’s StreamDeck and there are no Plans to change this!
For MiraBox/HotSpot Devices you can use JKWTCN’s PilotsDock-Fork 👍

User-Contributed and my Profiles for specific Planes are shared/linked under Integrations. Since there aren’t that many: If your Plane is not among these, they can at least serve as Example on what you could do:



Other Examples can be found under here.



1.1 - Supported Simulator Versions

Simulator Supported Tested Connection
Flight Simulator 2024 yes yes SimConnect & MobiFlight WASM (Secondary: FSUIPC7)
Flight Simulator 2020 yes yes SimConnect & MobiFlight WASM (Secondary: FSUIPC7)
Flight Simulator X yes no FSUIPC4
Flight Simulator 2004 yes no FSUIPC 3
Prepar3D v5 yes yes FSUIPC 6
Prepar3D v4 yes no FSUIPC 5/6
Prepar3D v1-3 yes no FSUIPC 4
X-Plane 12 yes yes UDP or WebAPI (local/remote)
X-Plane 11 yes yes UDP (local/remote)
X-Plane <=10 yes no UDP (local/remote)

Supported is understood as “technical and basically supported by the Connection Method”. Support in Terms of ensured Compatibility, Fixing Issues and giving Support exists only for the latest Version of the three Major Simulators: MSFS2020, X-Plane 12, P3D v5. I’m happy if it works for older Versions, but I won’t make any Effort for them. It is time to go back to the Future! 😅
And yes: the latest Version for Prepar3D is still considered v5, since v6 was just DOA with nearly every Addon-Dev announcing to not support it.


1.2 - Supported Sim-Commands & -Variables

Here a quick Overview of what you can send to the Simulator (“Command”) or from what you can read Values from the Simulator (“Variable”). One of the Things which make the Plugin flexible: Variables can also be used as Commands. For Example to move a Cockpit-Control by writing a different Value to a Variable.

How Commands and Variables are configured and the different Options how they can be executed is described under 2.1 - Defining Commands & Variables.

ID Description Command Variable Simulators
MACRO Execute any Macro known to FSUIPC ✔️ ✖️ MSFS, P3D, FSX
SCRIPT Run any Lua-Code known to FSUIPC ✔️ ✖️ MSFS, P3D, FSX
CONTROL Send any SimEvent defined by its numerical ID ✔️ ✖️ MSFS, P3D, FSX, FS9
LVAR Read from / Write to any L-Var (“Local Variable”) ✔️ ✔️ MSFS, P3D, FSX
OFFSET Read from / Write to any FSUIPC Offset ✔️ ✔️ MSFS, P3D, FSX, FS9
VJOY Toggle/Clear/Set a Button of a virtual Joystick from FSUIPC ✔️ ✖️ MSFS, P3D, FSX
VJOYDRV Toggle/Clear/Set a Button of a virtual Joystick from the known vJoy Device Driver (if installed) ✔️ ✖️ ALL
AVAR Read from / Write to any Simulation Variable (also known as A-Var) ✔️ ✔️ MSFS
KVAR Send / Write to any Event-ID (also known as K-Var / SimConnect Event) ✔️ ✔️*** MSFS
HVAR Trigger any HTML Event in the Simulator (also known as H-Var) ✔️ ✖️ MSFS
BVAR Trigger InputEvents (also known as B-Var) - but only those that MSFS enumerates via SimConnect ✔️ (✔️)* MSFS
CALCULATOR Run any Calculator/Gauge Code in the Simulator ✔️ ✖️** MSFS
XPCMD Send any Command known to X-Plane (as command_once) ✔️ ✖️ XP
XPWREF Read from / Write to any X-Plane DataRef ✔️ ✔️ XP
LUAFUNC Run a Lua Function in the Plugin’s own Lua Engine ✔️ ✔️ ALL
INTERNAL Read from / Write to an internal Variable (available everywhere within the Plugin) ✔️ ✔️ ALL

* = Per Default, B-Vars treated as Command-only Type - only some B-Var have an actual Value to read.
** = Reading from a RPN Expression is now considered deprecated - use Composite Actions and/or Lua Scripts as Replacement.
*** = Will only be updated when the Event is received.
:grey_exclamation: Please mind that the Command Types Script, Macro, Lvar (on P3D/FSX) and vJoy can only work with a registered Version of FSUIPC!
:grey_exclamation: Both vJoy Command Types are independent of each other and are two different Things! “VJOY” can only be assigned within FSUIPC (and not in the Simulator). The “VJOYDRV” can be assigned by anything which understands a Joystick Button (Simulator, FSUIPC, Addons, …).


1.3 - Available StreamDeck Actions

All Actions work on the Keypads (the normal/square StreamDeck Buttons). The Dial/Touchpad (aka Encoder) on the SD+ is supported by most Actions.

Action Name Keypad / Encoder Description
Display Value* Keypad / Encoder Display a Sim Variable as Number or Text (display “ON” instead of “1”). You can scale/round/format the Value as needed and customize the Font-Settings.
Simple Button Keypad Can only send Commands and always shows the same (configurable) Image. Supported in StreamDeck Multi-Actions!
Dynamic Button Keypad / Encoder This Action dynamically changes the displayed Image based on a Variable (in Addition to sending Commands). Different Values trigger different Images.
Korry Button Keypad / Encoder Intended for Korry-Switches in the Cockpit: the Action displays two “Sub-Images” independently of each other. They are shown/hidden based on their own Variable, but will not change the Image based on the Value.
COM Radio Keypad / Encoder Intended for Com Frequencies: the Action shows two different Variables which can be independently scaled/rounded/formatted but share the same Font-Settings.
Display Gauge Keypad / Encoder This Actions renders the Value dynamically on a Bar or Arc. Size, Color, Position and Font-Settings can be tweaked. It can optionally send Commands.
Display Gauge (Dual) Keypad As before, but it renders two Values dynamically on the same Bar or Arc.
Composite Action Keypad / Encoder Not a fixed Template as the other Actions, more a Canvas to draw on: you can add and freely configure different “Elements” (like Text, a Value, an Image) which can be dynamically altered via “Manipulators” on certain “Conditions”. Configured in its own dedicated “Action Designer” UI.
Profile Switcher Keypad This not a “real” Action like the others, it only serves to enable/disable Profile Switching.

* = As an experienced User you might miss the “Display Value with Switch” Action - it was renamed to “Display Value” in Version 0.8.0. The Former “Display Value” Action (without Switch) is still there and will keep working, it is just hidden from the Selection now. You can’t create them anymore, but still run them!

See 2 - Action Configuration how to configure these Actions.
How to add Custom Images is described under 3.3 - Custom Images.




1.4 - Install, Update, Remove

Just Download & Run the Installer Binary! It will check and install all Requirements and installs/updates the Plugin (or remove it).
On the second Installer Page are some Options to customize your Installation:

  • Desktop Icon to the Profile Manager App
  • Enable (and Check) FSUIPC7 as secondary Connector for MSFS
  • Install/Update the vJoy Driver

:exclamation: For MiraBox/HotSpot Devices use the PilotsDock-Fork by JKWTCN 👍


You do not need to remove the old Version for an Update - using ‘Remove’ in the Installer will also remove all custom Images and Scripts!

:warning: It is highly likely that you need to Unblock/Exclude the Installer & Plugin from BitDefender and other AV-/Security-Software. It’s the number one Reason for “the Plugin is not working”-Issues because either the Binary is blocked from running or is blocked when connecting to the StreamDeck Software.

:warning: DO NOT run the Installer, Plugin or StreamDeck Software “as Admin”. It is not recommended to MSFS or FSUIPC7 “as Admin” - it might work, it might fail.
If it still does not work right or at all, please check 4.2 - Troubleshooting.

The Requirements for the Plugin:

  • Windows 10 or 11 (updated)
  • StreamDeck Software v7.4 and above - The StreamDeck Software will be installed/updated by the Installer, if necessary. (No Guidance on the StreamDock Version)
  • .NET 10 - The x64 Desktop Runtime will be installed/updated by the Installer, if necessary.
    • :warning: Reboot recommended when the Runtime (in that Major-Version) was installed for the first Time!
  • If used for MSFS/P3D/FSX: The latest Release of the FSUIPC Major Version specific to your Simulator (e.g. FSUIPC 6 for Prepar3D v4/5) - will be installed/updated by the Installer, if necessary.
  • If used for MSFS: The latest Release of the WASM-Module from MobiFlight - will be installed/updated by the Installer, if necessary.
  • Optional: If you want to use VJOYDRV Commands you need the BrunnerInnovations Fork of the vJoy Driver - the Installer will check the State, and offers to optionally install/update it for you.
    • :warning: If you install the vJoy Driver for the first Time, don’t forget that you need to enable at least one Joystick (configured to have 128 Buttons) in the vJoyConf Application to use it!

Install Location for Elegato StreamDeck: %appdata%\Elgato\StreamDeck\Plugins\com.extension.pilotsdeck.sdPlugin

The Plugin is automatically started with the StreamDeck Software. It will spawn its own Icon in the System-Tray / Notification Area. Use this Icon to see if a Plugin Update is available, to access the Developer UI or open the Profile Manager to configure Profile Switching.


Note: Since FSUIPC is only a “secondary” Connector for MSFS, you do not need to have it installed anymore (for MSFS). If you not plan to install/run FSUIPC7, uncheck the respective Option in the Installer!
But be aware that some older Profiles might still use Commands and Variables from FSUIPC and might not fully work then.




1.5 - Installing Profile Packages (.ppp Files)

Starting with Version 0.8.0, the Plugin greatly improves Distribution and Installation of Profiles:

  1. Use the Profile Manager App found in the Plugin Directory to install Profile Packages: Open it via Plugin Icon in the System-Tray / Notification Area and drop the Package File to be installed on the big Arrow (or navigate to Package File’s Location).


  2. The Package File will be read and the Description (from the Author) will be displayed - check the Notes for additional Steps.



  3. If you already have Profiles with the same Name (as shown in the StreamDeck UI), the App will remove the old Profiles (and update existing Profile Mappings to the new ones). If want to keep the old Profiles, uncheck ‘Remove old Profiles’.
    If you want to keep the extracted Package Contents, check Keep extracted Files …. The Contents will be kept in Profiles Sub-Folder of the Plugin (named after the Package Name).

  4. Click Install. Note that the StreamDeck Software will be automatically started and stopped as needed.

  5. The App will extract and copy the Images and Scripts to the Plugin Directory for you.
    The Profiles need to be installed through the StreamDeck UI: Click on the Link displayed in the Profile Manager App, wait for the StreamDeck UI to come up and the select the correct StreamDeck to install the clicked Profile to. Repeat for each Profile. NOTE: All Profiles in the Package must be either installed or ignored before the Installation continues!
    You need to click every Link for the Installation to finish successfully. If you do not want or need one of the Profiles, just Cancel the Installation in the StreamDeck UI!


  6. If selected, the App will now remove the old Profiles (if your updating existing Profiles), remove the “Copy” from the Profile Name (of the new ones) and update the Profile Mappings (if there are existing Mappings).
    NOTE: The Update-Mechanic will only work, if you keep the Profile Name.


  7. The Package Author can include additional Files you might to install/use the Profiles. If so, you will find a Folder on your Desktop (named after the Package’s Name) with these additional Files.

See 3.6 - Profile Packages on how to create a Profile Packages to share your own Profiles!






2 - Action Configuration

Since the Plugin is very flexible, there is a “little” Learning Curve 😳 So I tried to break it down into 4 Parts:

  • First of starting with the various Commands and Variables that can be defined in 2.1 - Defining Commands & Variables. Triggering Actions in the Sim and reading Values from it is the Foundation to get any Use out of the Plugin!
    I try to give some basic Examples, Tips and Background as a basic starting Point.
  • The second Part 2.2 - Common Options describes the Common Options & Behavior which all or most Actions share, except for the Composite Action.
  • In the third Part 2.3 - Action specific Options you’ll find a Description of each Action (except the Composite Action) on how they work and how they can be customized with their specific Options.
  • In the forth Part 2.4 - Composite Action you’ll find the Documentation for the Composite Action.

Some Command/Variable Types have a Reference to look them up - you can quickly open those References in the “QRH” Section of the Developer UI (accessible via the Tray-Icon of the Plugin).


:rotating_light: Youtube Guide: The Creator aimoii uploaded a Step-by-Step Series on his Youtube Channel on how to configure the Plugin Actions! Check it out and leave a Like ❤️


2.1 - Defining Commands & Variables

One of PilotsDeck’s Core-Concepts is: everything has/is an Address. So whether it is a Variable to read (e.g. L-Var/DataRef/Offset) or a Command to send (e.g. Control, Script, Calculator-Code): it is identified by the Address. A Command is defined by its Type and Address in the UI. A Variable for reading only by the Address.

Every Type needs a specific Address Syntax to be used in the Command Address Field. Some Commands/Variables require extra Parameter and some Commands can also be sequenced. That means the Plugin will send multiple Commands with just one Button-Press!

The Property Inspector UI/Action Designer UI has a Syntax-Check build in for every Type except for Calculator: When the Syntax is correct, you see a little Check-Mark in the Input Field or a red/green Border around the Input Field. Everything you enter will also checked more thoroughly by the Plugin before it executes a Command (if possible/trackable).
If a Command could not be executed by any Reason (invalid Syntax, Sim not connected) the Keypad will show a yellow Alert Sign briefly on the Display. On an Encoder the Touch-Display will shortly flash in red in that Case. (The standard StreamDeck Mechanic how Actions can show an Error/Warning)

Commands available on all Actions except the Composite Action:

  • Actions on Keypads have a Main Command and an optional Second Command when pressed longer (>= 500ms).
  • Actions on Encoders have the Dial Left Command, Dial Right Command and the Touch Command in Addition to Main and Second - these two will be used when you press the Encoder.
  • Actions on Encoders can have additional and different Commands assigned when the Dial is turned when pressed (Dial Left Pressed Command and Dial Right Pressed Command).
    • When the Pressed Commands are not assigned, the (normal) Left/Right Commands are executed regardless if the Dial is pressed or not.
    • It is not advised to map a Main or Second Command when the Left/Right Pressed Commands are mapped (maybe besides some special Use-Cases to track/prepare/cleanup some State when the Dial was pressed).
    • Any assigned Main/Second Command is executed in any Case when the Dial is pressed (and released).
  • All Actions can have an optional Guard Command to be executed before the Main and Second Command.
  • The different Commands can each use a different Type, they don’t need to be the same - the Main Command could be SCRIPT, the Left/Right Command could be CALCULATOR and the Touch Command LVAR for Example (but note that they share some Settings).

Commands available on the Composite Action:
  • Every (Composite) Action always supports every StreamDeck Event (KEY_DOWN, KEY_UP, DIAL_DOWN, DIAL_UP, DIAL_LEFT, DIAL_RIGHT, TOUCH_TAP, DIAL_LEFT_PRESSED, DIAL_RIGHT_PRESSED), regardless on which StreamDeck it is currently on.
  • You can add every Command the Plugin offers to every Event the StreamDeck sends. (But: adding a Command to DIAL_UP on a Keypad will do nothing, for example)
  • For both _UP Events, you can configure Commands to be only executed after an individual Down-Time - like the Second Command from the other Actions. BUT: you can have multiple of those with different Times!
  • Every Command can have one or more Conditions: The Command will only be run when all (or at least one) Condition is true. You can use any Variable the Plugin & Sim supports for these Conditions.
  • You can add multiple Commands per Event, they will be run in Sequence then with a configurable Delay per Event. (But only if their configured Conditions are met)
  • Regarding the Left/Right Pressed Commands, the same Statements and Recommendations apply: UP/DOWN should not be mapped (since they are executed in any Case) and if PRESSED is not mapped, the normal LEFT/RIGHT Command is executed



2.1.1 - Address Syntax


MACRO
Command MSFS, P3D, FSX File:Macro(:Macro)*
  • File: The Filename without Extension of the FSUIPC Macro-File.
  • Macro: One or more Macros from that File to be executed in sequence.

Examples:

  • QW787_MAIN:QW_ENG1_START - Run Macro QW_ENG1_START from Macro-File QW787_MAIN.MCRO.
  • FSLA3XX_MAIN:ACPACK1:ACPACK2 - Run Macro ACPACK1 from Macro-File FSLA3XX_MAIN.MCRO and then ACPACK2 from the same File.

Background:
Macro Files are a rather “rudimentary and legacy” Way to Script Actions in FSUIPC. In my Profiles I only use them in Prepar3D for “Mouse-Macros” which are able to Click Controls that can only be triggered with the Mouse (note: Mouse-Macros are not supported on MSFS). So if you don’t know and have Macros, your Time is better invested to look at Lua (or maybe even RPN) :wink:

If you want to learn more about Macros, look at the “FSUIPC7 for Advanced Users” Document in your My Documents\FSUIPC7 Folder (or \FSUIPC6 for P3D)!


SCRIPT
Command MSFS, P3D, FSX (Lua|LuaToggle|LuaSet|LuaClear|LuaValue):File(:Flag)*
  • Lua…: The different Lua Controls defined by FSUIPC, you need to define exactly one.
  • File: The Filename without Extension of the Lua-File known (!) to FSUIPC.
  • Flag: Zero or more optional numeric Parameters to pass to the Lua-Script in sequence (for Toggle, Set, Clear or Value).

Examples:

  • Lua:Baro_Toggle - Run Lua-Script Baro_Toggle.lua.
  • LuaToggle:FNX320_AUTO:12 - Toggle Flag 12 for Script FNX320_AUTO.lua.
  • LuaValue:Pilotsdeck_FSL:271:1 - Send Value 271 to Script Pilotsdeck_FSL.lua and then send Value 1 to the same Script.

Background:
The ability to run Lua Files is the greatest Benefit of the registered (bought) FSUIPC Version - at least for me! Lua-Code is easier to write, understand and are more flexible than Marcos and allow to read or send anything that FSUIPC can read or send from/to the Simulator. They allow to run more advanced Logic on Joystick-Buttons (i.e. let the Button do two different Things depending on being on the Ground or in the Air). The Plugin allows you to run such Scripts via the StreamDeck.

If you want to learn more about Lua-Scripts, look at the “FSUIPC Lua Plug-Ins” and “FSUIPC Lua Library” Documents in your My Documents\FSUIPC7 Folder (or \FSUIPC6 for P3D)! Look at the event.flag and event.param Functions to understand how to use the LuaToggle and LuaValue Lua-Controls.

NOTE: Do not confuse with the Scripts for the internal Lua Engine - this Command is only to trigger Scripts in FSUIPC that are written for FSUIPC!

Note for X-Plane Users: You can achieve the same (and sometimes more) with the FlyWithLua Plugin for X-Plane! The Lua-Scripts there can define “Custom Commands” and “Custom DataRefs” which then can be used from the Plugin (or the Sim) like any other X-Plane Command or DataRef.


CONTROL
Command MSFS, P3D, FSX, FS9 Control=Parameter(:Parameter)*(:Control=Parameter(:Parameter)*)*
  • Control: The numerical ID of the Control (aka Event-ID). Multiple Controls can be separated with a : Sign.
  • Parameter: Zero or more optional Parameters for that Control. The first Parameter needs a preceding = and following Parameter are separated with : again.

Examples:

  • 66168:65567 - Send Control 66168 and then send Control 65567.
  • 66587=72476:72478 - Send Control 66587 with Parameter 72476 and then Control 66587 with Parameter 72478.
  • 67195=3:67191=3:4 - Send Control 67195 with Parameter 3 and then Send Control 67191 with Parameter 3 and after that with Parameter 4.

Background:
In Essence, these Control-Codes are the numerical ID of the standard SimEvents documented in the MSFS/P3D/FSX SDK. Some Planes might react to every Event, some only to a Part/Fraction, some can’t be interfaced with any of those Events. Some might even use an existing Event and use the Parameter for “custom Events” (e.g. PMDG and FSLabs with their “ROTOR_BRAKE” Events).
Note that these are the same as “Simconnect Events”, “K-Vars” or “Key-Events” - For MSFS, you can achieve the same with using KVAR (or CALCULATOR) and the textual ID of that Event! It’s two different Sides of the same Coin :wink:

You can find a full List in the “Controls List…” Text-File in your My Documents\FSUIPC7 Folder (or \FSUIPC6 for P3D) - Check the “QRH” Section of the Developer UI for a direct Link (accessible via the Tray-Icon of the Plugin)!


LVAR
Command & Variable MSFS, P3D, FSX (L:)Name
  • Name: The Name of the L-Var with or without preceding L:. Since L-Vars in MSFS can have very “unusual” Characters in their Name, it is recommended get into the habit to always add the L: Prefix!

Examples:

  • L:I_OH_FUEL_CENTER_1_U - Read from the L-Var I_OH_FUEL_CENTER_1_U.

When used as Command, you need to specify the On Value and the Off Value. The Plugin will toggle between these two Values and writes them to the Variable.
In addition to writing plain Values, the Plugin can also do simple Operations like increasing/decreasing the Value or toggling the Value in a defined Sequence. Look under Command Options for Details.

NOTE for MSFS: All L-Vars will be request with ‘Number’ as their Unit. Depending on how the Developer writes the Variable, this can lead to strange Results (e.g. getting the Value 0.174533… for an Heading of 10). If you come across such Variables, use an AVAR Variable with the required Unit!

Background:
Local Variables (sometimes “Local Gauge Variables”) are created and updated by the Plane. There are no standard L-Vars which could be used on every Plane. There is also no communality if and which L-Vars a specific Plane has. For some Planes it is the official Way to Read and Trigger Cockpit-Controls (e.g. Fenix, QualityWings). For some it is only for Read (e.g. PMDG). For some they exist, but are not really supported or usable sometimes (e.g. FSLabs).
But they are not only used by Planes. Some Addons like GSX also create and update L-Vars which can be used to interface with them!

You can list all currently registered L-Vars in the FSUIPC7 UI (Add-ons -> WASM -> List Lvars).
Another great Source for L-Vars and (other Stuff) is HubHop by MobiFlight - Check the “QRH” Section of the Developer UI for a direct Link (accessible via the Tray-Icon of the Plugin)!


OFFSET
Command & Variable MSFS, P3D, FSX, FS9 (0x)Address:Size(:Type:Signedness|BitNum)
  • Address: The Address of the FSUIPC Offset as 4-Digit Hexadecimal Number, as documented in FSUIPC. The Hex Prefix 0x is Optional.
  • Size: The Size of this Offset in Bytes. A 1-digit (Decimal) Number.
  • Type: Specify if the Offset is an Integer i, Float/Double f, Bit b, String s or Byte Array a. Defaults to :i if not specified.
  • Signedness: Specify if the Offset is Signed s or Unsigned u. Defaults to :u if not specified (only relevant for Integers).
  • BitNum: Only for Offset-Type Bit, the Number/Index of the Bit to read from or write to.

Examples:

  • 2118:8:f - Read a 8 Byte long float Number from Address 2118 (“Turbine Engine 2 corrected N1”).
  • 3544:4:i:s - Read a 4 Byte long signed integer Number from Address 3544 (“standby altimeter in feet”).
  • 0x0ec6:2:i - Read a 2 Byte long unsigned integer Number from Address 0EC6 (“Pressure QNH”).
  • 0x5408:10:s - Read a 10 Byte long String from Address 5408.
  • 0x0D0C:2:b:1 - Read Bit 1 from the 2 Byte long Bitmask at Address 0D0C (Nav Lights).
  • 0x5800:1024:a - Read a 1024 byte array from Address 5800 (Reads the right CDU screen contents on PMDG aircraft)

Before you use an Offset as Command, make sure that it is writeable (some are read-only)! When used as Command, you need to specify the On Value and the Off Value. The Plugin will toggle between these two Values and writes them to the Variable. Use only 1 or 0 for Bit-Offsets. For byte array offsets, you can either specify the new value as a hex string prefixed with 0x (e.g. 0xdeadbeef) or a JSON-like array of hex strings (prefixed with 0x) or decimal numbers (e.g. [26,0x3f]).
In addition to writing plain Values, the Plugin can also do simple Operations like increasing/decreasing the Value or toggling the Value in a defined Sequence. Look under Command Options for Details.

Note on Byte Arrays: Their main Purpose is to be used in Lua Scripts - they are not intended (and not tested!) to be used in Actions as Commands or Variables. Check the Global Scripts Section to see an Example on how Byte Arrays can be used in Lua.

Background:
These Offsets are the way how FSUIPC makes Simulator Variables (also known as A-Vars) accessible to outside Applications (like my Plugin or some Flight Trackers for Example). FSUIPC sticks with that Concept for historical and compatibility Reasons. But not all Offsets are Simulator Variables: the Benefit of that System is that Applications can exchange Data through FSUIPC Offsets. For Example PMDG or Project Magenta use assigned Offset Ranges to share their Data.
Since most Offsets represent Simulator Variables, you can achieve the same Thing with the AVAR Type in MSFS. Not all Simulator Variables are exported by FSUIPC (like “FUELSYSTEM PUMP SWITCH” for Example) - in that Cases you need to read this Variable via AVAR.

You can find the full List of available/official Offsets in the “FSUIPC Offsets Status” Document in your My Documents\FSUIPC7 Folder (or \FSUIPC6 for P3D) - Check the “QRH” Section of the Developer UI for a direct Link (accessible via the Tray-Icon of the Plugin)!



VJOY
Command MSFS, P3D, FSX Joystick:Button(:t)
  • Joystick: The Number of the virtual Joystick to use, as documented in FSUIPC (Joystick 64 - 72).
  • Button: The Number of the Button on that Joystick (Button 0 - 31).
  • Toggle: The specified Button is handled as toggleable Button: The Plugin toggles the State of that Button between pressed and unpressed (it will remain in that State). Without this Option, the Keypad works like a normal Joystick-Button (it stays pressed as long as you press the Keypad).

Examples:

  • 64:4 - The Keypad on the StreamDeck is recognized as Joystick 64, Button 4 in FSUIPC.
  • 72:2:t - The Keypad on the StreamDeck will toggle Joystick 72, Button 2 between pressed and unpressed in FSUIPC.

The additional Long Press Command will not be available when you use a non-toggling vJoy for the normal/short Press!
The VJOY Command can also be used on the Encoders and the Touch-Display. On these Interactions a non-toggle vJoy will be shortly pressed. A toggling vJoy will be toggled on every Interaction.

Background:
The virtual Joystick Facility of FSUIPC has nothing to do with the System Driver and can be used independently. So the Use-Cases are very narrow, but it can be a useful Feature. When you want to stick of doing your Mappings and Assignment mainly in the FSUIPC UI, you could use these vJoys to map the StreamDeck Keypads/Encoders.


VJOYDRV
Command ALL Joystick:Button(:t)
  • Joystick: The Number of the virtual Joystick to use, as you configured in vJoyConf (Joystick 1 - 16).
  • Button: The Number of the Button on that Joystick (Button 1 - 128).
  • Toggle: The specified Button is handled as toggleable Button: The Plugin toggles the State of that Button between pressed and unpressed (it will remain in that State). Without this Option, the Keypad works like a normal Joystick-Button (it stays pressed as long as you press the Keypad).

Examples:

  • 1:2 - The Keypad on the StreamDeck will set/clear Button 2 on the virtual Joystick 1.
  • 2:3:t - The Keypad on the StreamDeck will toggle Button 3 on the virtual Joystick 2 between pressed and unpressed.

Non-Toggling vJoy Buttons will behave like any normal Joystick Button - they are down/set as long as the StreamDeck Key/Dial is down (and go up/cleared when the Key/Dial goes up again). NOTE: On the Composite Action, you have to map the intended (non-toggling) vJoy Address to both the KEY_UP and KEY_DOWN (or DIAL_UP/DIAL_DOWN) Events!
The additional Long Press Command will not be available when you use a non-toggling vJoy for the normal/short Press!
The VJOYDRV Command can also be used on the Encoders and the Touch-Display. On these Interactions a non-toggle vJoy will be shortly pressed. A toggling vJoy will be toggled on every Interaction.

Background:
Using virtual Joysticks is really a great Feature and Solution for specific Use-Cases! For Example when you want to press and hold Cockpit-Controls from the StreamDeck (e.g. Fire-Test Buttons). Or when the Simulator has Commands which can only be triggered with a Joystick-Mapping (e.g. Custom Cameras in MSFS). It is especially useful in X-Plane to circumvent the API-Limitation that X-Plane Commands can only be send as “command_once”.


AVAR
Command & Variable MSFS (Prefix:Name(:index), Unit) | (Prefix:Name:'Named_Index'_n, Unit)
  • Prefix: The Prefix for the Variable: A: for Simulation Variables, E: for Enviroment Variables, L: for Local Variables (L-Vars)
  • Name: The Name of the Variable as published. The whole Expression must be enclosed by Parenthesis ( ).
  • :index: (Optional) The Index to access, if the A-Var is a Map/Enum/Mask.
  • Unit: The Unit of the A-Var as published separated by a , from the Name.

Examples

  • (A:FUEL RIGHT QUANTITY, Gallons) - Reading the A-Var FUEL RIGHT QUANTITY using Gallons as Unit.
  • (A:FUELSYSTEM PUMP SWITCH:2, Bool) - Reading Index 2 of the A-Var FUELSYSTEM PUMP SWITCH as Bool Value.
  • (A:LIGHT POTENTIOMETER:13, percent over 100) - Reading Index 13 of the A-Var LIGHT POTENTIOMETER as Percent over 100 Value (0.0 - 1.0).
  • (L:FCU_HEADING, Degree) - Reading the L-Var FCU_HEADING using Degree as Unit.
  • (E:ZULU TIME, number) - Reading the Enviroment Variable ZULU TIME.
  • (A:ELECTRICAL BUS VOLTAGE:'Bus_1'_n, Volts) - Read the Named Index Bus_1 from the ELECTRICAL BUS VOLTAGE Variable

Before you use an A-Var as Command, make sure that it is writeable (some are read-only)! When used as Command, you need to specify the On Value and the Off Value. The Plugin will toggle between these two Values and writes them to the Variable. Use only 1 or 0 for Booleans.
In addition to writing plain Values, the Plugin can also do simple Operations like increasing/decreasing the Value or toggling the Value in a defined Sequence. Look under Command Options for Details.

Background:
A-Var (or SimVars) are the standard Simulator Variables defined by Flight Simulator (2020 and Predecessors). There are no “custom” A-Vars. Default Planes normally only use A-Vars but complex and externally simulated Planes use/update only a Fraction of them. MSFS still sticks to the legacy System of many different and weird Units which have to be passed for Access to a Variable.
Since the Plugin can access all A-Vars, you can use Variables which are not exported as FSUIPC Offset without the Need of defining a myOffsets File for FSUIPC. Or even to completely circumvent FSUIPC Offsets at all if you prefer calling Things by their Name :wink:

A full List of all A-Vars with their according Unit (and if writable) can be found in the SDK under Simulation Variables - Check the “QRH” Section of the Developer UI for a direct Link (accessible via the Tray-Icon of the Plugin)!


KVAR
Command or Variable MSFS (K:)Name(:Parameter){0,5}) | (K:)Name:Parameter(:(K:)Name:Parameter)* or K:Name

Single K-Var with multiple Values:

  • Name: The Name of the K-Var to be set with or without preceding K:. Numeric Names (PMDG et. al.) must be prefixed with an Hashtag (e.g. #12345).
  • Parameter: Zero to Five Parameters to be set on this K-Var (positive integer Value, can be given as Hexnumber prefixed with 0x)

Sequence of multiple K-Vars:

  • Name: The Name of the K-Var with or without preceding K:. You can send multiple Event in a Sequence if you separate them with a : Sign.
  • Parameter: The first Index/Parameter (required) to set (positive integer Value). Each K-Var in the Sequence needs exact one Parameter! (Just take 0 or 1 if you don’t have a specific Value)

Using a K-Var as Variable:

  • The Name must be preceded with the K: Prefix!
  • The initial Value will be 0 and will only change if the Event is actually received
  • The Value will only reflect the first Index of a K-Var

Examples

  • K:TOGGLE_ALTERNATOR1 - Send the Event TOGGLE_ALTERNATOR1.
  • AP_SPD_VAR_INC:1:AP_SPD_VAR_INC:1 - Send the Event AP_SPD_VAR_INC two Times.
  • K:FUELSYSTEM_PUMP_TOGGLE:3 - Send the Event FUELSYSTEM_PUMP_TOGGLE with Value 3.
  • K:LIGHT_POTENTIOMETER_SET:84:50 - Send the Event LIGHT_POTENTIOMETER_SET with Values 0 => 84 1 => 50.
  • K:#69650:0x20000000 - Send the PMDG Event 69650 (aka EVT_OH_ELEC_CAB_UTIL) with Hex Value 0x20000000.

Background:
Think of K-Vars are the standard SimConnect Events defined by the Simulator. Some Planes might react to every Event, some only to a Part/Fraction, some can’t be interfaced with any of those Events. Some might even use an existing Event and use the Parameter for “custom Events” (e.g. PMDG and FSLabs with their “ROTOR_BRAKE” Events).
Although they are called “Variable” and you can set a Value on some, they can’t be read - typically the Sim Event (K-Var) updates the according Sim Variable (A-Var)!

A full List can be found in the Flight Simulator SDK under Event IDs - Check the “QRH” Section of the Developer UI for a direct Link (accessible via the Tray-Icon of the Plugin)!
Another great Source for K-Vars and (other Stuff) is HubHop by MobiFlight - Check the “QRH” Section of the Developer UI for a direct Link (accessible via the Tray-Icon of the Plugin)!


HVAR
Command MSFS Name(:Parameter)(:Name(:Parameter))*
  • Name: The Name of the H-Var with or without preceding H:. You can activate multiple H-Vars in a Sequence if you separate them with a : Sign.
  • Parameter: An optional Parameter (numeric Value) to send (not all H-Var support/have that)

Examples

  • A32NX_EFIS_L_CHRONO_PUSHED - Activate the H-Var named A32NX_EFIS_L_CHRONO_PUSHED.
  • A320_Neo_CDU_1_BTN_F:A320_Neo_CDU_1_BTN_L - Activate H-Var A320_Neo_CDU_1_BTN_F first and then activate H-Var A320_Neo_CDU_1_BTN_L.
  • H:A2A_AVIONICS_SWITCH:1 - Activate H-Var A2A_AVIONICS_SWITCH with Value 1.

Background:
H-Vars are a new Simulation Variable Type that came with MSFS and work roughly similar like K-Vars - they trigger an Event but can’t be read. Note that you don’t need to configure and use the Hvar-Files from FSUIPC for the Plugin. You can use any known and existing H-Var from the Plugin directly.

A great Source for H-Vars and (other Stuff) is HubHop by MobiFlight - Check the “QRH” Section of the Developer UI for a direct Link (accessible via the Tray-Icon of the Plugin)!


BVAR
Command or Variable MSFS Name(:Parameter)(:Name(:Parameter))* or B:Name

Command:

  • Name: The Name of the B-Var with or without preceding B:. You can activate multiple B-Vars in a Sequence if you separate them with a : Sign.
  • Parameter: An optional Parameter (numeric Value) to send (not all B-Var support/have that)

Variable:

  • Name: The Name of the B-Var with preceding B:!

Examples

  • B:AUTOPILOT_Heading_Sync - Send the InputEvent named AUTOPILOT_Heading_Sync.
  • B:AUTOPILOT_Heading:-1 - Send the InputEvent name AUTOPILOT_Heading with Value -1.
  • AUTOPILOT_Heading:-1:AUTOPILOT_Heading:-1 - Send the Input Event name AUTOPILOT_Heading with Value -1 two Times.
  • B:AIRLINER_Knob_Seatbelts - Read the InputEvent Value of AIRLINER_Knob_Seatbelts.

Background:
B-Vars (or InputEvents) are an new Addition from MSFS to the “Variable-Zoo”, but they come with a Twist: Some of those work like any other Variable Type (e.g. L-Var, A-Var) - you can read and update their Value.
Some (most?) of those work like any other Command Type (e.g. K-Var, H-Var) - you can’t read their Value, but you can send/activate them with an optional Parameter.
On top of that, MSFS only makes certain InputEvents (the “_Set” Events) available to outside Applications via SimConnect (although you can see more B-Vars in MSFS’ Developer Mode).

Because B-Vars / InputEvents have this “Split Personality”, the Plugin defaults to run them as Command-only Type: it will not request the Value, but you can use it as Command with the according Options. If a B-Var is actually readable, you can tell the Plugin to treat a specific Address as Variable-Type - and read and update its Value like with other Types.

The Plugin exports all available B-Vars (with their correct Name to use!) as soon as the Simulator Session starts in the File “InputEvents.txt” in the Plugin Directory - Check the “QRH” Section of the Developer UI for a direct Link (accessible via the Tray-Icon of the Plugin)!
A great Source for B-Vars and (other Stuff) is HubHop by MobiFlight - Check the “QRH” Section of the Developer UI for a direct Link (accessible via the Tray-Icon of the Plugin)!


CALCULATOR
Command MSFS RPN-Code | $Name:Step(:Limit) | $K:Name(:Parameter1(:Parameter2))
  • RPN-Code: The Code in normal RPN Syntax you want to run with the execute_calculator_code Function.

For simple Tasks like increasing/decreasing a L-Var you can use the $Name:Step(:Limit(:Reset)) Template (the Plugin will build the right RPN-Code for that):

  • Name: The Name of the L-Var with or without preceding L:.
  • Step: The positive/negative Number by which the Variable is increased/decreased. A Plus-Sign for a positive Number is optional.
  • Limit: The Variable will not be increased/decreased beyond that optional Limit.
  • Reset: When the Variable reaches the specified Limit, the Variable will be set to the Value of Reset

For simple Tasks like triggering a K-Var (Event) you can use the $K:Name(:Parameter1(:Parameter2)) Template (the Plugin will build the right RPN-Code for that):

  • Name: The Name of the K-Var to trigger, you have to prefix it with K:.
  • Parameter1: An optional numeric Parameter to send (the first / inner).
  • Parameter2: An optional numeric Parameter to send (the second / outer).

Reading from a RPN Expression is now considered deprecated - use Composite Actions and/or Lua Scripts as Replacement.

Examples

  • (A:LIGHT POTENTIOMETER:13, percent over 100) 0.0 > if{ (A:LIGHT POTENTIOMETER:13, percent over 100) 0.1 - 100 * (>K:LIGHT_POTENTIOMETER_13_SET) } - Example of RPN Code (Decreasing Cabin Lights in the Fenix Airbus).
  • $E_FCU_SPEED:+1 - Increase L-Var E_FCU_SPEED by 1.
  • $A_ASP_VHF_1_VOLUME:-0.05:0 - Decrease L-Var A_ASP_VHF_1_VOLUME by 0.05 until it is 0.
  • $A_ASP_VHF_1_VOLUME:0.05:1:0.5 - Increase L-Var A_ASP_VHF_1_VOLUME by 0.05 as long it is smaller then 1. When it reaches 1, the Variable will be reset to 0.5.
  • $K:FUELSYSTEM_PUMP_TOGGLE:2 - Trigger the Standard Event FUELSYSTEM_PUMP_TOGGLE with Parameter 2.
  • $K:FUELSYSTEM_PUMP_TOGGLE:2:3 - Trigger the Standard Event FUELSYSTEM_PUMP_TOGGLE with Parameter 2 and 3. Resulting RPN Code: 3 2 (>K:FUELSYSTEM_PUMP_TOGGLE)
  • $K:A32NX.FCU_SPD_DEC - Trigger the Custom Event A32NX.FCU_SPD_DEC.

Templates have to start with the Dollar-Sign!
Note that there is no Syntax-Checking at all for Calculator Code (except for the Templates). Only use direct RPN-Code if you are used to it.

Background:
Calculator-Code or sometimes Gauge-Code are an internal Mechanic of the Simulator - very roughly spoken it is how the modeled Aircraft Panels work inside for Ages.
The Template for increasing/decreasing L-Vars is especially useful on the Right/Left Turn of the Encoders: The Plugin will incorporate the number of Ticks received by the StreamDeck Software in the Code it generates (instead of repeating it). That means that it is the “smoothest” Option to manipulate a L-Var with an Encoder!

Although RPN Syntax is very hard to understand (I still struggle 😵), it can be quite powerful. If you really want to go down the Rabbit Hole of using direct RPN-Code, start in the Flight Simulator SDK under Reversed Polish Notation.


XPCMD
Command XP Path(:Path)*
  • Path: The Path to the Command as published. You can send multiple Commands in a Sequence if you separate them with a : Sign.

Examples

  • toliss_airbus/aircondcommands/Pack1Toggle - Single Command
  • AirbusFBW/PopUpPFD1:AirbusFBW/PopUpND1 - Two Commands in Sequence

Background:
Every Command in X-Plane - whether it is from the Simulator, Plane or other Addons - has a unique Path.
In Comparison to other Simulators, X-Plane Commands can be requested to be active (e.g. a Button is clicked/pressed) and not active (e.g. a Button is released) in independent Requests - so there is no specific Need for separate Click & Release Commands as in other Sims. Commands can also be send as “command_once” where the “Click & Release” is done instantly in one Request.

Per Default the Plugin will trigger X-Plane Commands as “command_once” which is fine for most Buttons, Switches and Knobs. But in Cases of Buttons that need to be hold (kept pressed) for some Time and then released (e.g. CVR Test, TO CONF, Fire Tests) the Configuration depends on your X-Plane Version:

  • For X-Plane Versions earlier than 12.1.4: You can only trigger Commands as “command_once”. If you need to configure a holdable Switch, you have to use a vJoy (Driver) Command (with the corresponding vJoy Button mapped in X-Plane).
  • For X-Plane Versions at or greater than 12.1.4 (and WebAPI enabled in the Plugin Config): You can enable the Hold Switch Option and disable the Command Once Option of the Plugin to create an holdable Button/Switch (use the same Command Ref in both Addresses). On the Composite Action you need to add the Command Ref to both the UP and DOWN StreamDeck Events with the Command Once Option disabled.
  • NOTE: The WebAPI is still considered Experimental since I never heard anything back from LM on the Bug Report - but it seems to be more reliable now for Variable Requests?

Note on Sequences for Hold Switches: All Commands will be set active - make sure to use the same Sequence for both Addresses!

You can lookup the Command References in the UI or on the Internet like on siminnovations.com - Check the “QRH” Section of the Developer UI for a direct Link (accessible via the Tray-Icon of the Plugin)!
Or you can use the DataRefTool Plugin to explore all Commands (including Custom) currently known to the Simulator.


XPWREF
Command & Variable XP Path([index]|:sNUM)
  • Path: The Path to the DataRef as published.
  • [index]: (Optional) The Index to access, if the DataRef is an Array.
  • :sNUM: If the DataRef is a String, you need to add :s to the Path followed by the Number of Characters to read.

Examples

  • ckpt/lamp/74 - Reading a Value from a normal DataRef.
  • AirbusFBW/FuelOHPArray[2] - Reading a Value (on Index 2) from the Array under this Path.
  • sim/aircraft/view/acf_relative_path:s32 - Reading a String of Length 32 from that Path.

Before you use a DataRef as Command, make sure that it is writeable (some are read-only)! When used as Command, you need to specify the On Value and the Off Value. The Plugin will toggle between these two Values and writes them to the Variable.
In addition to writing plain Values, the Plugin can also do simple Operations like increasing/decreasing the Value or toggling the Value in a defined Sequence. Look under Command Options for Details.

Background:
Every Simulator Variable (called DataRef) in X-Plane - whether it is from the Simulator, Plane or other Addons - has a unique Path. DataRefs are everything and Everything is defined by DataRefs 😅

You can lookup the default Sim DataRefs in the X-Plane SDK under Datarefs - Check the “QRH” Section of the Developer UI for a direct Link (accessible via the Tray-Icon of the Plugin)!
Or you can use the DataRefTool Plugin to explore all DataRefs (including Custom) currently known to the Simulator.


LUAFUNC
Command & Variable ALL lua:File:Function(Parameter, ...) | lua:File(:Parameter)
  • File: The File Name with or without File-Type (.lua). The lua: Prefix is always necessary! The File Name is case-insensitive.
  • Function: The (required) Function’s Name to call in File. The Function Name is case-sensitive!
  • Parameter: An optional list of Parameters to pass to Function (if the Function supports that).

NOTE: For Image Scripts the Syntax is different! As the Function-Name is fixed, you don’t need to pass a Function-Name. The Parameter is optional (depends on the Script if it is used).

Examples

  • lua:fnx-a320:INIT_AIRCRAFT - Run the Function INIT_AIRCRAFT in File fnx-a320.lua.
  • lua:gsx:MENU_SELECT(1) - Run the Function MENU_SELECT with Parameter 1 in File GSX.lua.

When you use a Lua Function as Variable Address, the Plugin will use the Value returned by the called Function (and handles it as every other Variable Type).
If you use a Lua Function for a Command Address, the Plugin ignores the return Value (if the Function should return anything at all).

-TODO- See the Section BLA how to use the Plugin’s own Lua Engine.


INTERNAL
Command & Variable ALL X:Name
  • Name: The Name of the Variable, always needs to be prefixed with X:.

Examples

  • X:GSX_MENU_LINE1 - Read the internal Variable GSX_MENU_LINE1.

Like the Name suggests, these Variables are internal to the Plugin and can only be read or written to within the Plugin.
They are useful in specific Use-Cases when you need to share a Value only within the Plugin - i.e. to track a certain State or something.



2.1.2 - Command Options


On Value / Off Value:
These Fields are required for all Command & Variable Types. The Plugin will toggle between these two Values: when the current Value matches the Off Value, it will write the On Value. In every other Case the Off Value will be written.

But the Plugin can also do simple Value Manipulations on the Variable to increase/decrease the Value or write a Sequence of Values. These Value Manipulations always start with a $ Sign and need to be entered in the On Value Field (the Off Value Field is not used then).
The Syntax for increasing/decreasing is $Step(:Limit(:Reset))

  • $1 - A simple Increment by 1.
  • $1:4 - Increment by 1 up to a Value of 4.
  • $1:4:2 - Increment by 1 up to a Value of 4. When 4 is reached, the Variable will be set to 2.

The Values in a Sequence are defined as , separated List. The Plugin will compare the current Value with the List - if the Value is matched, it will write the next Value from the List to the Variable. If there is no match, it will use the last Value in the List. One Value can optionally be defined as Default with a = in Front of it. A Sequence must contain at least two Values with an optional Default Value or exactly one Value defined as Default. All Values in the List must be unique with the Exception of the last one.
An optional < at the End lets the Value “bounce off” - if the current Value is already the last one in the List, the previous Value is written.
Examples

  • $0,1,2< - When the Control is in Position 0, it will be moved to Position 1. Then from 1 to 2. When at 2, it will go back to 1. (e.g. for toggling Taxi Lights OFF>ON<>T.O.)
  • $=4 - The Control is always moved to Position 4, regardless of the current Position. (e.g. for setting ND Mode to PLAN from any Position)
  • $2,=3< - The Control will toggle between Position 2 and 3. If the Control is in any other Position it will default to 3. (e.g. for toggling ND Mode between NAV<>ARC and go to ARC from any other Position)
  • $0,1,2,3,1 - Moves the Control from Position 0 to 3. When in Position 3 it starts over at Position 1.



Toggle Switch:
This Option is available for all Commands but not for Variables. It allows you to control/toggle a Switch with a second Command defined by the Alternate Command Address - for Example for Push/Pull or Left/Right. Both Commands need to be of the same Type. Which Command is used will be deciced by the Plugin based on the current Value of the Variable you define in the Monitor Address Field.
When the current Value matches the configured Off Value, the Plugin will use the alternate Command. In every other case the normal Command will be used. You can specify a Comparison like >5 which will be interpreted as “if the current Value is > 5, then use the alternate Command”. The On Value Field is not used with this Option.
Note that this Option is only available for the Main Command - (short) Pressing the Keypad or Encoder.
Examples when to use: Push/Pull Knobs like for Barometers or the Autopilot are a great Use-Case for that Option.


Hold Switch:
This Option is available for all Commands and Variables except both vJoys, because the Keypad or Encoder behaves like a (non-toggle) vJoy then! The Difference to a vJoy is: you can directly define which Command or Value is send in the StreamDeck UI. If it makes Sense for a specific Cockpit-Control: the Control needs to stay in Position (does not reset the Position itself) and needs to have two distinct Commands or Values for pressed and unpressed (click<>release, down<>up)!
If you use it with a Command(-only) Type, you need to define an Alternate Command Address. The normal Command will be sent on KeyDown and the alternate Command on KeyUp.
If you use it with a Command & Variable Type, you need to define the On Value and the Off Value. Then On Value will be written on KeyDown and the Off Value on KeyUp. You can’t use a Value Manipulation with that Option.
Note that when Hold Switch is enabled, the Action can’t have another Command for Long Press. It is also only available for the main Interaction.
Also note that this Option is only available Main Command, but will be applied to the Guard Command if configured!
Examples when to use: Buttons you need to press & hold like Fire-Test or other Test Buttons are a great Use-Case for that Option.


Reset Switch:
This Option is only available for Variable Types. When activated, the Plugin will write the On Value to the Variable and after 100ms it will write the Off Value to the Variable. You can’t use a Value Manipulation with that Option.
Note that this Option affects all Commands on that Keypad/Encoder! So for Example if enabled on the Main Command, it will also applied to the Second Command or Touch Command (if these are also a Command & Variable Type).
Examples when to use: Buttons which do not reset their Position when being pressed (but should not stay pressed). Like the MCDU Keys of the Fenix Airbus for Example! Prefer a Reset Switch over an Hold Switch in such Cases (the Button just has to be pressed and unpressed shortly).


Use Delay:
This Option is available for some Command(-only) Types - the ones which allow to chain Commands / execute multiple Commands in a Sequence. Some Planes/Cockpit-Controls don’t recognize the Commands correctly when they come in too fast. In these Cases you can enable the Option so that the Execution of the next Command is delayed by 25ms. The Delay is only used if there is more than one Command/Parameter.
Note that this Option affects all Commands on that Keypad/Encoder! So for Example if enabled on the Main Command, it will also applied to the Second Command or Touch Command (if these are also belong to these Command Types).


Run as Command:
Only available when B-Var is selected as Command Type. If this Option is unchecked, the B-Var is treated as Variable Type and will present the respective Options.



2.2 - Common Options


2.2.1 - Common Input Style

Generally, most of the Configuration is defined in Text-Input-Fields. This is on Purpose so that Parts of the Configuration can quickly be changed and easily be copied between Actions.

If a Field requires multiple numeric Values - like Sizes, Positions and Ranges - the Values must be separated by a semicolon. For Example: 0; 10 or 9; 14; 54; 20

Mostly all Fields which accept numeric Values understand Float-Values also with either Decimal-Character independent of your System Locale (so 0,5 and 0.5 is the same for the Plugin). All Float-Values rendered by the Plugin will use a Decimal-Point . though!

If a Field/Syntax requires multiple Parameters, the Parameters are separated by colon :

If a Field/Syntax requires a Mapping or Assignment it is defined by an equal-Sign = . Some allow even simple Value-Comparisons like <=, >=, < or >.

  • A single Comparison like >=5 will be interpreted as “if the current Value is >= 5, then use/trigger this Option”. Equality is automatically tested if just a Number is present (do not add the Equal-Sign for that).
  • A Comparison in a Mapping can only be with Equality (<= or >=) and a Comparison like 5>=X will be interpreted as “if 5 is >= the current Value, then use/display X”.

2.2.2 - Common Options

COPY / PASTE:
When COPY is clicked, the Configuration of the selected Action is exported to your Clipboard as base64-encoded String.
When PASTE is clicked, the Configuration in your Clipboard is applied to the selected Action (regardless if it already configured or not). You can only Paste to an Action of the same Type.
The Benefits over the normal Copy & Paste you can do in the StreamDeck UI: you can transferr Settings between Keypads and Encoders and can share the resulting String with someone else to quickly share the Configuration of a single Action.


Decode BCD:
If the Value is a binary coded decimal (BCD), the Plugin can decode it for you with that Checkbox!


Scalar:
Multiply the Value by that Number to scale it, if it needs to be converted. Defaults to 1.
One Example would be “Pressure QNH as millibars” - it is delivered as multiple of 16 (e.g. 1013 = 16208). So we would scale it by 0.0625 (1/16) to have the right Value.


Format:
Add leading Zeros, Round the Value and/or add Text to it. Syntax: Zeros.Fraction:Text %s Text

  • Zeros: Leading Zeros will be added so that the Value has always the same number of integral Digits. Optional, but can only be specified together with Fraction.
  • Fraction: Define to how many fractional Digits the Value should be rounded (zero is allowed). If not specified, the Value is not rounded at all.
  • Text: The Value is inserted at the %s in the Text you specify here. E.g. to add Units to the Value with %s kg or a Percent-Sign with %s %. Or put something in Front of it. Every %s will be replaced by the Value. If Zeros/Digits are not specified, you don’t need to add a colon.
  • Examples
    • 1 One fractional

README 内容过长,已截取前 64 KB。完整内容请前往 GitHub 仓库查看。

评论

暂无评论