#1631 Windows wheel/scrolling modifications

Feature_Request
open-works-for-me
Neil Hodgson
5
2014-08-14
2014-08-03
Lim Wei Zhong
No

The mouse wheel event only moves in multiples of 3 lines (by the system default). According to http://msdn.microsoft.com/en-us/library/ms997498.aspx , it should scroll a fraction of that whenever possible. I've some code which aims to replace ScintillaWin.cxx lines 881-909 to get this done, but I have not tested it yet. My patch should scroll marginally less than the original because of the floor/ceiling calculations, but that is negligible.

Also, if there is no reason for allowing to WM_HSCROLL past the right side of the window, why not add the 3 lines of checking for SB_LINEDOWN from the SB_PAGEDOWN (see ScintillaWin.cxx lines 2357-2359)?

1 Attachments

Discussion

  • Neil Hodgson
    Neil Hodgson
    2014-08-03

    It won't build unless an extra scope is created to allow definition of linesPerScroll2 (which should have a better name). After fixing that it doesn't change scrolling behaviour with a Logitech Anywhere Mouse MX in continuous mode.

    With SB_LINEDOWN, the comment indicates the reason: "May move past the logical end".

     
  • Lim Wei Zhong
    Lim Wei Zhong
    2014-08-03

    Yes, it would not change scrolling behaviour if your "mouse properties" has already set SPI_GETWHEELSCROLLLINES to 1, meaning that linesPerScroll=1.

    I don't see the reason for the comment because even dragging the scrollbar does not permit scrolling past the end.

     
  • Neil Hodgson
    Neil Hodgson
    2014-08-03

    When the lines per scroll are set to 6 or 3 with the patch it still always scrolls 6 or 3 lines respectively. The same with a Zone Touch Mouse which has a scrolling strip.

    SB_LINEDOWN is the arrow button at the end of the scroll bar - its not referring to dragging the scroll thumb.

     
  • Lim Wei Zhong
    Lim Wei Zhong
    2014-08-03

    That's unexpected. I can't see anything that could go wrong in the code. "linesPerScroll2" should be 6/3 and then depending on "wheelDelta", the result of "linesPerScroll2 * wheelDelta / WHEEL_DELTA" can be less than 3.

    If "wheelDelta / WHEEL_DELTA" is say 50/120, then "linesToScroll" would be 1. Could I see the code in context?

    About SB_LINEDOWN: I see. I found it quite unintuitive because my middle-button scrolling that my mouse driver does scrolls past the right even when there is no horizontal scrollbar.

     
  • Neil Hodgson
    Neil Hodgson
    2014-08-05

    This needs to be shown to be effective before it will be merged.

     
  • Neil Hodgson
    Neil Hodgson
    2014-08-14

    • labels: --> scintilla, mousewheel
    • status: open --> open-works-for-me
    • assigned_to: Neil Hodgson