diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2014-05-14 22:06:08 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2014-05-14 22:06:08 +0900 |
commit | 83708272fbd48b9a65342cc66af5c0a3837d7a13 (patch) | |
tree | 17714d07c7f88efb2d406bcd8850ee8b9a23750d /konsole/konsole/TEmuVt102.cpp | |
parent | 335d526a0044373592b307d91f52c9f1c2d42980 (diff) | |
download | tdebase-83708272fbd48b9a65342cc66af5c0a3837d7a13.tar.gz tdebase-83708272fbd48b9a65342cc66af5c0a3837d7a13.zip |
Workaround Qt/Tde/X? bug for handling Meta key as Alt key in terminal emulation
after restored sessions. This resolves bug 1026 for good.
Diffstat (limited to 'konsole/konsole/TEmuVt102.cpp')
-rw-r--r-- | konsole/konsole/TEmuVt102.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/konsole/konsole/TEmuVt102.cpp b/konsole/konsole/TEmuVt102.cpp index 8eeb25d54..e0efab745 100644 --- a/konsole/konsole/TEmuVt102.cpp +++ b/konsole/konsole/TEmuVt102.cpp @@ -927,12 +927,12 @@ void TEmuVt102::onScrollLock() the complications towards a configuration file [see KeyTrans class]. */ -void TEmuVt102::onKeyPress( TQKeyEvent* ev ) +void TEmuVt102::doKeyPress( TQKeyEvent* ev ) { - if (!listenToKeyPress) return; // someone else gets the keys emit notifySessionState(NOTIFYNORMAL); -//printf("State/Key: 0x%04x 0x%04x (%d,%d)\n",ev->state(),ev->key(),ev->text().length(),ev->text().length()?ev->text().ascii()[0]:0); + //printf("State/Key: 0x%04x 0x%04x (%d,%d)\n", ev->state(),ev->key(), + // ev->text().length(),ev->text().length()?ev->text().ascii()[0]:0); // lookup in keyboard translation table ... int cmd = CMD_none; @@ -979,7 +979,8 @@ void TEmuVt102::onKeyPress( TQKeyEvent* ev ) if (cmd==CMD_send) { - if (((ev->state() & TQt::AltButton) || (metaKeyMode && (ev->state() & TQt::MetaButton))) && !metaspecified) + if ((ev->state() & TQt::AltButton) || + (metaKeyMode && ((ev->state() & TQt::MetaButton) || metaIsPressed) && !metaspecified)) sendString("\033"); emit sndBlock(txt,len); return; @@ -988,7 +989,8 @@ void TEmuVt102::onKeyPress( TQKeyEvent* ev ) // fall back handling if (!ev->text().isEmpty()) { - if ((ev->state() & TQt::AltButton) || (metaKeyMode && (ev->state() & TQt::MetaButton))) + if ((ev->state() & TQt::AltButton) || + (metaKeyMode && ((ev->state() & TQt::MetaButton) || metaIsPressed))) sendString("\033"); // ESC, this is the ALT prefix TQCString s = m_codec->fromUnicode(ev->text()); // encode for application // FIXME: In Qt 2, TQKeyEvent::text() would return "\003" for Ctrl-C etc. |