From 8d85b9c071640a1261779b1057176dd040a3bd46 Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Fri, 21 Jun 2019 22:22:43 +0200 Subject: [PATCH] Override Home and End behaviour. Home now brings you to the beginning of the message (previously of the line) End now brings you to the end of the message (previously of the line) --- src/widgets/splits/SplitInput.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/widgets/splits/SplitInput.cpp b/src/widgets/splits/SplitInput.cpp index c94b91171..1e7b1fdb4 100644 --- a/src/widgets/splits/SplitInput.cpp +++ b/src/widgets/splits/SplitInput.cpp @@ -250,6 +250,22 @@ void SplitInput::installKeyPressedEvent() } } } + else if (event->key() == Qt::Key_Home) + { + QTextCursor cursor = this->ui_.textEdit->textCursor(); + cursor.movePosition(QTextCursor::Start); + this->ui_.textEdit->setTextCursor(cursor); + + event->accept(); + } + else if (event->key() == Qt::Key_End) + { + QTextCursor cursor = this->ui_.textEdit->textCursor(); + cursor.movePosition(QTextCursor::End); + this->ui_.textEdit->setTextCursor(cursor); + + event->accept(); + } else if (event->key() == Qt::Key_H && event->modifiers() == Qt::AltModifier) {