Function isKeyPressed

  • return the key press status of the specified action

    Parameters

    • action: string

      user defined corresponding action

    Returns boolean

    true if pressed

    if (me.input.isKeyPressed('left')) {
    //do something
    }
    else if (me.input.isKeyPressed('right')) {
    //do something else...
    }