Here's the code in the macro key
Code: Select all
L1 = HIDMacros.GetFSUIPCInt(LTS_LandingLtRetractableSw, 2)
L2 = HIDMacros.GetFSUIPCInt(LTS_LandingLtFixedSw, 2)
if (Round(L1)+Round(L2) > 0) then
HIDMacros.FSXEvent EVT_OH_LAND_LIGHTS_GUARD, MOUSE_FLAG_RIGHTSINGLE
else
HIDMacros.FSXEvent EVT_OH_LAND_LIGHTS_GUARD, MOUSE_FLAG_LEFTSINGLE
end if
Here's the code in the main script
Code: Select all
Const LTS_LandingLtRetractableSw = &H64F4 ' values from FSUIPC PDF
Const LTS_LandingLtFixedSw = &H64F6
Const EVT_OH_LAND_LIGHTS_GUARD = "#69742"
Const MOUSE_FLAG_LEFTSINGLE = &H20000000 ' values from PMDG SDK.h
Const MOUSE_FLAG_RIGHTSINGLE = &H80000000