Skip to content

Instantly share code, notes, and snippets.

@cstumph
Created December 22, 2011 09:26
Show Gist options
  • Save cstumph/1509661 to your computer and use it in GitHub Desktop.
Save cstumph/1509661 to your computer and use it in GitHub Desktop.
Alphanumeric keycode array, plus some code to generate
<!-- All alpha numerics + punctuation
[192, 49, 50, 51, 52, 53, 54, 55, 56, 57, 48, 189, 187, 81, 87, 69, 82, 84, 89, 85, 73, 79, 80, 219, 221, 220, 65, 83, 68, 70, 71, 72, 74, 75, 76, 186, 222, 90, 88, 67, 86, 66, 78, 77, 188, 190, 191, 91]
-->
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
</head>
<body>
<p>hello</p>
<ul class="here"></ul>
<script>
var arr = []
$('html').delegate('body', 'keyup', function(e){
arr.push(e.keyCode);
console.log('keyCode', e.keyCode);
console.log(arr);
$('.here').append('<li>' + arr + '</li>');
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment