Mouse Events

elem.addEventListener("click", function() {
  elem.requestPointerLock();
  elem.addEventListener("mousedown", function(e) {
    console.log(e);
    document.querySelector("#mousedown").innerText =
        "type: " + e.type +
        "\nbutton: " + e.button +
        "\ndetail: " + e.detail +
        "\nisPrimary: " + e.isPrimary +
        "\npointerType: " + e.pointerType +
        "\npressure: " + e.pressure +
        "\nwhich: " + e.which +
        "\n" +
        "\nctrlKey: " + e.ctrlKey +
        "\naltKey: " + e.altKey +
        "\nmetaKey: " + e.metaKey +
        "\nshiftKey: " + e.shiftKey;
  });
  elem.addEventListener("onmouseup", function(e) {
    document.querySelector("#mouseup").innerText =
        "type: " + e.type +
        "\nbutton: " + e.button +
        "\ndetail: " + e.detail +
        "\nisPrimary: " + e.isPrimary +
        "\npointerType: " + e.pointerType +
        "\npressure: " + e.pressure +
        "\nwhich: " + e.which +
        "\n" +
        "\nctrlKey: " + e.ctrlKey +
        "\naltKey: " + e.altKey +
        "\nmetaKey: " + e.metaKey +
        "\nshiftKey: " + e.shiftKey;
  });
  elem.addEventListener("click", function(e) {
    document.querySelector("#click").innerText =
        "type: " + e.type +
        "\nbutton: " + e.button +
        "\ndetail: " + e.detail +
        "\nisPrimary: " + e.isPrimary +
        "\npointerType: " + e.pointerType +
        "\npressure: " + e.pressure +
        "\nwhich: " + e.which +
        "\n" +
        "\nctrlKey: " + e.ctrlKey +
        "\naltKey: " + e.altKey +
        "\nmetaKey: " + e.metaKey +
        "\nshiftKey: " + e.shiftKey;
  });
  elem.addEventListener("contextmenu", function(e) {
    e.preventDefault();
    document.querySelector("#contextmenu").innerText =
        "type: " + e.type +
        "\nbutton: " + e.button +
        "\ndetail: " + e.detail +
        "\nisPrimary: " + e.isPrimary +
        "\npointerType: " + e.pointerType +
        "\npressure: " + e.pressure +
        "\nwhich: " + e.which +
        "\n" +
        "\nctrlKey: " + e.ctrlKey +
        "\naltKey: " + e.altKey +
        "\nmetaKey: " + e.metaKey +
        "\nshiftKey: " + e.shiftKey;
  });
});
Click here