Commit 861d7ed3 authored by Christoph Cullmann's avatar Christoph Cullmann 🐮
Browse files

let konsole not eat half of all shortcuts

BUG: 157523
parent 1a6f46ee
......@@ -39,10 +39,9 @@
#include <klocale.h>
#include <kdebug.h>
#include <kmessagebox.h>
//Added by qt3to4:
#include <QShowEvent>
#include <QLabel>
#include <QCheckBox>
#include <QVBoxLayout>
......@@ -196,7 +195,8 @@ void KateConsole::loadConsoleIfNeeded()
m_part->widget()->show();
connect ( m_part, SIGNAL(destroyed()), this, SLOT(slotDestroyed()) );
connect ( m_part, SIGNAL(overrideShortcut(QKeyEvent*,bool&)),
this, SLOT(overrideShortcut(QKeyEvent*,bool&)));
slotSync();
}
......@@ -213,6 +213,16 @@ void KateConsole::slotDestroyed ()
}
}
void KateConsole::overrideShortcut (QKeyEvent *event, bool &override)
{
printf ("event %d\n", event->key());
/**
* let konsole only handle ESC
*/
override = (event->key() == Qt::Key_Escape);
}
void KateConsole::showEvent(QShowEvent *)
{
if (m_part) return;
......
......@@ -28,6 +28,7 @@
#include <kvbox.h>
#include <QList>
#include <QKeyEvent>
class QShowEvent;
......@@ -166,6 +167,11 @@ class KateConsole : public KVBox, public Kate::XMLGUIClient
* set or clear focus as appropriate.
*/
void slotToggleFocus();
/**
* Handle that shortcuts are not eaten by console
*/
void overrideShortcut (QKeyEvent *event, bool &override);
protected:
/**
......
......@@ -94,6 +94,16 @@ void KateProjectInfoViewTerminal::loadTerminal ()
* guard destruction, create new terminal!
*/
connect (m_konsolePart, SIGNAL(destroyed()), this, SLOT(loadTerminal()));
connect (m_konsolePart, SIGNAL(overrideShortcut(QKeyEvent*,bool&)),
this, SLOT(overrideShortcut(QKeyEvent*,bool&)));
}
void KateProjectInfoViewTerminal::overrideShortcut (QKeyEvent *event, bool &override)
{
/**
* let konsole only handle ESC
*/
override = (event->key() == Qt::Key_Escape);
}
// kate: space-indent on; indent-width 2; replace-tabs on;
......@@ -24,6 +24,7 @@
#include "kateproject.h"
#include <QVBoxLayout>
#include <QKeyEvent>
#include <kparts/part.h>
......@@ -64,6 +65,11 @@ class KateProjectInfoViewTerminal : public QWidget
* Construct a new terminal for this view
*/
void loadTerminal ();
/**
* Handle that shortcuts are not eaten by console
*/
void overrideShortcut (QKeyEvent *event, bool &override);
private:
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment