Garry's Mod Wiki


  number input.GetAnalogValue( number axis )


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


1 number axis
The analog axis to poll. See Enums/ANALOG.


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).