Garry's Mod Wiki

input.WasMousePressed

input.WasMousePressed

  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 Enums/MOUSE

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 )

Special Pages


Wikis

?

Render Time: 49ms

DB GetPage 27
Generate Html 4
SaveChanges (1) 6
Render Body 0
Render Sidebar 10