Has this code been tested on different browsers? I seem to remember there being some differences between how Chrome and Firefox handle keypress events.