AustinSmith13 / VirtualInput

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

VirtualInput

Creates ingame keys that can be modified during runtime for Unity3D. Gives the ability to bind and unbind physical keys to virtual keys.

How-to-use

First include the namespace VirtualInput.

using VirtualInput;

To create a Virtual Key

VInput.CreateVKey(new VKey("forward"));

To add physical keys to the virtual key

// Bind
VInput.BindKey(KeyCode.W, "forward");
VInput.BindKey(KeyCode.UpArrow, "forward");

// Unbind
VInput.UnBindKey(KeyCode.UpArrow, "forward");

Lasly, to check if a key is being pressed

// Return true if the key is being held down
VInput.GetKey("forward");

// Return true if the key was just pressed down
VInput.GetKeyDown("forward");

// Return true if the key was just released
VInput.GetKeyUp("forward");

About

License:MIT License


Languages

Language:C# 100.0%