Garry's Mod Wiki

Player:KeyDownLast

boolean Player:KeyDownLast( number key )

Description

Gets whether a key was down one tick ago.

Arguments

1 number key
The key, see Enums/IN

Returns

1 boolean
Is key down

Example

Prints whenever the first player stopped pressing W last tick

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

Page Links


Special Pages


Wikis

?

Render Time: 32ms

Session 0
DB GetPage 3
Generate Html 8
SaveChanges 8
Render Body 0
Render Sidebar 11