From f7354e54dc590c5236853c6ac42854ebc48cf98c Mon Sep 17 00:00:00 2001 From: Filippo Scognamiglio Date: Mon, 11 Aug 2014 21:51:50 +0200 Subject: [PATCH] Fixing keytabs (thank you yurivkhan)! --- app/PreprocessedTerminal.qml | 2 +- konsole-qml-plugin/src/KeyboardTranslator.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/PreprocessedTerminal.qml b/app/PreprocessedTerminal.qml index a96f7df..725a2cc 100644 --- a/app/PreprocessedTerminal.qml +++ b/app/PreprocessedTerminal.qml @@ -79,7 +79,7 @@ Item{ session: KSession { id: ksession - kbScheme: "linux" + kbScheme: "default" onFinished: { Qt.quit() diff --git a/konsole-qml-plugin/src/KeyboardTranslator.cpp b/konsole-qml-plugin/src/KeyboardTranslator.cpp index a2ad22c..e87631d 100644 --- a/konsole-qml-plugin/src/KeyboardTranslator.cpp +++ b/konsole-qml-plugin/src/KeyboardTranslator.cpp @@ -439,7 +439,7 @@ bool KeyboardTranslatorReader::parseAsStateFlag(const QString& item , KeyboardTr bool KeyboardTranslatorReader::parseAsKeyCode(const QString& item , int& keyCode) { QKeySequence sequence = QKeySequence::fromString(item); - if ( !sequence.isEmpty() ) + if ( !sequence.isEmpty() && sequence[0] != Qt::Key_unknown ) { keyCode = sequence[0]; @@ -453,6 +453,12 @@ bool KeyboardTranslatorReader::parseAsKeyCode(const QString& item , int& keyCode keyCode = Qt::Key_PageUp; else if ( item == "next" ) keyCode = Qt::Key_PageDown; + else if ( item == "bracketleft" ) + keyCode = Qt::Key_BracketLeft; + else if ( item == "backslash" ) + keyCode = Qt::Key_Backslash; + else if ( item == "bracketright" ) + keyCode = Qt::Key_BracketRight; else return false;