Skip to content

Unity tool to grab keyboard events even when unity doesn't have focus

Notifications You must be signed in to change notification settings

kalvinpearce/UnityTool-GlobalInput

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

GlobalInput - Unity3D tool

This is a script that will hook into windows event system and add a callback function to send keyboad events to unity even when unity doesnt have focus.

Note: This system works on windows only

Place the script anywhere in your assets folder and it will take care of the rest.

Functions available:

// Keycodes are stored in GlobalKeyCode
// e.g. GlobalKeyCode.LEFT is the left arrow key

// GetKey
GlobalInput.GetKey( GlobalKeyCode );
	// Works the same as Input.GetKey( KeyCode )
	// Will output TRUE if the key in the parentheses is being held
    
// GetKeyDown
GlobalInput.GetKeyDown( GlobalKeyCode );
	// Works the same as Input.GetKeyDown( KeyCode )
	// Will output TRUE only ONCE if the key in the parentheses is being held
    
// GetKeyUp
GlobalInput.GetKeyUp( GlobalKeyCode );
	// Works the same as Input.GetKeyUp( KeyCode )
	// Will output TRUE only ONCE when the key in the parentheses is lifted after being pressed

About

Unity tool to grab keyboard events even when unity doesn't have focus

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages