Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# unity detect any keyboard input but not mouse input

// Detect any keyboard input but not mouse input
private void Update()
{
	if (Input.anyKeyDown && !(Input.GetMouseButtonDown(0) 
    	|| !Input.GetMouseButtonDown(1) || !Input.GetMouseButtonDown(2)))
	{
    	Debug.Log("No mouse pressed!");
	}
}
Source by stuartspixelgames.com #
 
PREVIOUS NEXT
Tagged: #unity #detect #keyboard #input #mouse #input
ADD COMMENT
Topic
Name
8+6 =