Garry's Mod Wiki

input.IsKeyDown

  boolean input.IsKeyDown( number key )

Description

Gets whether a key is down.

Arguments

1 number key
The key, see KEY enum.

Returns

1 boolean
Is the key down

Example

Show cursor if you press alt.

-- Note this may prevent the cursor from naturally appearing without alt hook.Add( "Think", "BM_Clients_Key", function() gui.EnableScreenClicker( input.IsKeyDown( KEY_LALT ) ) end )