rotation shortcuts patch for khistorycombo

Felix Berger bflat1 at gmx.net
Mon Jan 24 12:55:01 GMT 2005


Hi,

IMO this is a trivial patch that makes sure the alternate shortcuts work too 
for rotation in the khistorycombo box. Can anyone commit this, please?

While looking at the shortcuts and kaccel implementation I had to notice that 
the implementations of the following kind don't work for multi-key-mode 
shortcuts (e.g. Ctrl+X,A):

void SomeWidget::keyPressEvent(QKeyEvent* e)
{
 KKey key(e);
 if (KStdAccel::home().contains(key)) {
  // move to beginning of document
 }
 else if (...) {
  ...
  ...
 }
}

The problem is that multi key sequences arrive in seperate key events and are 
not compressed/concatenated here.

This could be remedied by instantiating a KAccel object for each of the 
widgets (kcolorbutton.cpp, kcombobox.cpp, keditcl1.cpp, klineedit.cpp, 
ktextedit.cpp):

private:
 void initAccels()
 {
    KAccel* accel = new KAccel(this, "widget accel");
    accel->insert(KStdAccel::Home, this, SLOT(moveToBeginningOfDocument()));
    ...
    accel->readSettings();
 }

This would entail lots of private or public slots since we need an extra slot 
for each accelerator.

Another solution would be to implement the concatenation of keys to 
keysequences in every keyPressEvent() method or create some kind of generic 
class that handles this somehow for us.

I think we should do something about it, after all, we already offer multi key 
shortcuts to the users without any restrictions or caveats.

Sincerely,
Felix Berger

-- 
Use Debian GNU/Linux!
http://www.felix.beldesign.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rotationkeys.patch
Type: text/x-diff
Size: 977 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20050124/f3bdce13/attachment.patch>


More information about the kde-core-devel mailing list