Abdelrazak Younes wrote:
> Richard Heck wrote:
>> Abdelrazak Younes wrote:
>>> Martin Vermeer wrote:
>>>> I seem to recall that there was some code in the Qt X event handling
>>>> code, precisely to handle this problem. Lars wrote this. But then it
>>>> was decided that it could be removed... anyone remember? Something
>>>> with coalescing of multiple keystroke events.
>>> Yes there is a patch in bugzilla for _key_ events but this is
>>> independent issue: Helge's problem is about the scrollbar.
>>>
>>> About Lars patch I hoped that someone on Linux (Richard?) would
>>> continue with this patch...
>> Point me in the right direction. I have a vague memory of this....
> 
> http://bugzilla.lyx.org/show_bug.cgi?id=3320
> 
> There's a patch mostly ready for the key release problem. The only
> problem with the patch is that it uses specific X11 event; it would be
> better to do something similar with Qt only API. But this is not a big
> problem because the bug is only visible on certain version of X11
> apparently, not for Windows or Mac.
> 
> Abdel.
> 

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 ...
Index: qt4/GuiWorkArea.cpp
===================================================================
--- qt4/GuiWorkArea.cpp (Revision 18371)
+++ qt4/GuiWorkArea.cpp (Arbeitskopie)
@@ -414,6 +414,15 @@
 
 void GuiWorkArea::keyPressEvent(QKeyEvent * e)
 {
+       // do nothing if there are other events
+       // (the auto repeated events come too fast)
+       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