Skip to content
Snippets Groups Projects
Commit 595d11cf authored by Konstantinos Sideris's avatar Konstantinos Sideris
Browse files

Exclude modifier keys from triggering typing notifications

fixes #116
parent 8c5a331c
No related branches found
No related tags found
No related merge requests found
......@@ -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);
if (!isModifier) {
if (!typingTimer_->isActive())
emit startedTyping();
typingTimer_->start();
typingTimer_->start();
}
if (event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter) {
stopTyping();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment