Peter Kümmel wrote:
>> I've found a simpler solution. See attached patch.
>>
>> It now stops immediately when the page up/down key is released
>> the same for the mouse button.
>> (seems the mouse button event is mapped to the page up/down key.)
>> Tested under Linux and Windows.
>>
>> Peter
>>
>>
>> waiting for a ok ...
> 
> but I forgot that it would also eat other key events. So when you
> type text faster than the GUI could update, what should be possible
> with ten fingers, some will be lost. We must check for the
> page up/down key. I update the patch.
>




Index: src/frontends/qt4/GuiWorkArea.cpp
===================================================================
--- src/frontends/qt4/GuiWorkArea.cpp   (revision 18371)
+++ src/frontends/qt4/GuiWorkArea.cpp   (working copy)
@@ -414,6 +414,17 @@
 
 void GuiWorkArea::keyPressEvent(QKeyEvent * e)
 {
+       // do nothing if there are other events
+       // (the auto repeated events come too fast)
+       if (e->key() == Qt::Key_PageDown || e->key() == Qt::Key_PageDown) {
+               if(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())

Reply via email to