Xplane 11 Function and Numpad Keys not working
Posted: 23 Mar 2018, 04:35
Hey guys,
I am a noob at this stuff, here is the script I have compiled so far.
All commands are working, however any commands listed as a function key F1 F2 F3 ect as well as any Numpad keys are not working.
I have tried scripting the commands that work with other keys to the numpad or function keys and they dont work.
My overhead works awesome on xplane, I just really wish I could map out my numpad/functions correctly..
Check out my script...
-- assign logical name to macro keyboard
lmc_assign_keyboard('MACROS');
lmc_print_devices()
-- define callback for whole device
lmc_set_handler('MACROS',function(button, direction)
if (direction == 1) then return end -- ignore down
if (button == string.byte('C')) then lmc_xpl_command('laminar/B738/toggle_switch/bleed_air_2')
elseif (button == string.byte('X')) then lmc_xpl_command('laminar/B738/toggle_switch/bleed_air_apu')
elseif (button == string.byte('Z')) then lmc_xpl_command('laminar/B738/toggle_switch/bleed_air_1')
elseif (button == string.byte('^A')) then lmc_xpl_command('laminar/B738/toggle_switch/l_pack_dn')
elseif (button == string.byte('A')) then lmc_xpl_command('laminar/B738/toggle_switch/l_pack_up')
elseif (button == string.byte('D')) then lmc_xpl_command('laminar/B738/toggle_switch/r_pack_up')
elseif (button == string.byte('^D')) then lmc_xpl_command('laminar/B738/toggle_switch/r_pack_dn')
elseif (button == string.byte('S')) then lmc_xpl_command('laminar/B738/toggle_switch/iso_valve_dn')
elseif (button == string.byte('+(S)')) then lmc_xpl_command('laminar/B738/toggle_switch/iso_valve_up')
elseif (button == string.byte('`')) then lmc_xpl_command('sim/lights/taxi_lights_toggle')
elseif (button == string.byte('1')) then lmc_xpl_command('sim/lights/landing_lights_on')
elseif (button == string.byte('2')) then lmc_xpl_command('laminar/B738/switch/rwy_light_left_on')
elseif (button == string.byte('3')) then lmc_xpl_command('laminar/B738/switch/rwy_light_right_on')
elseif (button == string.byte('4')) then lmc_xpl_command('laminar/B738/switch/wing_light_on')
elseif (button == string.byte('5')) then lmc_xpl_command('laminar/B738/switch/logo_light_on')
elseif (button == string.byte('7')) then lmc_xpl_command('laminar/B738/toggle_switch/position_light_up')
elseif (button == string.byte('8')) then lmc_xpl_command('laminar/B738/switch/wheel_light_on')
elseif (button == string.byte('9')) then lmc_xpl_command('laminar/B738/toggle_switch/window_heat_l_side')
elseif (button == string.byte('0')) then lmc_xpl_command('laminar/B738/toggle_switch/window_heat_r_side')
elseif (button == string.byte('-')) then lmc_xpl_command('laminar/B738/toggle_switch/window_heat_l_fwd')
elseif (button == string.byte('=')) then lmc_xpl_command('laminar/B738/toggle_switch/window_heat_r_fwd')
elseif (button == string.byte('=')) then lmc_xpl_command('laminar/B738/toggle_switch/window_heat_r_side')
elseif (button == string.byte('+')) then lmc_xpl_command('laminar/B738/push_button/master_caution1')
elseif (button == string.byte('{f1}')) then lmc_xpl_command('laminar/B738/autopilot/n1_press')
elseif (button == string.byte('{F2}')) then lmc_xpl_command('laminar/B738/autopilot/cmd_a_press')
elseif (button == string.byte('{NUM1}')) then lmc_xpl_command('laminar/B738/autopilot/speed_press')
elseif (button == string.byte('{NUM3}')) then lmc_xpl_command('laminar/B738/autopilot/autothrottle_arm_toggle')
elseif (button == string.byte('{NUM4}')) then lmc_xpl_command('laminar/B738/autopilot/hdg_sel_press')
elseif (button == string.byte('{NUM5}')) then lmc_xpl_command('laminar/B738/autopilot/app_press')
elseif (button == string.byte ('{NUM6}')) then lmc_xpl_command('laminar/B738/autopilot/vorloc_press')
elseif (button == string.byte('{NUM9}')) then lmc_xpl_command('laminar/B738/autopilot/lvl_chg_press')
elseif (button == string.byte('*')) then lmc_xpl_command('laminar/B738/autopilot/vs_press')
elseif (button == string.byte('{numast}')) then lmc_xpl_command('laminar/B738/autopilot/lvl_chg_press')
elseif (button == string.byte('{numminus}')) then lmc_xpl_command('laminar/B738/autopilot/alt_hld_press')
elseif (button == string.byte('{numplus}')) then lmc_xpl_command('laminar/B738/autopilot/vnav_press')
elseif (button == string.byte('{ENT}')) then lmc_xpl_command('laminar/B738/autopilot/lnav_press')
elseif (button == string.byte('{numdecimal}')) then lmc_xpl_command('laminar/B738/autopilot/flight_director_toggle')
end
end)
Please help, Beers to whoever can fix this!
Thanks alot for your time
Rich
I am a noob at this stuff, here is the script I have compiled so far.
All commands are working, however any commands listed as a function key F1 F2 F3 ect as well as any Numpad keys are not working.
I have tried scripting the commands that work with other keys to the numpad or function keys and they dont work.
My overhead works awesome on xplane, I just really wish I could map out my numpad/functions correctly..
Check out my script...
-- assign logical name to macro keyboard
lmc_assign_keyboard('MACROS');
lmc_print_devices()
-- define callback for whole device
lmc_set_handler('MACROS',function(button, direction)
if (direction == 1) then return end -- ignore down
if (button == string.byte('C')) then lmc_xpl_command('laminar/B738/toggle_switch/bleed_air_2')
elseif (button == string.byte('X')) then lmc_xpl_command('laminar/B738/toggle_switch/bleed_air_apu')
elseif (button == string.byte('Z')) then lmc_xpl_command('laminar/B738/toggle_switch/bleed_air_1')
elseif (button == string.byte('^A')) then lmc_xpl_command('laminar/B738/toggle_switch/l_pack_dn')
elseif (button == string.byte('A')) then lmc_xpl_command('laminar/B738/toggle_switch/l_pack_up')
elseif (button == string.byte('D')) then lmc_xpl_command('laminar/B738/toggle_switch/r_pack_up')
elseif (button == string.byte('^D')) then lmc_xpl_command('laminar/B738/toggle_switch/r_pack_dn')
elseif (button == string.byte('S')) then lmc_xpl_command('laminar/B738/toggle_switch/iso_valve_dn')
elseif (button == string.byte('+(S)')) then lmc_xpl_command('laminar/B738/toggle_switch/iso_valve_up')
elseif (button == string.byte('`')) then lmc_xpl_command('sim/lights/taxi_lights_toggle')
elseif (button == string.byte('1')) then lmc_xpl_command('sim/lights/landing_lights_on')
elseif (button == string.byte('2')) then lmc_xpl_command('laminar/B738/switch/rwy_light_left_on')
elseif (button == string.byte('3')) then lmc_xpl_command('laminar/B738/switch/rwy_light_right_on')
elseif (button == string.byte('4')) then lmc_xpl_command('laminar/B738/switch/wing_light_on')
elseif (button == string.byte('5')) then lmc_xpl_command('laminar/B738/switch/logo_light_on')
elseif (button == string.byte('7')) then lmc_xpl_command('laminar/B738/toggle_switch/position_light_up')
elseif (button == string.byte('8')) then lmc_xpl_command('laminar/B738/switch/wheel_light_on')
elseif (button == string.byte('9')) then lmc_xpl_command('laminar/B738/toggle_switch/window_heat_l_side')
elseif (button == string.byte('0')) then lmc_xpl_command('laminar/B738/toggle_switch/window_heat_r_side')
elseif (button == string.byte('-')) then lmc_xpl_command('laminar/B738/toggle_switch/window_heat_l_fwd')
elseif (button == string.byte('=')) then lmc_xpl_command('laminar/B738/toggle_switch/window_heat_r_fwd')
elseif (button == string.byte('=')) then lmc_xpl_command('laminar/B738/toggle_switch/window_heat_r_side')
elseif (button == string.byte('+')) then lmc_xpl_command('laminar/B738/push_button/master_caution1')
elseif (button == string.byte('{f1}')) then lmc_xpl_command('laminar/B738/autopilot/n1_press')
elseif (button == string.byte('{F2}')) then lmc_xpl_command('laminar/B738/autopilot/cmd_a_press')
elseif (button == string.byte('{NUM1}')) then lmc_xpl_command('laminar/B738/autopilot/speed_press')
elseif (button == string.byte('{NUM3}')) then lmc_xpl_command('laminar/B738/autopilot/autothrottle_arm_toggle')
elseif (button == string.byte('{NUM4}')) then lmc_xpl_command('laminar/B738/autopilot/hdg_sel_press')
elseif (button == string.byte('{NUM5}')) then lmc_xpl_command('laminar/B738/autopilot/app_press')
elseif (button == string.byte ('{NUM6}')) then lmc_xpl_command('laminar/B738/autopilot/vorloc_press')
elseif (button == string.byte('{NUM9}')) then lmc_xpl_command('laminar/B738/autopilot/lvl_chg_press')
elseif (button == string.byte('*')) then lmc_xpl_command('laminar/B738/autopilot/vs_press')
elseif (button == string.byte('{numast}')) then lmc_xpl_command('laminar/B738/autopilot/lvl_chg_press')
elseif (button == string.byte('{numminus}')) then lmc_xpl_command('laminar/B738/autopilot/alt_hld_press')
elseif (button == string.byte('{numplus}')) then lmc_xpl_command('laminar/B738/autopilot/vnav_press')
elseif (button == string.byte('{ENT}')) then lmc_xpl_command('laminar/B738/autopilot/lnav_press')
elseif (button == string.byte('{numdecimal}')) then lmc_xpl_command('laminar/B738/autopilot/flight_director_toggle')
end
end)
Please help, Beers to whoever can fix this!
Thanks alot for your time
Rich