From aed0edc705f5d6e28d327f61272f3d4b2d752cac Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Sat, 25 Nov 2006 22:35:09 +0000 Subject: [PATCH] Remove key event pruning code. This has always been disabled without anyone complaining. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16046 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiWorkArea.C | 67 ++------------------------------- src/frontends/qt4/GuiWorkArea.h | 8 ---- 2 files changed, 3 insertions(+), 72 deletions(-) diff --git a/src/frontends/qt4/GuiWorkArea.C b/src/frontends/qt4/GuiWorkArea.C index 7c9bca4d80..81edd42be5 100644 --- a/src/frontends/qt4/GuiWorkArea.C +++ b/src/frontends/qt4/GuiWorkArea.C @@ -46,15 +46,10 @@ #include #include -// Abdel (26/06/2006): -// On windows-XP the UserGuide PageDown scroll test is faster without event pruning (16 s) -// than with it (23 s). #ifdef Q_WS_WIN int const CursorWidth = 2; - #define USE_EVENT_PRUNING 0 #else int const CursorWidth = 1; - #define USE_EVENT_PRUNING 0 #endif @@ -197,20 +192,6 @@ GuiWorkArea::GuiWorkArea(int w, int h, int id, LyXView & lyx_view) << "\n viewport height\t" << viewport()->height() << endl; - if (USE_EVENT_PRUNING) { - // This is the keyboard buffering stuff... - // I don't see any need for this under windows. The keyboard is reactive - // enough... - - if ( !QObject::connect(&step_timer_, SIGNAL(timeout()), - this, SLOT(keyeventTimeout())) ) - lyxerr[Debug::GUI] << "ERROR: keyeventTimeout cannot connect!" << endl; - - // Start the timer, one-shot. - step_timer_.setSingleShot(true); - step_timer_.start(50); - } - // Enables input methods for asian languages. // Must be set when creating custom text editing widgets. setAttribute(Qt::WA_InputMethodEnabled, true); @@ -438,51 +419,9 @@ void GuiWorkArea::keyPressEvent(QKeyEvent * e) << " key=" << e->key() << endl; - if (USE_EVENT_PRUNING) { - keyeventQueue_.push(boost::shared_ptr(new QKeyEvent(*e))); - } - else { - boost::shared_ptr sym(new QLyXKeySym); - sym->set(e); - processKeySym(sym, q_key_state(e->modifiers())); - } -} - - -// This is used only if USE_EVENT_PRUNING is defined... -void GuiWorkArea::keyeventTimeout() -{ - bool handle_autos = true; - - while (!keyeventQueue_.empty()) { - boost::shared_ptr ev = keyeventQueue_.front(); - - // We never handle more than one auto repeated - // char in a list of queued up events. - if (!handle_autos && ev->isAutoRepeat()) { - keyeventQueue_.pop(); - continue; - } - - boost::shared_ptr sym(new QLyXKeySym); - sym->set(ev.get()); - - lyxerr[Debug::GUI] << BOOST_CURRENT_FUNCTION - << " count=" << ev->count() - << " text=" << fromqstr(ev->text()) - << " isAutoRepeat=" << ev->isAutoRepeat() - << " key=" << ev->key() - << endl; - - processKeySym(sym, q_key_state(ev->modifiers())); - keyeventQueue_.pop(); - - handle_autos = false; - } - - // Restart the timer. - step_timer_.setSingleShot(true); - step_timer_.start(25); + boost::shared_ptr sym(new QLyXKeySym); + sym->set(e); + processKeySym(sym, q_key_state(e->modifiers())); } diff --git a/src/frontends/qt4/GuiWorkArea.h b/src/frontends/qt4/GuiWorkArea.h index ab62eeae95..208414f3f2 100644 --- a/src/frontends/qt4/GuiWorkArea.h +++ b/src/frontends/qt4/GuiWorkArea.h @@ -146,10 +146,6 @@ private: void inputMethodEvent(QInputMethodEvent * ev); public Q_SLOTS: - /// Timeout event Slot for keyboard bufferring. - /// \todo This is not used currently in the code, remove? - void keyeventTimeout(); - /// Adjust the LyX buffer view with the position of the scrollbar. /** * The action argument is not used in the the code, it is there @@ -164,10 +160,6 @@ private: /// SyntheticMouseEvent synthetic_mouse_event_; - /// \todo remove - QTimer step_timer_; - /// \todo remove - std::queue > keyeventQueue_; /// double_click dc_event_; -- 2.39.2