<!-- Warthog Joystick + Throttle + Pedals mapping -->
<!-- js1 = shitsux -->
<!-- js2 = hotas -->
<!-- js3 = rudder -->
<ActionMaps version="0" >
 	<actionmap name="spaceship_view">

		<!-- Cockpit view controls. -->
		<!-- To bind to an analog device, use v_view_yaw and v_view_pitch. -->
		<action name="v_view_yaw_left">
			<rebind device="joystick" input="js2_hat1_right" />
		</action>
		<action name="v_view_yaw_right">
			<rebind device="joystick" input="js2_hat1_left" />
		</action>
		<action name="v_view_pitch_up">
			<rebind device="joystick" input="js2_hat1_up" />
		</action>
		<action name="v_view_pitch_down">
			<rebind device="joystick" input="js2_hat1_down" />
		</action>

		<!-- Switches camera views. -->
		<action name="v_view_cycle_fwd">
			<rebind device="joystick" input="js2_button9" />
		</action>

		<!-- This is the zoom feature. -->
		<action name="v_view_dynamic_focus_toggle">
			<rebind device="joystick" input="js2_button25" />
		</action>
	</actionmap>
 	<actionmap name="spaceship_movement">

 		<!-- Yay, normal pitch, yaw, and roll. -->
		<action name="v_pitch">
			<rebind device="joystick" input="js2_y" />
		</action>
		<action name="v_yaw">
			<rebind device="joystick" input="js2_x" />
		</action>
		<action name="v_roll">
			<rebind device="joystick" input="js3_x" />
		</action>

		<!-- Throttle. -->
		<!-- You can use throttlex, throttley, and throttlez.  Those binds don't allow negative axis values. -->
		<action name="v_throttle">
			<rebind device="joystick" input="js2_throttlez" />
		</action>

		<!-- Match target velocity. -->
		<action name="v_target_match_vel">
			<rebind device="joystick" input="js2_button7" />
		</action>

		<!-- Go fast button. -->
		<action name="v_afterburner">
			<rebind device="joystick" input="js2_button6" />
		</action>

		<!-- Toggle decoupled mode (slide erry day) -->
		<action name="v_ifcs_toggle_vector_decoupling">
			<rebind device="keyboard" input="js2_button8" />
		</action>

		<!-- These NEED to be bound or else your view goes crazy in decoupled mode. -->
		<!-- Use the same values for your pitch, yaw, and roll. -->
		<!-- Roll doesn't work unfortunately. -->
		<action name="v_newtonian_yaw">
			<rebind device="joystick" input="js2_x" />
		</action>
		<action name="v_newtonian_pitch">
			<rebind device="joystick" input="js2_y" />
		</action>
		<!-- <action name="v_newtonian_roll_left">
			<rebind device="joystick" input="js3_x" />
		</action> -->
		<!-- <action name="v_newtonian_brake">
			<joystick input="" />
		</action> -->

		<!-- Dodging while in decoupled mode. -->
		<!-- These don't do anything when not in decoupled mode. -->
		<action name="v_strafe_up">
			<rebind device="keyboard" input="js2_button3" />
		</action>
		<action name="v_strafe_down">
			<rebind device="keyboard" input="js2_button5" />
		</action>
		<action name="v_strafe_left">
			<rebind device="keyboard" input="js2_button6" />
		</action>
		<action name="v_strafe_right">
			<rebind device="keyboard" input="js2_button4" />
		</action>
		<!-- <action name="v_strafe_forward">
			<rebind device="keyboard" input="" />
		</action>
		<action name="v_strafe_back">
			<rebind device="keyboard" input="" />
		</action> -->

		<!-- Toggles G-SAFE/COMSTAB modes. -->
		<action name="v_ifcs_toggle_safety">
			<rebind device="keyboard" input="js2_button21" />
		</action>

		<!-- Does this do anything?  Who knows! -->
		<action name="v_shield_reset_level">
			<rebind device="keyboard" input="js2_button20" />
		</action>

		<!-- Invert the roll.  Will this work? -->
		<!-- Probably have to hijack an existing cvar. -->
		<options>
			<option invert_cvar="v_pedalInvert">
				<optiondata input="js3_x" />
			</option>
		</options>

	</actionmap>
 	<actionmap name="spaceship_targeting">

		<action name="v_target_cycle_all_fwd">
			<rebind device="joystick" input="js2_button11" />
		</action>
		<action name="v_target_cycle_all_back">
			<rebind device="joystick" input="js2_button13" />
		</action>
		<action name="v_target_missile_lock_focused">
			<rebind device="joystick" input="js2_button2" />
		</action>
		<action name="v_target_cycle_hostile_fwd">
			<rebind device="joystick" input="js2_button12" />
		</action>
		<action name="v_target_nearest_hostile">
			<rebind device="joystick" input="js2_button14" />
		</action>

		<!-- Pin focused enemy. -->
		<action name="v_target_toggle_pinned_focused">
			<rebind device="joystick" input="js3_button8" />
		</action>

	</actionmap>
 	<actionmap name="spaceship_weapons">

		<action name="v_attack1_group1">
			<rebind device="joystick" input="js2_button5" />
		</action>
		<action name="v_attack1_group2">
			<rebind device="joystick" input="js2_button1" />
		</action>
		<action name="v_attack1_group3">
			<rebind device="joystick" input="js3_button5" />
		</action>
		<!-- Group 4 can also be bound somewhere. -->

	</actionmap>
 	<actionmap name="spaceship_missiles">

 		<!-- All your missile needs (probably). -->
		<action name="v_weapon_launch_missile">
			<rebind device="joystick" input="js2_button2" />
		</action>

	</actionmap>
 	<actionmap name="spaceship_defensive">

 		<!-- Oh shit oh shit -->
		<action name="v_weapon_launch_countermeasure">
			<rebind device="joystick" input="js2_button3" />
		</action>

		<!-- Cycle countermeasures. -->
		<!-- I have no clue of the purpose of this. -->
		<action name="v_weapon_cycle_countermeasure_fwd">
			<rebind device="joystick" input="js2_button15" />
		</action>
	</actionmap>
</ActionMaps>
