Shortcuts / konsolepart conflict

Michael Jansen kde at michael-jansen.biz
Sun Mar 30 13:23:58 BST 2008


Hi

We found the exact problem and it's a little bit like the 'global shortcut 
steals my favorite application shortcut problem'.

As described in the other email kate registers it's shortcuts with qt and 
makes the konsole part a child of id. According to qt's rules that means the 
shortcuts of kate are active for the konsole widget. So Ctrl-R is grabbed by 
kate. If you hhange that Ctrl-R shortcut of kate the konsole part will get 
that event and forward it to the terminal. That because if no shortcut grabs 
it the widget get's it.

Konsole knows that and overrides some shortcut using the ShortcutOverride 
event in kdebase/apps/konsoles/src/TerminalDisplay.cpp:260 . That's why i'm 
sitting here and wonder why noone of konsole participated in this discussion. 

How to solve it. One idea would be to try something like send it first to the 
terminal and if that one handles it accept it, if not hand it back to qt. I 
think it's not possible to know if the terminal handled the event, and even if 
i wouldn't like it. It would be the same problem slightly changed. Some kate 
shortcuts would magically work when the focus is  on the konsole part and 
sometimes they wouldn't work. ( vim grabs many shortcuts for example ).

The other solution is to unconditionally override all shortcuts for the 
konsole part. That would mean at first you're trapped. The terminal get's the 
focus and all kate shortcuts immediatly stop to work. You would have to use 
the mouse to get back to the hosting application.

But i think it should be possible to put a shortcut from the host into 
konsole_part that gives the focus back. 

We would have a complete separation keyboard wise between konsole_part and the 
hosting application. I think that would be the cleanest solution. But it's 
quite some behavioral change for the konsole so i will leave that to the 
maintaners, whoever that is :-) .

If you want to see the effect in action add  the following code to 
kdebase/apps/konsoles/src/TerminalDisplay.cpp:2464 ( inside the if )
    keyEvent->accept();
    return true;

Beware that affects the real konsole too.

Mike





There is code that uses ShortcutOverride to catch some shortcuts needed by the 
terminal. 

The first approach would be to add all shortcuts here we want to be handled by 
the shell. Taking into account something like bash's inputrc file and the 
endless possibility of shells out there we have to admit that's not doable. 
Assemble such a list automatically is not doable either afaict.

The other approach ist to override all shortcuts 


-- 
Michael Jansen
Available for contract work ( Development / Configuration Management )
http://www.michael-jansen.biz




More information about the kde-core-devel mailing list