Description

Simulates the call of a key

Usage

Parameters

  • key {Integer}

    Key Code (example: Input.Space)

  • type {String}

    Type of event key, "down", "up" or "press". "press" is the touch of a key (pressed and then released)

  • canvas {HTMLCanvasElement} optional

    (optional) Canvas. Allows to restore the focus to the canvas

Example

canvas.Input.trigger(Input.A, "press");

Discussion