mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-26 04:58:49 +03:00
parent
8c5a331c73
commit
595d11cfa0
1 changed files with 7 additions and 4 deletions
|
@ -40,11 +40,14 @@ FilteredTextEdit::FilteredTextEdit(QWidget *parent)
|
||||||
void
|
void
|
||||||
FilteredTextEdit::keyPressEvent(QKeyEvent *event)
|
FilteredTextEdit::keyPressEvent(QKeyEvent *event)
|
||||||
{
|
{
|
||||||
if (!typingTimer_->isActive()) {
|
const bool isModifier = (event->modifiers() != Qt::NoModifier);
|
||||||
emit startedTyping();
|
|
||||||
}
|
|
||||||
|
|
||||||
typingTimer_->start();
|
if (!isModifier) {
|
||||||
|
if (!typingTimer_->isActive())
|
||||||
|
emit startedTyping();
|
||||||
|
|
||||||
|
typingTimer_->start();
|
||||||
|
}
|
||||||
|
|
||||||
if (event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter) {
|
if (event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter) {
|
||||||
stopTyping();
|
stopTyping();
|
||||||
|
|
Loading…
Reference in a new issue