Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace Input

Input related methods and properties.

Index

Type Aliases

KeyCode: "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | "f1" | "f2" | "f3" | "f4" | "f5" | "f6" | "f7" | "f8" | "f9" | "f11" | "f12" | "zero" | "one" | "two" | "three" | "four" | "five" | "six" | "seven" | "eight" | "nine" | "num_lock" | "num_pad_zero" | "num_pad_one" | "num_pad_two" | "num_pad_three" | "num_pad_four" | "num_pad_five" | "num_pad_six" | "num_pad_seven" | "num_pad_eight" | "num_pad_nine" | "num_pad_plus" | "num_pad_minus" | "num_pad_multiply" | "num_pad_period" | "num_pad_division" | "plus" | "minus" | "space" | "backspace" | "capslock" | "tab" | "enter" | "esc" | "delete" | "insert" | "left" | "right" | "up" | "down" | "primary" | "left_mouse_button" | "right_mouse_button" | "middle_mouse_button"

Provides a set of key codes that are mapped directly to physical keyboard and mouse keys.

Variables

clickDirection: Vector3

Returns Vector3 click direction originating from the Camera.

returns

click direction.

See Camera

Functions

  • onKeyDown(handler: (() => void), keyCode: KeyCode): void
  • Triggers an event whenever the specified Input.KeyCode is pressed down.

    Note: Only one onKeyDown handler can be defined for a key at any time.

    Parameters

    • handler: (() => void)

      function to call. Pass null to remove the handler.

        • (): void
        • Returns void

    • keyCode: KeyCode

      key to press.

    Returns void

  • onKeyPressed(handler: (() => void), keyCode: KeyCode): void
  • Triggers every frame while specified Input.KeyCode is pressed.

    Note: Only one onKeyPressed handler can be defined for a key at any time.

    Parameters

    • handler: (() => void)

      function to call. Pass null to remove the handler.

        • (): void
        • Returns void

    • keyCode: KeyCode

      key to press.

    Returns void

  • onKeyUp(handler: (() => void), keyCode: KeyCode): void
  • Triggers an event whenever the specified Input.KeyCode is released.

    Note: Only one onKeyUp handler can be defined for a key at any time.

    Parameters

    • handler: (() => void)

      function to call. Pass null to remove the handler.

        • (): void
        • Returns void

    • keyCode: KeyCode

      key to press.

    Returns void