@ -37,7 +37,6 @@
// Konsole
# include "KeyboardTranslator.h"
# include "SessionController.h"
# include "TerminalDisplay.h"
using Konsole : : Vt102Emulation ;
@ -1043,9 +1042,6 @@ void Vt102Emulation::sendKeyEvent(QKeyEvent *event)
const Qt : : KeyboardModifiers modifiers = event - > modifiers ( ) ;
KeyboardTranslator : : States states = KeyboardTranslator : : NoState ;
TerminalDisplay * currentView = _currentScreen - > currentTerminalDisplay ( ) ;
const bool isReadOnly = currentView - > sessionController ( ) - > isReadOnly ( ) ;
// get current states
if ( getMode ( MODE_NewLine ) ) {
states | = KeyboardTranslator : : NewLineState ;
@ -1063,18 +1059,16 @@ void Vt102Emulation::sendKeyEvent(QKeyEvent *event)
states | = KeyboardTranslator : : ApplicationKeypadState ;
}
if ( ! isReadOnly ) {
// check flow control state
if ( ( modifiers & Qt : : ControlModifier ) ! = 0u ) {
switch ( event - > key ( ) ) {
case Qt : : Key_S :
emit flowControlKeyPressed ( true ) ;
break ;
case Qt : : Key_Q :
case Qt : : Key_C : // cancel flow control
emit flowControlKeyPressed ( false ) ;
break ;
}
// check flow control state
if ( ( modifiers & Qt : : ControlModifier ) ! = 0u ) {
switch ( event - > key ( ) ) {
case Qt : : Key_S :
emit flowControlKeyPressed ( true ) ;
break ;
case Qt : : Key_Q :
case Qt : : Key_C : // cancel flow control
emit flowControlKeyPressed ( false ) ;
break ;
}
}
@ -1110,6 +1104,8 @@ void Vt102Emulation::sendKeyEvent(QKeyEvent *event)
if ( entry . command ( ) ! = KeyboardTranslator : : NoCommand )
{
TerminalDisplay * currentView = _currentScreen - > currentTerminalDisplay ( ) ;
if ( ( entry . command ( ) & KeyboardTranslator : : EraseCommand ) ! = 0 ) {
textToSend + = eraseChar ( ) ;
} else if ( ( entry . command ( ) & KeyboardTranslator : : ScrollPageUpCommand ) ! = 0 ) {
@ -1132,10 +1128,8 @@ void Vt102Emulation::sendKeyEvent(QKeyEvent *event)
textToSend + = _codec - > fromUnicode ( event - > text ( ) ) ;
}
if ( ! isReadOnly ) {
emit sendData ( textToSend ) ;
}
} else if ( ! isReadOnly ) {
emit sendData ( textToSend ) ;
} else {
// print an error message to the terminal if no key translator has been
// set
QString translatorError = i18n ( " No keyboard translator available. "