About khtml/xml/dom2_eventsimpl.cpp revision 1.22

Koos Vriezen koos.vriezen at xs4all.nl
Sat Jul 13 19:07:41 BST 2002



On Sat, 13 Jul 2002, David Faure wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Saturday 13 July 2002 12:47, you wrote:
> > Hi David,
> >
> > revision 1.22
> > date: 2002/03/07 15:07:34;  author: faure;  state: Exp;  lines: +4 -1
> > -  qKeyEvent->ignore();
> > +  // Events are supposed to be accepted by default in Qt!
> > +  // This line made QLineEdit's keyevents be ignored, so they were sent
> > to the khtmlview
> > +  // (and e.g. space would make it scroll down)
> > +  //qKeyEvent->ignore();
> >
> > This patch makes that the scroll keys don't work when a link has the
> > focus. Shouldn't XXEdit event handles mark qKeyEvent as accepted?
>
> Hmm, I'm no expert on the question, and I don't remember the big
> picture (if I ever grasped it ;).

Me neither, but I've played with it a bit. Reverting version 1.22 and do a

diff -u -3 -p -r1.278 html_formimpl.cpp
--- html/html_formimpl.cpp      2002/07/05 00:34:46     1.278
+++ html/html_formimpl.cpp      2002/07/13 18:05:26
@@ -656,6 +656,7 @@ void HTMLGenericFormElementImpl::default
            evt->id()==EventImpl::KHTML_KEYUP_EVENT)
        {
            KeyEventImpl * k = static_cast<KeyEventImpl *>(evt);
+            k->qKeyEvent->accept();
            if (k->keyVal() == QChar('\n').unicode() && m_render &&
m_render->isWidget() && k->qKeyEvent)
                QApplication::sendEvent(static_cast<RenderWidget
*>(m_render)->widget(), k->qKeyEvent);
        }

here seems to work.

> Anyway from the above comment: we could also state that this default
> behaviour (accepting) is correct, and that the fix would be for the link
> to ignore (pass up, whatever) any keyevent it doesn't handle?

Yes, that could probably also work...

Thanks,

Koos





More information about the kfm-devel mailing list