This is a python library that allows you to listen to DCS Bios events. This can be imported into any python and used for projects.
This library uses DCS Bios Skunkworks
A helpful tool is DCS Bort to see button/switch names for each piece of data for a given aircraft. In the Usage
section below, I am using the FLAPS_SW
for the F/A-18_Hornet
. Bort helps you see the name in DCS Bios for every piece of data, it also shows the values in realtime to help debug and see what data you are looking for.
1. DCS Bios installed on your PC and configured with DCS
PIP Package Link
pip install dcs-bios-connector
from dcs_bios_connector import DcsBiosConnector
bios = DcsBiosConnector()
bios.connect()
# ============= Example: Detect when flap switch changes and its new value =====================
def handle_flaps_change(value, controlInformation, dataInformation):
print("Flaps have been changed to: ", value)
bios.on("FLAP_SW", handle_flaps_change)
# ============= Example: Callback method to run when flaps are set to 2 =====================
def handle_flaps_lowered():
print("That flaps have been lowered! Yeah")
bios.on("FLAP_SW:0", handle_flaps_lowered)
# ================= Example: Setting flap switch to position 2 (Flaps to auto) ==========================
bios.send("FLAP_SW 2")