Garry's Mod Wiki

Garry's Mod Wiki

  boolean Player:KeyDownLast( number key )

Description

Gets whether a key was down one tick ago.

Arguments

1 number key
The key, see IN enum

Returns

1 boolean
Is key down ?

Example

Prints whenever the first player stopped pressing +forward key (w on QWERTY keyboards) last tick

hook.Add( "Tick", "CheckPlayer1Forward", function() if !Entity( 1 ):KeyDown( IN_FORWARD ) and Entity( 1 ):KeyDownLast( IN_FORWARD ) then print( "Player1 is no longer holding W!" ) end end )

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated twice a day. Edits and history are not available.

Last Parsed: Loading...