Garry's Mod Wiki

Garry's Mod Wiki

  boolean input.WasMousePressed( number key )

Description

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

If input.WasMouseDoublePressed returns true, this function will return false.

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

Arguments

1 number key
The key, see MOUSE enum

Returns

1 boolean
True if the mouse key was initially pressed the same frame that this function was called, false otherwise.

Example

Example usage

hook.Add( "CreateMove", "fafawefafwf", function() if ( input.WasMousePressed( MOUSE_LEFT ) ) then print( "Left mouse button was pressed" ) end end )

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 four times a day. Edits and history are not available.

Last Parsed: Loading...