From 032d16501d8c8cd3a163b39e36c5d168df078767 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Peter=20K=C3=BCmmel?= Date: Thu, 17 May 2007 08:24:44 +0000 Subject: [PATCH] don't process generated key events if the system is busy git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18376 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiWorkArea.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/frontends/qt4/GuiWorkArea.cpp b/src/frontends/qt4/GuiWorkArea.cpp index 34b14d683b..168ed877b9 100644 --- a/src/frontends/qt4/GuiWorkArea.cpp +++ b/src/frontends/qt4/GuiWorkArea.cpp @@ -414,6 +414,15 @@ void GuiWorkArea::generateSyntheticMouseEvent() void GuiWorkArea::keyPressEvent(QKeyEvent * e) { + // do nothing if there are other events + // (the auto repeated events come too fast) + if(e->isAutoRepeat() && QCoreApplication::hasPendingEvents()) { + LYXERR(Debug::KEY) << BOOST_CURRENT_FUNCTION << endl + << "key ignored" << endl; + e->ignore(); + return; + } + LYXERR(Debug::KEY) << BOOST_CURRENT_FUNCTION << " count=" << e->count() << " text=" << fromqstr(e->text()) -- 2.39.5