Permalink
Browse files

added some automation to aid in adding more keycodes

  • Loading branch information...
1 parent 3f768bd commit 8ad2820d2484bb42e2895fde8e971dcea38d2e77 @wesbos committed Nov 20, 2015
Showing with 14 additions and 5 deletions.
  1. +10 −3 README.md
  2. +4 −2 scripts.js
View
@@ -1,3 +1,10 @@
-# JavaScript Keycodes
-A simple webpage that responds to the key pressed and returns the JavaScript 'on-key pressed' keycode.<br/>
-Check the online published version: http://keycode.info/
+# JavaScript Keycodes → [KeyCode.info](http://keycode.info)
+
+![](http://wes.io/dsHT/content)
+
+A simple webpage that responds to the key pressed and returns the JavaScript 'on-key pressed' keycode.
+
+## Help Out :ok_hand::ok_hand::ok_hand:
+
+There are many keys, particularly ones that are on non-English keyboards that I haven't mapped. Please add it to scripts.js and submit a PR!
+
View
@@ -130,11 +130,13 @@ var keyCodes = {
var body = document.querySelector('body');
body.onkeydown = function (e) {
- if (!e.metaKey) e.preventDefault();
+ if ( !e.metaKey ) {
+ e.preventDefault();
+ }
document.querySelector('.keycode-display').innerHTML = e.keyCode;
document.querySelector('.text-display').innerHTML =
- keyCodes[e.keyCode] || "huh? Let me know what browser and key this was.";
+ keyCodes[e.keyCode] || `huh? Let me know what browser and key this was. <a href='https://github.com/wesbos/keycodes/issues/new?title=Missing keycode ${e.keyCode}&body=Tell me what key it was or even better, submit a Pull request!'>Submit to Github</a>`;
};
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){

0 comments on commit 8ad2820

Please sign in to comment.