There are the commands in the joystick/default.lua
{pressed = device_commands.Button_4, cockpit_device_id = devices.CPT_MECH, value_pressed = -1.0, name = _('Canopy Closing'), category = _('Systems')},
{pressed = device_commands.Button_4, cockpit_device_id = devices.CPT_MECH, value_pressed = 1.0, name = _('Canopy Opening'), category = _('Systems')},
{down = device_commands.Button_5, cockpit_device_id = devices.CPT_MECH, value_down = 1.0, name = _('Canopy Emergency Release'), category = _('Systems')},
but a bug has been reported, the lines should be :
{pressed = device_commands.Button_2, cockpit_device_id = devices.CPT_MECH, value_pressed = -1.0, name = _('Canopy Closing'), category = _('Systems')},
{pressed = device_commands.Button_2, cockpit_device_id = devices.CPT_MECH, value_pressed = 1.0, name = _('Canopy Opening'), category = _('Systems')},
{down = device_commands.Button_5, cockpit_device_id = devices.CPT_MECH, value_down = 1.0, name = _('Canopy Emergency Release'), category = _('Systems')},