I want to preface this by noting these are temporary hacks, and aircraft will have extended controls soon.
Here is the basic functionality for the seat_cam key bind hack:
You can replace the output of the //Autopilot Switch if and else if statements under update_frame section:
autopilot_switch = false; //Example
With to set any jsb property:
autopilot_switch = jsb['fcs/autopilot']=1; //Example of setting a jsb property
function switch_seat(cam){
if(cam===0){
this.set_fps_camera_pos({x:-0.25, y:-0.2, z:0.3}); //Cockpit
seat_cam=0;}
else if(cam===1){
this.set_fps_camera_pos({x:-0.25, y:-0.2, z:0.3}); //Front
seat_cam=1;}
else return false;return true;}
function update_frame(dt){
//Autopilot Switch
var seat_switch;
if(this.get_camera_mode() == 0 && seat_cam==0){
autopilot_switch = false;
}
else if(this.get_camera_mode() == 1 && autopilot_cam==1){
seat_switch = true;
}
Now...
The 'H' key used to toggle Hover mode, is added to the javascript file in the initialize section of a helicopter like so:
this.activate_event_group("heli");
You can modify the input-output map (./Anteworld/iomap.default.cfg) to include a custom event group, and access those key binds from the FDM, like so:
this.activate_event_group("aircraft");
{
"name" : "aircraft",
"actions" : [
{
"name" : "elevator_up",
"bindings" : [{"event_name":"W"},{"event_name":"Axis0-"}]
},
{
"name" : "elevator_down",
"bindings" : [{"event_name":"S"},{"event_name":"Axis0+"}]
},
{
"name" : "aileron_left",
"bindings" : [{"event_name":"A"},{"event_name":"Axis1-"}]
},
{
"name" : "aileron_right",
"bindings" : [{"event_name":"D"},{"event_name":"Axis1+"}]
},
{
"name" : "rudder_left",
"bindings" : [{"event_name":"Z"},{"event_name":"Axis3-"}]
},
{
"name" : "rudder_right",
"bindings" : [{"event_name":"X"},{"event_name":"Axis3+"}]
},
{
"name" : "throttle",
"bindings" : [{"event_name":"Axis4","invert":true}]
},
{
"name" : "throttle_up",
"bindings" : [{"event_name":"PageUp"}]
},
{
"name" : "throttle_down",
"bindings" : [{"event_name":"PageDown"}]
},
{
"name" : "mixture",
"bindings" : []
},
{
"name" : "mixture_up",
"bindings" : [{"event_name":"Home"}]
},
{
"name" : "mixture_down",
"bindings" : [{"event_name":"End"}]
},
{
"name" : "flaps_up",
"bindings" : [{"event_name":"Insert"},{"event_name":"Btn2"}]
},
{
"name" : "flaps_down",
"bindings" : [{"event_name":"Delete"},{"event_name":"Btn0"}]
},
{
"name" : "trim_elevator_up",
"bindings" : []
},
{
"name" : "trim_elevator_down",
"bindings" : []
},
{
"name" : "trim_aileron_left",
"bindings" : []
},
{
"name" : "trim_aileron_right",
"bindings" : []
},
{
"name" : "trim_rudder_left",
"bindings" : []
},
{
"name" : "trim_rudder_right",
"bindings" : []
},
{
"name" : "gear",
"bindings" : [{"event_name":"Period"}]
},
{
"name" : "brake",
"bindings" : [{"event_name":"B"},{"event_name":"Btn8"}]
},
{
"name" : "start_stop_engine",
"bindings" : [{"event_name":"E"},{"event_name":"Btn6"}]
},
{
"name" : "scenario_setup",
"bindings" : [{"event_name":"~"}]
},
{
"name" : "pause_simulation",
"bindings" : [{"event_name":"Space"},{"event_name":"Btn7"}]
},
{
"name" : "autopilot_switch",
"bindings" : [{"event_name":"A", "modifiers":"Ctrl"}}]
},
]
},
Regards,
Uriah