
// ----------------------------------------------------------------------------
// include thirdperson settings and helpers

exec thirdperson.cfg

// ----------------------------------------------------------------------------
// Xbox 360 controller settings

joy_name "Xbox 360 controller" // ( def. "joystick" )
joy_advanced 1 // ( def. 0 )
joy_advaxisx 3 // ( def. 0 )
joy_advaxisy 1 // ( def. 0 )
joy_advaxisz 0
joy_advaxisr 2 // ( def. 0 )
joy_advaxisu 4 // ( def. 0 )
joy_advaxisv 0

joy_forwardthreshold 0.15
joy_sidethreshold 0.15
joy_pitchthreshold 0.15
joy_yawthreshold 0.15
joy_forwardsensitivity -1 // ( def. -1 )
joy_sidesensitivity 1
joy_pitchsensitivity 1 // ( def. 1 )
joy_yawsensitivity -1.5 // ( def. -1 )

//  - 'Movement' stick response mode: 0=Linear, 1=quadratic, 2=cubic, 3=quadratic extreme
joy_response_move 0 // ( def. 1 )

//  - DISABLED - 'Look' stick response mode: 0=Linear, 1=quadratic, 2=cubic, 3=quadratic extreme, 4=custom
joy_response_look 0

joy_lowend 0.5 // ( def. 1 )
joy_lowmap 0.2 // ( def. 1 )
joy_accelscale 2.0

//  - The stick range where autoaim dampening is applied. 0 = off
joy_autoaimdampenrange 0.85 // ( def. 0 )

//  - How much to scale user stick input when the gun is pointing at a valid target.
joy_autoaimdampen 0.5 // ( def. 0 )

//  - POV manipulator operates on diagonal axes, too.
joy_diagonalpov 0

joy_display_input 0

//  - Wingman warrior hack related to turn axes.
joy_wingmanwarrior_turnhack 0

//  - Wingman warrior centering hack.
joy_wingmanwarrior_centerhack 0

joy_axisbutton_threshold 0.3

//  - Automatically sprint when moving with an analog joystick
joy_autosprint 0

joystick 1
joyadvancedupdate
+jlook
crosshair 0
hud_draw_fixed_reticle 1
hud_fastswitch 2
// hl2_x360_aiming 2
// player_limit_jump_speed 0

// ----------------------------------------------------------------------------
// Xbox 360 controller helpers

alias joy360_swap_yaw "incrementvar joy_yawsensitivity -1.5 3 3"
alias joy360_swap_pitch "incrementvar joy_pitchsensitivity -1 2 2"

alias joy360_duck_on     "+duck; alias joy360_duck_toggle joy360_duck_off"
alias joy360_duck_off    "-duck; alias joy360_duck_toggle joy360_duck_on"
alias joy360_duck_toggle "joy360_duck_on"

// ----------------------------------------------------------------------------
// thirdperson camera & Xbox 360 controller button bindings

// back / start
bind joy7 tp_toggle
bind joy8 "exec thirdperson_joy360"

// triggers
bind "Z AXIS NEG" +attack
bind "Z AXIS POS" +attack2

// A
bind joy1 +jump

// B
bind joy2 +reload

// X
bind joy3 invnext

// Y
bind joy4 joy360_duck_toggle

// shoulder buttons: left, right
bind joy5 tp_reset
bind joy6 "toggle thirdperson_platformer"

// dpad: left, right, up, down
bind pov_right +camyawright
bind pov_left +camyawleft
bind pov_up +camin
bind pov_down +camout

// stick buttons
bind joy9 "joy360_swap_yaw"
bind joy10 "joy360_swap_pitch"

// ----------------------------------------------------------------------------
// xbox 360 control names:

// buttons:
//   A             joy1
//   B             joy2
//   X             joy3
//   Y             joy4
//   LB            joy5
//   RB            joy6
//   back          joy7
//   start         joy8
//   l-stick       joy9
//   r-stick       joy10
//   dpad-up       pov_up
//   dpad-down     pov_down
//   dpad-left     pov_left
//   dpad-right    pov_right

// analogs:
//   l-stick-right  "X AXIS POS"
//   l-stick-left   "X AXIS NEG"
//   l-stick-down   "Y AXIS POS"
//   l-stick-up     "Y AXIS NEG"

//   r-stick-right  "U AXIS POS"
//   r-stick-left   "U AXIS NEG"
//   r-stick-down   "R AXIS POS"
//   r-stick-up     "R AXIS NEG"

//   LT            "Z AXIS NEG"
//   RT            "Z AXIS POS"

// ----------------------------------------------------------------------------
