summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--konsole/konsole/TEmuVt102.cpp29
-rw-r--r--konsole/konsole/TEmulation.cpp1
-rw-r--r--konsole/konsole/TEmulation.h2
3 files changed, 20 insertions, 12 deletions
diff --git a/konsole/konsole/TEmuVt102.cpp b/konsole/konsole/TEmuVt102.cpp
index c460693cd..ebe090fda 100644
--- a/konsole/konsole/TEmuVt102.cpp
+++ b/konsole/konsole/TEmuVt102.cpp
@@ -936,18 +936,21 @@ void TEmuVt102::onKeyPress( TQKeyEvent* ev )
// lookup in keyboard translation table ...
int cmd = CMD_none;
- const char* txt;
+ const char *txt;
int len;
bool metaspecified;
- if (keytrans->findEntry(ev->key(), encodeMode(MODE_NewLine , BITS_NewLine ) + // OLD,
- encodeMode(MODE_Ansi , BITS_Ansi ) + // OBSOLETE,
- encodeMode(MODE_AppCuKeys , BITS_AppCuKeys ) + // VT100 stuff
- encodeMode(MODE_AppScreen , BITS_AppScreen ) + // VT100 stuff
- encodeStat(TQt::ControlButton , BITS_Control ) +
- encodeStat(TQt::ShiftButton , BITS_Shift ) +
- encodeStat(TQt::AltButton , BITS_Alt ),
- &cmd, &txt, &len, &metaspecified ))
-//printf("cmd: %d, %s, %d\n",cmd,txt,len);
+ int bits = encodeMode(MODE_NewLine , BITS_NewLine ) + // OLD,
+ encodeMode(MODE_Ansi , BITS_Ansi ) + // OBSOLETE,
+ encodeMode(MODE_AppCuKeys , BITS_AppCuKeys ) + // VT100 stuff
+ encodeMode(MODE_AppScreen , BITS_AppScreen ) + // VT100 stuff
+ encodeStat(TQt::ControlButton, BITS_Control ) +
+ encodeStat(TQt::ShiftButton , BITS_Shift ) +
+ encodeStat(TQt::AltButton , BITS_Alt );
+ if (metaKeyMode)
+ bits += encodeStat(TQt::MetaButton , BITS_Alt);
+ bool transRes = keytrans->findEntry(ev->key(), bits, &cmd, &txt, &len, &metaspecified);
+//if (transRes)
+// printf("cmd: %d, %s, %d\n",cmd,txt,len);
if (connected)
{
switch(cmd) // ... and execute if found.
@@ -976,8 +979,10 @@ void TEmuVt102::onKeyPress( TQKeyEvent* ev )
|| ev->key()==Qt::Key_PageUp || ev->key()==Qt::Key_PageDown))
scr->setHistCursor(scr->getHistLines());
- if (cmd==CMD_send) {
- if ((ev->state() & TQt::AltButton) && !metaspecified ) sendString("\033");
+ if (cmd==CMD_send)
+ {
+ if (((ev->state() & TQt::AltButton) || (metaKeyMode && (ev->state() & TQt::MetaButton))) && !metaspecified)
+ sendString("\033");
emit sndBlock(txt,len);
return;
}
diff --git a/konsole/konsole/TEmulation.cpp b/konsole/konsole/TEmulation.cpp
index 939139d03..3aa1cfad4 100644
--- a/konsole/konsole/TEmulation.cpp
+++ b/konsole/konsole/TEmulation.cpp
@@ -98,6 +98,7 @@ TEmulation::TEmulation(TEWidget* w)
scr(0),
connected(false),
listenToKeyPress(false),
+ metaKeyMode(false),
m_codec(0),
decoder(0),
keytrans(0),
diff --git a/konsole/konsole/TEmulation.h b/konsole/konsole/TEmulation.h
index a5f432175..6eac5f91b 100644
--- a/konsole/konsole/TEmulation.h
+++ b/konsole/konsole/TEmulation.h
@@ -89,6 +89,7 @@ public:
virtual void setMode (int) = 0;
virtual void resetMode(int) = 0;
+ void setMetaKeyMode(bool mode) { metaKeyMode = mode; }
virtual void sendString(const char*) = 0;
@@ -119,6 +120,7 @@ protected:
bool connected; // communicate with widget
bool listenToKeyPress; // listen to input
+ bool metaKeyMode; // true -> meta key is handled as Alt
void setCodec(int c); // codec number, 0 = locale, 1=utf8