input.IsKeyDown

From GMod Wiki

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