Garry's Mod Wiki


  boolean GM:InputMouseApply( CUserCmd cmd, number x, number y, Angle ang )


Allows you to modify the supplied User Command with mouse input. This could be used to make moving the mouse do funky things to view angles.


1 CUserCmd cmd
User command.
2 number x
The amount of mouse movement across the X axis this frame.
3 number y
The amount of mouse movement across the Y axis this frame.
4 Angle ang
The current view angle.


1 boolean
Return true if we modified something.


Prevents all players from turning with the mouse.

hook.Add( "InputMouseApply", "FreezeTurning", function( cmd ) cmd:SetMouseX( 0 ) cmd:SetMouseY( 0 ) return true end )