This patch sets the basis for overriding key combinations that the terminal emulator should capture, even if they are assigned as shortcuts in the program. In this case, only Ctrl+D is overridden.

I leave further expansion of overriding to the discression the konsole/konqueror developers.  It's been suggested, for example, that all Ctrl+<key> shortcuts should be overriden.

svn path=/trunk/kdebase/konsole/; revision=182445
wilder-portage
Ellis Whitehead 24 years ago
parent 4a97effdc6
commit 1cbabed28c
  1. 16
      konsole/TEWidget.cpp
  2. 3
      konsole/TEWidget.h

@ -1436,6 +1436,22 @@ bool TEWidget::eventFilter( QObject *obj, QEvent *e )
return QFrame::eventFilter( obj, e );
}
// Override any accelerator with shortcut = Ctrl+D when pressed with the keyboard
// focus in TEWidget, so that Ctrl+D will still work as 'exit'.
bool TEWidget::event( QEvent *e )
{
if ( e->type() == QEvent::AccelOverride )
{
QKeyEvent *ke = static_cast<QKeyEvent *>( e );
if ( ke->key() == Qt::Key_D && ke->state() == Qt::ControlButton )
{
ke->accept();
return true;
}
}
return QFrame::event( e );
}
/* ------------------------------------------------------------------------- */
/* */
/* Frame */

@ -128,7 +128,8 @@ protected:
virtual void styleChange( QStyle& );
bool eventFilter( QObject *, QEvent * );
bool eventFilter( QObject *, QEvent * );
bool event( QEvent * );
void drawAttrStr(QPainter &paint, QRect rect,
QString& str, ca attr, bool pm, bool clear);

Loading…
Cancel
Save