SiliconGhetto Engine API
    Preparing search index...

    Function keyDown

    • Check if a key is currently held down.

      Parameters

      • key: string

        The key name (e.g. "ArrowLeft", "a", " " for space)

      Returns boolean

      True if the key is currently pressed

      if (sg.keyDown('ArrowRight')) { x += speed * dt; }