日本語翻訳ドキュメントはサポートを終了しました

MRTK 2.6 以降のドキュメントについては、公式の Microsoft ドキュメント を参照してください。

    Show / Hide Table of Contents

    Class KeyInputSystem

    Utility class to poll input for key bindings and to simulate key presses Need to add mechanisms to poll and simulate input axis: https://github.com/microsoft/MixedRealityToolkit-Unity/issues/7659

    Inheritance
    Object
    KeyInputSystem
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Microsoft.MixedReality.Toolkit.Input
    Assembly: cs.temp.dll.dll
    Syntax
    public static class KeyInputSystem

    Properties

    SimulatingInput

    Declaration
    public static bool SimulatingInput { get; }
    Property Value
    Type Description
    Boolean

    Methods

    AdvanceSimulation()

    Advances the Key press simulation by 1 frame. Keybindings will no longer trigger GetKeyDown(KeyBinding) or GetKeyUp(KeyBinding)

    Declaration
    public static void AdvanceSimulation()

    GetKey(KeyBinding)

    Test if the key is currently pressed.

    Declaration
    public static bool GetKey(KeyBinding kb)
    Parameters
    Type Name Description
    KeyBinding kb
    Returns
    Type Description
    Boolean

    True if the bound key is currently pressed

    GetKeyDown(KeyBinding)

    Test if the key has been pressed since the last frame.

    Declaration
    public static bool GetKeyDown(KeyBinding kb)
    Parameters
    Type Name Description
    KeyBinding kb
    Returns
    Type Description
    Boolean

    True if the bound key was pressed since the last frame

    GetKeyUp(KeyBinding)

    Test if the key has been released since the last frame.

    Declaration
    public static bool GetKeyUp(KeyBinding kb)
    Parameters
    Type Name Description
    KeyBinding kb
    Returns
    Type Description
    Boolean

    True if the bound key was released since the last frame

    PressKey(KeyBinding)

    Presses a key. GetKeyDown(KeyBinding) and GetKey(KeyBinding) will be true for the keybinding. GetKeyUp(KeyBinding) will no longer be true for the keybinding.

    Declaration
    public static void PressKey(KeyBinding kb)
    Parameters
    Type Name Description
    KeyBinding kb

    ReleaseKey(KeyBinding)

    Releases a key. GetKeyUp(KeyBinding) will be true for the keybinding. GetKeyDown(KeyBinding) and GetKey(KeyBinding) will no longer be true for the keybinding.

    Declaration
    public static void ReleaseKey(KeyBinding kb)
    Parameters
    Type Name Description
    KeyBinding kb

    ResetKeyInputSimulation()

    Resets the key input simulation. All keys will not trigger GetKeyDown(KeyBinding), GetKey(KeyBinding), or GetKeyUp(KeyBinding)

    Declaration
    public static void ResetKeyInputSimulation()

    StartKeyInputStimulation()

    Starts the key input simulation. Inputs can now be simulated via PressKey(KeyBinding) and ReleaseKey(KeyBinding)

    Declaration
    public static void StartKeyInputStimulation()

    StopKeyInputSimulation()

    Stops the key input simulation

    Declaration
    public static void StopKeyInputSimulation()
    Back to top Generated by DocFX