title: how to close sweet alert by pressing esc key?
body: <p>I am using sweet alert 2 and i have something like this.</p>
  
  <p><a href="https://i.stack.imgur.com/ekgnE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ekgnE.png" alt="swal"></a></p>
  
  <p>and here its implementation </p>
  
  <pre><code>$('#btn_undispense').click(function() {
          swal({
              title: "Are you want to unDispense this claim?",
              //text: 'you want to unDispense this claim ?',
              type: "warning",
              showCancelButton: true,
              confirmButtonClass: 'btn-warning',
              cancelButtonClass: 'btn-default',
              confirmButtonText: "UnDispense",
              cancelButtonText: "UnDispense &amp; Delete",
              closeOnConfirm: true,
              closeOnCancel: true,
              allowEscapeKey: true,
              allowOutsideClick: true
          }, function(isConfirm) {
              var url = '@Url.Action("UnDispenseAndDelete", "ClaimData")';
              $.ajax({
                  type: 'GET',
                  url: url,
                  data: {
                      par:'@Model.ParKey',
                      par2: '@Model.ParKey2',
                      isUnDispensedOnly:isConfirm
                  },
                  success: function(res) {
                      debugger;
                      //1 undispensedOnly   //2 undispensed and delete
                      if (res === "1") {
                          showSuccessToast("Claim undispensed successfully");
                          if (@((int)Model.UserSession.UserRoleEnum) === 3) {
  
                              var url1 = "/Pharmacist/ClaimData/OpenClaim?par=" + '@Model.ParKey' + "&amp;par2=" + '@Model.ParKey2' + "&amp;par7=" + '@Model.ParKey7' + "&amp;isClaimSearchPayer="+true ;
                              window.location.href = url1;
                          } else {
                              var url = "/Pharmacist/ClaimData/OpenClaim?par=" + '@Model.ParKey' + "&amp;par2=" + '@Model.ParKey2' + "&amp;par7=" + '@Model.ParKey7' + "";
                              window.location.href = url;
                          }
                      }else if(res === "2"){
                          var url1 = '@Url.Action("ClaimSearch", "Batch", new {area="Pharmacist"})';
                          window.location.href = url1;
                      }
                      else {
                          //  showErrorToast("Error");
                          showPopupModal("Errors", '@Url.Action("PopupError")');
                      }
                  },
                  failure: function () {
                      showErrorToast("Internal Server Error");
                  }
              });
  
          });
      });
  </code></pre>
  
  <p>I want to close this sweet alert by pressing ESC key without excuting one of the two options so I added allowEscapeKey and allowOutsideClick options, the allowOutsideClick option is working correctly the problem is with the ESC key, whenever I press ESC it excutes the cancel button which is UnDispense &amp; Delete and I just want to close the swal without excuting neither.</p>