Firefox 1.5 Keypress Event Changes

Someone submitted a post to the P2P forum saying that one of my book examples is no longer working in Firefox 1.5. After some investigating, I made an interesting discovery. It seems that in Firefox 1.5, the keypress event behaves differently than in previous version.

As I said in Professional JavaScript, the keypress event fires only for character keys (those keys that produce output). Prior to Firefox (and in other browsers) these did not include keys like Backspace and Delete. Firefox 1.5 now fires the event for Backspace, Delete, Ins, and Pause/Break. I haven’t been able to find a bug relating to this change, but it sure is annoying.

Understanding JavaScript Promises E-book Cover

Demystify JavaScript promises with the e-book that explains not just concepts, but also real-world uses of promises.

Download the Free E-book!

The community edition of Understanding JavaScript Promises is a free download that arrives in minutes.