Options
All
  • Public
  • Public/Protected
  • All
Menu

Module Input

Namespace for input related methods and properties.

Index

Type aliases

KeyCode

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" | "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.

Note: To map input to the main interaction of all platforms, use primary.

Variables

Const clickDirection

clickDirection: Vector3

Returns Vector3 click direction originating from the Camera.

returns

click direction.

See Camera

Functions

onButtonDown

  • onButtonDown(handler: function, buttonString: string): void
  • Use Input.onKeyDown instead.

    Triggers an event whenever the specified input is pressed down.

    Note: Only one onButtonDown handler can be defined for a button at any time.

    deprecated

    Parameters

    • handler: function

      function to call. Pass null to remove the handler.

        • (): void
        • Returns void

    • buttonString: string

      button to press.

    Returns void

onButtonPressed

  • onButtonPressed(handler: function, buttonString: string): void
  • Use Input.onKeyPressed instead.

    Triggers every frame while specified input is pressed.

    Note: Only one onButtonPressed handler can be defined for a button at any time.

    deprecated

    Parameters

    • handler: function

      function to call. Pass null to remove the handler.

        • (): void
        • Returns void

    • buttonString: string

      button to press.

    Returns void

onButtonUp

  • onButtonUp(handler: function): void
  • onButtonUp(handler: function, buttonString: string): void
  • Use Input.onKeyUp instead.

    Triggers an event when the main input is released.

    Note: Only one onButtonUp handler can be defined for a button at any time.

    deprecated

    Parameters

    • handler: function

      function to call. Pass null to remove the handler.

        • (): void
        • Returns void

    Returns void

  • Use Input.onKeyUp instead.

    Triggers an event when specified input is released.

    Note: Only one onButtonUp handler can be defined for a button at any time.

    deprecated

    Parameters

    • handler: function

      function to call. Pass null to remove the handler.

        • (): void
        • Returns void

    • buttonString: string

      button to press.

    Returns void

onKeyDown

  • onKeyDown(handler: function, 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: function

      function to call. Pass null to remove the handler.

        • (): void
        • Returns void

    • keyCode: KeyCode

      key to press.

    Returns void

onKeyPressed

  • onKeyPressed(handler: function, 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: function

      function to call. Pass null to remove the handler.

        • (): void
        • Returns void

    • keyCode: KeyCode

      key to press.

    Returns void

onKeyUp

  • onKeyUp(handler: function, 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: function

      function to call. Pass null to remove the handler.

        • (): void
        • Returns void

    • keyCode: KeyCode

      key to press.

    Returns void

Generated using TypeDoc