docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct KeyboardState

    Default state layout for keyboards.

    Implements
    IInputStateTypeInfo
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    Namespace: UnityEngine.InputSystem.LowLevel
    Assembly: Unity.InputSystem.dll
    Syntax
    public struct KeyboardState : IInputStateTypeInfo
    Remarks

    Can be used to update the state of Keyboard devices.

    // Send input event with A key pressed on keyboard.
    InputSystem.QueueStateEvent(Keyboard.current,
        new KeyboardState(Key.A));

    Constructors

    KeyboardState(params Key[])

    Declaration
    public KeyboardState(params Key[] pressedKeys)
    Parameters
    Type Name Description
    Key[] pressedKeys
    See Also
    Keyboard

    Fields

    keys

    Declaration
    public byte* keys
    Field Value
    Type Description
    byte*
    See Also
    Keyboard

    Properties

    Format

    Memory format tag for KeybboardState.

    Declaration
    public static FourCC Format { get; }
    Property Value
    Type Description
    FourCC

    Returns "KEYS".

    See Also
    format

    format

    Declaration
    public FourCC format { get; }
    Property Value
    Type Description
    FourCC
    See Also
    Keyboard

    Methods

    Press(Key)

    Declaration
    public void Press(Key key)
    Parameters
    Type Name Description
    Key key
    See Also
    Keyboard

    Release(Key)

    Declaration
    public void Release(Key key)
    Parameters
    Type Name Description
    Key key
    See Also
    Keyboard

    Set(Key, bool)

    Declaration
    public void Set(Key key, bool state)
    Parameters
    Type Name Description
    Key key
    bool state
    See Also
    Keyboard

    Implements

    IInputStateTypeInfo

    See Also

    Keyboard
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)