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)
This commit is contained in:
Rasmus Karlsson 2019-06-21 22:22:43 +02:00
parent 406c0b9af8
commit 8d85b9c071

View file

@ -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)
{