Menu

#1450 Support horizontal scrolling via WM_MOUSEHWHEEL on Windows

Committed
closed
nobody
5
2022-10-12
2022-09-12
No

Merge request 35 adds support for horizontal scrolling on Windows by handling the WM_MOUSEHWHEEL mouse message.

Discussion

  • Neil Hodgson

    Neil Hodgson - 2022-09-21
    • labels: --> scintilla, win32, mouse
    • Group: Initial --> Committed
     
  • Neil Hodgson

    Neil Hodgson - 2022-09-21

    Committed with change to initialize all fields in structure to avoid warning as [136ec1].

     

    Related

    Commit: [136ec1]

  • Markus Nißl

    Markus Nißl - 2022-09-21

    Thanks for committing.

    Scrolling horizontally with the "standard" vertical mouse wheel by holding down the shift key is supported natively on macOS and also by various applications on Windows, foremost web broswers and also Visual Studio Code (which essentially runs in a web browser).

    According to the source code in ScintillaWin::MouseMessage(), your idea for shift+wheel was to support "data zoom":

    // Don't handle datazoom.
    // (A good idea for datazoom would be to "fold" or "unfold" details.
    // i.e. if datazoomed out only class structures are visible, when datazooming in the control
    // structures appear, then eventually the individual statements...)
    if (wParam & MK_SHIFT) {
      return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam);
    }
    

    This sounds like an interesting approach, though it is quite language/content dependent, or at least dependent on the presence of fold levels.

    Wouldn't it make more sense for Scintilla to support horizontal scrolling via shift+wheel and leave the data zoom feature to be implemented by the application (in which case the app can decide to trigger data zoom this way or another)?

     
    • Neil Hodgson

      Neil Hodgson - 2022-09-21

      The early Microsoft ideas for mouse wheels concentrated on zooming but included data zooming as a separate axis although that has rarely been implemented.
      http://www.ericmic.com/history%20of%20the%20scroll%20wheel.htm

      The comment is from 2000 or earlier and no one has been sufficiently motivated to implement data zooming since then so shift + wheel can be used for horizontal scrolling.

       
  • Zufu Liu

    Zufu Liu - 2022-09-23
    • labels: scintilla, win32, mouse --> scintilla, win32, mouse, scrolling
     
  • Neil Hodgson

    Neil Hodgson - 2022-10-12
    • status: open --> closed
     

Log in to post a comment.