Garry's Mod Wiki

Garry's Mod Wiki

  GM:KeyRelease( Player ply, number key )
This hook is predicted. This means that in singleplayer, it will not be called in the Client realm.


Runs when a IN key was released by a player.

For a more general purpose function that handles all kinds of input, see GM:PlayerButtonUp.

Despite being a predicted hook, it will still be called in singleplayer for your convenience.


1 Player ply
The player releasing the key. If running client-side, this will always be LocalPlayer.
2 number key
The key that the player released using IN enum.


hi will be printed to the console when the player releases the +use key (e).

hook.Add( "KeyRelease", "UseExample", function( ply, key ) if ( key == IN_USE ) then print( "hi" ) end end )
Output: hi

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated twice a day. Edits and history are not available.

Last Parsed: Loading...