From df4f9ca0ec6dbe494ce17bd6019e02cd86b180ce Mon Sep 17 00:00:00 2001 From: Petr Vanek Date: Tue, 5 Feb 2013 11:35:04 +0100 Subject: [PATCH] The control and tab keys don't work in Qt/E. This fixes it, but maybe not in the most elegant way. The trouble seems to be that _codec->fromUnicode(event->text()) doesn't handle control characters in qt-embedded. --- lib/Vt102Emulation.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/Vt102Emulation.cpp b/lib/Vt102Emulation.cpp index bce8b4b..2ae3728 100644 --- a/lib/Vt102Emulation.cpp +++ b/lib/Vt102Emulation.cpp @@ -952,8 +952,15 @@ void Vt102Emulation::sendKeyEvent( QKeyEvent* event ) { textToSend += _codec->fromUnicode(entry.text(true,modifiers)); } - else + else if((modifiers & Qt::ControlModifier) && event->key() >= 0x40 && event->key() < 0x5f) { + textToSend += (event->key() & 0x1f); + } + else if(event->key() == Qt::Key_Tab) { + textToSend += 0x09; + } + else { textToSend += _codec->fromUnicode(event->text()); + } sendData( textToSend.constData() , textToSend.length() ); }