[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: KKeyDialog and KAccel
From:       thomas.friedrichsmeier () ruhr-uni-bochum ! de
Date:       2002-05-03 10:53:09
[Download RAW message or body]

> Thanks for the input.  I've never tested the scenario you presented, but I think
> that it would work without too much difficulty using KAction.
> 
> new KAction( i18n("Left"), Key_Left, 0, 0, pCollection, "Left" );
> ...
> KShortcut cutLeft = pCollection->action("Left")->shortcut();
> ...
> keyPressEvent( QKeyEvent* pEvent )
> {
>  KKey key( pEvent );
> 
>  if( cutLeft.contains( key ) )
>   ...
> }
> 
> If you pass null for the object and slot, it'll never get connected, but you
> should still be able to configure it.

That's good to hear. Somehow I had assumed it would get connected, but if 
it does not, then there's no problem.

> The KShortcut::contains() method checks
> if key represents one of its key sequences (a shortcut can have two key
> sequences for the same action).
> 
> You can also use KActionCollection::readShortcutSettings() to read from a 
> standard config file, if you don't want to use the XML approach.
> 
> Would this help?

Yes, thanks!

Thomas
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic