Thanks for the js library recommendations. I've taken a look at keymaster, and it's mostly focused around modifier keys used in shortcuts. I'm currently using google closure library, but I will need to add more key recognition and failsafes in case there is a unrecognized keyboard layout.
https://github.com/madrobby/keymaster
https://github.com/ccampbell/mousetrap