input.WasKeyPressed

From Garry's Mod
Jump to: navigation, search
 input.WasKeyPressed( )

Description

Returns whether a key was initially pressed in the same frame this function was called.

This function only works in Move hooks, and will detect key presses even in main menu or when a typing in a text field.

Arguments

number key

The key, see KEY_ Enums.

Returns

boolean

True if the key was initially pressed the same frame that this function was called, false otherwise.
Personal tools
Navigation