Subj : Re: onkeypress event problem - bug? To : netscape.public.mozilla.jseng From : Ondra Zizka Date : Mon Nov 01 2004 12:07 pm Yes, sure, this is DOM level 2. But the old way ("DOM level 0") should work as well. "Lau Lei Cheong" píąe v diskusním příspěvku news:cm4oam$9ka1@ripley.netscape.com... | For Mozilla based browsers, you should aadd the event handler this way: | | document.addEventListener("keypress",handlefunction,true); | | "document.onkeydown = handlefunction;" will not work. | "Ondra Zizka" ¦b¶lĄó news:cm36k4$1lin$1@news.vol.cz ¤¤Ľ¶ | Ľg... | > Hello again, | > | > I found that when setting the event handler via BODY's onkeypress attrib, | it works. As the document.body.onkeypress should represent | > the same property, I suspect this being a bug and consider sending a bug | report to BugZilla. Should I? Or is this proper behavior? | > | > "Ondra Zizka" píąe v diskusním příspěvku | news:cm360u$1las$1@news.vol.cz... | > > Hello, | > > | > > I am in the middle of converting one large app written in JS/DOM from | MSIE to Mozilla (Gecko). It is controlled entirely with | > > keyboard. But after few weeks of rewriting everything to work with both | IE and Moz, I found that Mozilla does not send key events | > to | > > the scripts. Actually, it does, but only when the focus is on some input | element (textarea, input, a). According to JavaScript | > > console, there are no errors. | > > | > > The 2nd problem is with "find as you type" function of Moz. When | enabled, Mozilla does not send key events even when the focus is | > on | > > some input element. | > > | > > Tested with Mozilla 1.7.3 and Firefox 1.0 PR3. | > > | > > -------------- Code: ------------------ | > > | > > | > > | > >
| > >
| > > | > >
| > > Ahoj lidi | > > | > > ---------- ( Whole at | http://ondra.zizka.cz/projekty/miner/sm_keypress.html ) -------- | > > | > > | > | > | | .