function FMC_KEY()
-- Lecture de l'offset
key = ipc.readUB(0x66C0)
print("Appui détecté : key =", key)
if key == 1 then
ipc.writeLvar('L:GNLU910_L_FMS_Lsk_1L', 1)
elseif key == 2 then
ipc.writeLvar('L:GNLU910_L_FMS_Lsk_2L', 1)
elseif key == 3 then
ipc.writeLvar('L:GNLU910_L_FMS_Lsk_3L', 1)
elseif key == 4 then
ipc.writeLvar('L:GNLU910_L_FMS_Lsk_4L', 1)
elseif key == 5 then
ipc.writeLvar('L:GNLU910_L_FMS_Lsk_5L', 1)
elseif key == 6 then
ipc.writeLvar('L:GNLU910_L_FMS_Lsk_6L', 1)
elseif key == 7 then
ipc.writeLvar('L:GNLU910_L_FMS_Lsk_1R', 1)
elseif key == 8 then
ipc.writeLvar('L:GNLU910_L_FMS_Lsk_2R', 1)
elseif key == 9 then
ipc.writeLvar('L:GNLU910_L_FMS_Lsk_3R', 1)
elseif key == 10 then
ipc.writeLvar('L:GNLU910_L_FMS_Lsk_4R', 1)
elseif key == 11 then
ipc.writeLvar('L:GNLU910_L_FMS_Lsk_5R', 1)
elseif key == 12 then
ipc.writeLvar('L:GNLU910_L_FMS_Lsk_6R', 1)
elseif key == 13 then
ipc.writeLvar('L:GNLU910_L_FMS_Menu', 1)
elseif key == 14 then
ipc.writeLvar('L:GNLU910_L_FMS_InitRef', 1)
elseif key == 15 then
ipc.writeLvar('L:GNLU910_L_FMS_Rte', 1)
elseif key == 16 then
ipc.writeLvar('L:GNLU910_L_FMS_Vnav', 1)
elseif key == 17 then
ipc.writeLvar('L:GNLU910_L_FMS_Legs', 1)
elseif key == 18 then
ipc.writeLvar('L:GNLU910_L_FMS_Prog', 1)
elseif key == 19 then
ipc.writeLvar('L:GNLU910_L_FMS_Atc', 1)
elseif key == 20 then
ipc.writeLvar('L:GNLU910_L_FMS_Fix', 1)
elseif key == 21 then
ipc.writeLvar('L:GNLU910_L_FMS_Vnav', 1)
elseif key == 22 then
ipc.writeLvar('L:GNLU910_L_FMS_Vnav', 1)
elseif key == 23 then
ipc.writeLvar('L:GNLU910_L_FMS_DepArr', 1)
elseif key == 24 then
ipc.writeLvar('L:GNLU910_L_FMS_Hold', 1)
elseif key == 25 then
ipc.writeLvar('L:GNLU910_L_FMS_Exec', 1)
elseif key == 26 then
ipc.writeLvar('L:GNLU910_L_FMS_PrvNxt', 0)
elseif key == 27 then
ipc.writeLvar('L:GNLU910_L_FMS_PrvNxt', 2)
elseif key >= 28 and key <= 37 then
local digit = key - 28
ipc.writeLvar('L:GNLU910_L_FMS_' .. tostring(digit), 1)
elseif key == 38 then
ipc.writeLvar('L:GNLU910_L_FMS_Dot', 1)
elseif key == 39 then
ipc.writeLvar('L:GNLU910_L_FMS_Div', 1)
elseif key == 40 then
ipc.writeLvar('L:GNLU910_L_FMS_PlusMinus', 1)
elseif key == 41 then
ipc.writeLvar('L:GNLU910_L_FMS_Del', 1)
elseif key == 42 then
ipc.writeLvar('L:GNLU910_L_FMS_Clr', 1)
elseif key == 43 then
ipc.writeLvar('L:GNLU910_L_FMS_Sp', 1)
elseif key == 44 then
ipc.writeLvar('L:GNLU910_L_FMS_A', 1)
elseif key == 45 then
ipc.writeLvar('L:GNLU910_L_FMS_B', 1)
elseif key == 46 then
ipc.writeLvar('L:GNLU910_L_FMS_C', 1)
elseif key == 47 then
ipc.writeLvar('L:GNLU910_L_FMS_D', 1)
elseif key == 48 then
ipc.writeLvar('L:GNLU910_L_FMS_E', 1)
elseif key == 49 then
ipc.writeLvar('L:GNLU910_L_FMS_F', 1)
elseif key == 50 then
ipc.writeLvar('L:GNLU910_L_FMS_G', 1)
elseif key == 51 then
ipc.writeLvar('L:GNLU910_L_FMS_H', 1)
elseif key == 52 then
ipc.writeLvar('L:GNLU910_L_FMS_I', 1)
elseif key == 53 then
ipc.writeLvar('L:GNLU910_L_FMS_J', 1)
elseif key == 54 then
ipc.writeLvar('L:GNLU910_L_FMS_K', 1)
elseif key == 55 then
ipc.writeLvar('L:GNLU910_L_FMS_L', 1)
elseif key == 56 then
ipc.writeLvar('L:GNLU910_L_FMS_M', 1)
elseif key == 57 then
ipc.writeLvar('L:GNLU910_L_FMS_N', 1)
elseif key == 58 then
ipc.writeLvar('L:GNLU910_L_FMS_O', 1)
elseif key == 59 then
ipc.writeLvar('L:GNLU910_L_FMS_P', 1)
elseif key == 60 then
ipc.writeLvar('L:GNLU910_L_FMS_Q', 1)
elseif key == 61 then
ipc.writeLvar('L:GNLU910_L_FMS_R', 1)
elseif key == 62 then
ipc.writeLvar('L:GNLU910_L_FMS_S', 1)
elseif key == 63 then
ipc.writeLvar('L:GNLU910_L_FMS_T', 1)
elseif key == 64 then
ipc.writeLvar('L:GNLU910_L_FMS_U', 1)
elseif key == 65 then
ipc.writeLvar('L:GNLU910_L_FMS_V', 1)
elseif key == 66 then
ipc.writeLvar('L:GNLU910_L_FMS_W', 1)
elseif key == 67 then
ipc.writeLvar('L:GNLU910_L_FMS_X', 1)
elseif key == 68 then
ipc.writeLvar('L:GNLU910_L_FMS_Y', 1)
elseif key == 69 then
ipc.writeLvar('L:GNLU910_L_FMS_Z', 1)
else
print("Touche non reconnue ou nulle", key)
end
ipc.sleep(50) -- Pause pour laisser le système traiter l'appui
ipc.writeUB(0x66C0, 0) -- Remise à zéro propre
end
print("Script MCDU démarré")
event.offset("66C0", "UB", "FMC_KEY")