Player/KeyReleased

From Garry's Mod
Jump to: navigation, search
 Player:KeyReleased( )

Contents

Description

Gets whether a key was just released this tick

Arguments

number key

The key, see IN_ Enums

Returns

boolean

Was released or not

Examples

Example

Prints whenever the first player first stops pressing W

hook.Add( "Tick", "CheckPlayer1Forward", function()
   if Entity( 1 ):KeyReleased( IN_FORWARD ) then print("Ent1 just stopped moving forward!") end
end)


Personal tools
Navigation