<table><tr><td style="">rjvbb added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D5037" rel="noreferrer">View Revision</a></tr></table><br /><div><div><blockquote style="border-left: 3px solid #8C98B8;
          color: #6B748C;
          font-style: italic;
          margin: 4px 0 12px 0;
          padding: 8px 12px;
          background-color: #F8F9FC;">
<div style="font-style: normal;
          padding-bottom: 4px;">In <a href="https://phabricator.kde.org/D5037#94944" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;" rel="noreferrer">D5037#94944</a>, <a href="https://phabricator.kde.org/p/anthonyfieroni/" style="
              border-color: #f1f7ff;
              color: #19558d;
              background-color: #f1f7ff;
                border: 1px solid transparent;
                border-radius: 3px;
                font-weight: bold;
                padding: 0 4px;" rel="noreferrer">@anthonyfieroni</a> wrote:</div>
<div style="margin: 0;
          padding: 0;
          border: 0;
          color: rgb(107, 116, 140);"><p>Ok, we discard first wheel event cause elapsed timer isn't started, right?</p></div>
</blockquote>

<p>No, it's not discarded; no wheel events are being discarded unless they already were being discarded. What my addition does is turn certain Ctrl+Wheel events into regular wheel events so that the view continues to scroll when you press the modified during a scroll (instead of switching to zooming).</p>

<p>There is no previous event so there's no need to do any checks to see if the modifier should be allowed to trigger zooming. So the first wheelevent just passes through the filter unmodified and if the modifier is pressed it will trigger zooming. Any other approach will probably only make things more difficult. And FWIW it's already semantically doubtful to set m_lastWheelEventUnmodified to false in the WheelEventFilter ctor (there is only a last event after the 1st wheel event has been processed) so putting it in the KateViewInternal ctor makes even less sense.</p>

<p>Similarly, the timer must be specific to wheel events, you wouldn't want mouse movements to interfere for instance. Or at least I think so, I only have trackpads nowadays.</p>

<p>Setting the modifier key in KateViewInternal does make sense but more so when it actually becomes possible to change it. Until that's not the case the compiler can optimise the current implementation a bit better (as far as that's of any importance here).</p>

<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>I think we can "catch" all events we just make it a bit different</p></blockquote>

<p>I don't think I understand what you mean here. What we don't catch is situations where the events tell the view to continue scrolling in a direction where that's no longer possible. My PoC implementation on github catches those situations but would be overkill (and probably interfere with zooming when the document is at the top or bottom).</p>

<p>As to dropping wheel events: that doesn't happen but even if it did that shouldn't be a big deal if only 1 or a few events are dropped. This kind of event arrive in bursts from an effect-driven user input that isn't transient. IOW, contrary to clicking something, s/he will continue to turn the wheelbutton (or swipe up/down) until satisfied with whatever the desired result. I strongly doubt anyone one would notice if we dropped the 1st wheel event for instance.</p></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D5037" rel="noreferrer">https://phabricator.kde.org/D5037</a></div></div><br /><div><strong>To: </strong>rjvbb, KTextEditor<br /><strong>Cc: </strong>anthonyfieroni, dhaumann, kwrite-devel, KTextEditor, Frameworks, head7, cullmann, kfunk, sars<br /></div>