Garry's Mod Wiki

input.GetAnalogValue

  number input.GetAnalogValue( number axis )

Description

Returns the digital value of an analog stick on the current (set up via convars) controller.

Arguments

1 number axis
The analog axis to poll. See ANALOG enum.

Returns

1 number
The digital value.
A joystick axis returns -32768 when it's pushed completely up/completely left, & returns 32767 when it's pushed completely down/completely right.

A mouse wheel starts @ 0 & increases by 1 for every unit of scroll up/decreases by 1 for every unit of scroll down.

A mouse axis is 0 when the arrow is @ the top or left of the screen; When the arrow is @ the bottom right of the screen, the mouse y axis is the height of the screen & the mouse x axis is the width of the screen (in pixels). Note that in game, the “arrow” stays near the middle of the screen.

Trigger axis always return 0 (verify).