docs.unity3d.com
    目次を表示する/隠す

    Struct KeyboardState

    Default state layout for keyboards.

    Inherited Members
    ValueType.Equals(Object)
    ValueType.GetHashCode()
    ValueType.ToString()
    Namespace: UnityEngine.InputSystem.LowLevel
    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(Key[])

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

    Fields

    keys

    Declaration
    public byte *keys
    Field Value
    Type Description
    Byte*

    Properties

    format

    Declaration
    public readonly FourCC format { get; }
    Property Value
    Type Description
    FourCC
    Implements
    IInputStateTypeInfo.format

    Format

    Memory format tag for KeybboardState.

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

    Returns "KEYS".

    See Also
    format

    Methods

    Press(Key)

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

    Release(Key)

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

    Set(Key, Boolean)

    Declaration
    public void Set(Key key, bool state)
    Parameters
    Type Name Description
    Key key
    Boolean state

    See Also

    Keyboard
    トップに戻る
    Copyright © 2023 Unity Technologies — 商標と利用規約
    • 法律関連
    • プライバシーポリシー
    • クッキー
    • 私の個人情報を販売または共有しない
    • Your Privacy Choices (Cookie Settings)