Subj : Re: onkeypress event problem - bug? To : netscape.public.mozilla.jseng From : Lau Lei Cheong Date : Mon Nov 01 2004 03:22 pm 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 ) -------- > > > > > > .