input.IsKeyDown

From GMod Wiki

Revision as of 20:50, 10 September 2011 by TheFreeman193 (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Function
Syntax input.IsKeyDown( Number key )
Where is this used?
Description:
Returns a bool if the key has been pressed
Returns: Boolean
Part of Library: input
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Input.IsKeyDown]Input.IsKeyDown [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionShow cursor if you press alt.
Used onNewerClient.png
Code
 
local function KeyPress()
    gui.EnableScreenClicker(input.IsKeyDown(KEY_LALT))
end
 
hook.Add("Think","BM - Clients - Key",KeyPress)
 
OutputShow/hide mouse cursor if you press/unpress Alt key.


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox