title: String.fromCharCode(e.which) doesn't recognize dot and comma
body: <p>I have created a function for input mask with jQuery:</p>
  
  <pre><code>$.fn.mask = function(regex) { 
      this.on("keydown keyup", function(e) {
          if (regex.test(String.fromCharCode(e.which))) {
              return false;
          }
      });
  }
  </code></pre>
  
  <p>It denies any input based on the regex you pass. Examples:</p>
  
  <pre><code>$("#textfield").mask(/\s/); // denies white spaces
  $("#textfield").mask(/\D/); // denies anything but numbers
  </code></pre>
  
  <p>Those examples above works, but I'm trying to use a regex to accept numbers with decimal separator, like this:</p>
  
  <pre><code>$("#textfield").mask(/[^\d.,]/); // Anything except digits, dot and comma
  </code></pre>
  
  <p>That doesn't work. But if I log <code>String.fromCharCode(e.which)</code> on console when I press <code>.</code> or <code>,</code> it shows me these(respective) chars: <code>¾</code> and <code>¼</code>.</p>
  
  <p>The question is why <code>String.fromCharCode(e.which)</code> stands for those chars instead of the pressed ones?</p>