Exclude modifier keys from triggering typing notifications

fixes #116
This commit is contained in:
Konstantinos Sideris 2017-11-05 00:19:00 +02:00
parent 8c5a331c73
commit 595d11cfa0

View file

@ -40,11 +40,14 @@ FilteredTextEdit::FilteredTextEdit(QWidget *parent)
void
FilteredTextEdit::keyPressEvent(QKeyEvent *event)
{
if (!typingTimer_->isActive()) {
emit startedTyping();
}
const bool isModifier = (event->modifiers() != Qt::NoModifier);
typingTimer_->start();
if (!isModifier) {
if (!typingTimer_->isActive())
emit startedTyping();
typingTimer_->start();
}
if (event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter) {
stopTyping();