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.

This commit is contained in:
Petr Vanek
2013-02-05 11:35:04 +01:00
parent 6b68ecdc5f
commit df4f9ca0ec
+8 -1
View File
@@ -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() );
}