Determine if key pressed is in provided array
<p>I have code similar to this:</p>

<pre><code>$("#some-input").keyup(function (event) {
  var availableKeys = [".", ",", ";"];
  var key = String.fromCharCode(event.which);
  if (availableKeys.indexOf(key) != -1) {
    alert("Derp");
  }
});
</code></pre>

<p>However it does not work as I expected. The <code>event.which</code>/<code>fromCharCode</code> combination works like this properly on digits or letters (capital ones) and this is the correct behaviour since (I presume) event keycodes are different than charset entries.</p>

<p>Is there a workaround other than directly specifying keycodes for comparison (keeping the array of characters is a priority)?</p>
