Use e.which instead of e.charCode for cross-browser compatibility. Closes #162