accel problems: might be qt-copt, might be kdelibs

Ellis Whitehead ellis at kde.org
Sun Oct 13 15:59:56 BST 2002


On Sunday 13 October 2002 12:33, Ingo Klöcker wrote:
> On Sunday 13 October 2002 11:10, David Faure wrote:
> > On Sunday 13 October 2002 11:05, Marc Mutz wrote:
> > > On Sunday 13 October 2002 10:17, David Faure wrote:
> > > > Yes, this sounds like a side effect of Ellis' AccelOverride
> > > > change. What should happen here? Is the focus widget is the
> > > > listview or the KHTML view?
> > >
> > > It's primarily seen with listviews. If you click on one, it will
> > > have focus. And a lot of keys bound to navigation.
> > >
> > > What should happen is that if a hotkey is consumed by a KAction, it
> > > shouldn't be propagated to the focus widget anymore. I see the
> > > problem that for edit fields you want it vice versa, though.
> >
> > When are the listview's hotkeys going to be applicable then?
> > Shouldn't it rather be that "if the focus widget consumes a hotkey,
> > it shouldn't be propagated to the mainwindow - i.e. the KActions" ?
>
> The problem is that we want to override all actions of the listview with
> our own KActions. And these KActions are defined in KMMainWindow
> because it handles the actions for all our widgets. I guess we will
> have to overwrite KListView::keyPressEvent() in order to prevent the
> listview from stealing our keys. The following crude patch which simply
> hides all key press events from our listview seems to fix our problems
> AFAICS.

Hi.  No need for the keyPressEvent() stuff.  The problem was due to an 
oversight in the kaccel code: the keyPress event wasn't being stopped after 
being handled by KAccel.  The attached patch seems to fix it.  It's an ugly 
hack, but it seems to be working fine, and I'll increase the aesthetic value 
later. *grin*  It adds a new class, KAccelEventFilter, which adds itself to 
the kapp x11 event filter list.  KAccelEventFilter then kills the keyPress 
event if it's handled by KAccel.

Seem ok to commit?

Cheers,
Ellis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kaccel.cpp
Type: text/x-diff
Size: 4111 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20021013/3c43a35e/attachment.diff>


More information about the kde-core-devel mailing list