|
|
|
|
|
by jmilkbal
4723 days ago
|
|
Perhaps map key codes to object properties with, you know, real names so comparisons to e.keyCode mean something in the future. var appKeys = { "Esc": 27 };
else if (e.keyCode === appKeys.Esc) {
Some JS libs do this for you and there are some nice libs that make key handling convenient and powerful as well. |
|
There are lots of libraries that could have made things more convenient. But a big part of this project was to learn as much as I could about coding, and the browser as an environment, so early on I committed to writing everything myself.
I'd be interested in hearing whether or not other people think this is a good strategy for self teaching.