summaryrefslogtreecommitdiffstats
path: root/konsole
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2014-04-22 15:22:23 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2014-04-22 15:22:23 +0900
commitcb7702286517c5483b2a4340538c0747030945b9 (patch)
tree18e25fc94d2b5d2214dfb3fefc98f450e0ee4cd4 /konsole
parentc5a0a7cec07dee8b52c7add7822d25a137137df2 (diff)
downloadtdebase-cb7702286517c5483b2a4340538c0747030945b9.tar.gz
tdebase-cb7702286517c5483b2a4340538c0747030945b9.zip
Fixed support for handling Meta key as Alt key in terminal emulation.
This resolves bug 1026.
Diffstat (limited to 'konsole')
-rw-r--r--konsole/konsole/TEmuVt102.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/konsole/konsole/TEmuVt102.cpp b/konsole/konsole/TEmuVt102.cpp
index ebe090fd..8eeb25d5 100644
--- a/konsole/konsole/TEmuVt102.cpp
+++ b/konsole/konsole/TEmuVt102.cpp
@@ -948,19 +948,17 @@ void TEmuVt102::onKeyPress( TQKeyEvent* ev )
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);
+ keytrans->findEntry(ev->key(), bits, &cmd, &txt, &len, &metaspecified);
if (connected)
{
- switch(cmd) // ... and execute if found.
- {
- case CMD_scrollPageUp : gui->doScroll(-gui->Lines()/2); return;
- case CMD_scrollPageDown : gui->doScroll(+gui->Lines()/2); return;
- case CMD_scrollLineUp : gui->doScroll(-1 ); return;
- case CMD_scrollLineDown : gui->doScroll(+1 ); return;
- case CMD_scrollLock : onScrollLock( ); return;
- }
+ switch(cmd) // ... and execute if found.
+ {
+ case CMD_scrollPageUp : gui->doScroll(-gui->Lines()/2); return;
+ case CMD_scrollPageDown : gui->doScroll(+gui->Lines()/2); return;
+ case CMD_scrollLineUp : gui->doScroll(-1 ); return;
+ case CMD_scrollLineDown : gui->doScroll(+1 ); return;
+ case CMD_scrollLock : onScrollLock( ); return;
+ }
}
if (holdScreen)
{
@@ -990,7 +988,8 @@ void TEmuVt102::onKeyPress( TQKeyEvent* ev )
// fall back handling
if (!ev->text().isEmpty())
{
- if (ev->state() & TQt::AltButton) sendString("\033"); // ESC, this is the ALT prefix
+ if ((ev->state() & TQt::AltButton) || (metaKeyMode && (ev->state() & TQt::MetaButton)))
+ 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.
// while in Qt 3 it returns the actual key ("c" or "C") which caused