Search Results for

    Show / Hide Table of Contents

    Keyboard

    The Keyboard is one of the most common input devices on desktop platforms. You can access the keyboard state by using the Input class:

    • Input.InputText
    • Input.GetKey
    • Input.GetKeyDown
    • Input.GetKeyUp

    Usage

    In your C# script you can read keyboard inputs:

    public override void OnUpdate()
    {
        if (Input.GetKey(KeyboardKeys.E))
        {
            Debug.Log("E key is pressed.");
        }
    }
    
    • Improve this Doc
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat