melonJS
    Preparing search index...

    Function bindPointer

    • Associate a pointer event to a keycode
      Left button -- 0 Middle button -- 1 Right button -- 2

      Parameters

      • ...args: number[]

        button and/or keyCode

      Returns void

      // enable the keyboard
      me.input.bindKey(me.input.KEY.X, "shoot");
      // map the left button click on the X key (default if the button is not specified)
      me.input.bindPointer(me.input.KEY.X);
      // map the right button click on the X key
      me.input.bindPointer(me.input.pointer.RIGHT, me.input.KEY.X);