Using the keyboard and joystick binding facilities
Copilot comes with a simple Lua interface for binding keyboard keys, joystick buttons and axes to FSLabs cockpit controls (or just Lua functions).
Here's how to make the bindings:
Create the file Copilot for FSLabs\scripts\autorun.lua
Write the code using the example and/or the video below as reference.
The script will auto-run when you load a flight. You can restart it manually via the FSL2Lua Add-ons submenu.