Loading ...
Sorry, an error occurred while loading the content.

mouse wheel win32 and gui.c

Expand Messages
  • Anduin Withers
    How necessary for other systems is the following code (vim60al gui.c line 3146 in function gui_update_scrollbars): if (!gui.which_scrollbars[SBAR_LEFT] &&
    Message 1 of 4 , Jun 30, 2001
    • 0 Attachment
      How necessary for other systems is the following code (vim60al gui.c line
      3146 in function gui_update_scrollbars):

      if (!gui.which_scrollbars[SBAR_LEFT] &&
      !gui.which_scrollbars[SBAR_RIGHT])
      return;

      (The following may only apply to win32)

      max is never set for the scrollbar. This makes the mouse wheel useless
      unless you have scrollbars visible (I don't, I don't like them in general
      and like them even less in vim where more convenient scrolling mechanisms
      are readily available).

      If possible I'd like to see one of two things happen... make the mouse wheel
      code smarter and bail early with the same short circuit
      gui_update_scrollbars uses or make gui_update_scollbars update the
      scrollbars even it they are not visible.

      Oh motivation:

      I use the mouse wheel in other apps and occasionally hit it in vim.
      Unfortunately vim's behavior without scrollbars is very unfriendly, it
      changes the window to display the first page of the buffer (or the first
      page + 1 line depending on the scroll direction) and places the cursor on
      the last line of the window.

      (To reproduce this turn off scrollbars in your .vimrc and use the mouse
      wheel)

      --
      Anduin Withers
    • Bram Moolenaar
      ... I would be surprised if the mouse wheel works at all without scrollbars present. Perhaps it does for the real Microsoft mouse? It certainly doesn t for
      Message 2 of 4 , Jul 1, 2001
      • 0 Attachment
        Anduin Withers wrote:

        > How necessary for other systems is the following code (vim60al gui.c line
        > 3146 in function gui_update_scrollbars):
        >
        > if (!gui.which_scrollbars[SBAR_LEFT] &&
        > !gui.which_scrollbars[SBAR_RIGHT])
        > return;
        >
        > (The following may only apply to win32)
        >
        > max is never set for the scrollbar. This makes the mouse wheel useless
        > unless you have scrollbars visible (I don't, I don't like them in general
        > and like them even less in vim where more convenient scrolling mechanisms
        > are readily available).

        I would be surprised if the mouse wheel works at all without scrollbars
        present. Perhaps it does for the "real" Microsoft mouse? It certainly
        doesn't for mine (Ami mouse).

        > If possible I'd like to see one of two things happen... make the mouse wheel
        > code smarter and bail early with the same short circuit
        > gui_update_scrollbars uses or make gui_update_scollbars update the
        > scrollbars even it they are not visible.

        I think most mouse scroll wheels detect the scrollbar window and send events
        to it to make the scrolling happen. It just won't work without the
        scrollbars.

        If someone knows how it really works, let him (or her) send a patch.

        --
        hundred-and-one symptoms of being an internet addict:
        43. You tell the kids they can't use the computer because "Daddy's got work to
        do" and you don't even have a job.

        /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
        ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim )))
        \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
      • Anduin Withers
        ... It does. NT4+ and 98+ send WM_MOUSEWHEEL to the focused window when the mouse wheel is changed. Vim processes this in gui_w32.c. On 2K I can get the mouse
        Message 3 of 4 , Jul 1, 2001
        • 0 Attachment
          > I would be surprised if the mouse wheel works at all without scrollbars
          > present. Perhaps it does for the "real" Microsoft mouse? It certainly
          > doesn't for mine (Ami mouse).

          It does. NT4+ and 98+ send WM_MOUSEWHEEL to the focused window when the
          mouse wheel is changed. Vim processes this in gui_w32.c.

          On 2K I can get the mouse wheel to work without scrollbars by removing the
          two lines in gui.c mentioned in my last message.

          Oh and yes it is a genuine MS optical mouse but I don't think that matters
          anymore (could be wrong never played with mouse wheel messages and support
          before).

          > I think most mouse scroll wheels detect the scrollbar window and send
          events
          > to it to make the scrolling happen. It just won't work without the
          > scrollbars.

          I believe the initial wave of mouse wheel mice worked as you suggest but now
          there is actual support in the underlying OS with a real message.

          --
          Anduin Withers
        • Bram Moolenaar
          ... Yes, that message is only used for the MS mouse, as far as I know. ... OK. I ll add a #ifdef around them, so that the lines are only used for other
          Message 4 of 4 , Jul 2, 2001
          • 0 Attachment
            Anduin Withers wrote:

            > > I would be surprised if the mouse wheel works at all without scrollbars
            > > present. Perhaps it does for the "real" Microsoft mouse? It certainly
            > > doesn't for mine (Ami mouse).
            >
            > It does. NT4+ and 98+ send WM_MOUSEWHEEL to the focused window when the
            > mouse wheel is changed. Vim processes this in gui_w32.c.

            Yes, that message is only used for the MS mouse, as far as I know.

            > On 2K I can get the mouse wheel to work without scrollbars by removing the
            > two lines in gui.c mentioned in my last message.

            OK. I'll add a #ifdef around them, so that the lines are only used for other
            systems.

            > Oh and yes it is a genuine MS optical mouse but I don't think that matters
            > anymore (could be wrong never played with mouse wheel messages and support
            > before).

            It does matter. Many programs don't support the mousewheel messages. It's
            one of those MS things to encourage you to buy the latest version (and give
            your $$$ to MS). I never had problems with non-MS mice, while the MS mouse
            has the focus bug problem.

            > > I think most mouse scroll wheels detect the scrollbar window and send
            > > events to it to make the scrolling happen. It just won't work without the
            > > scrollbars.
            >
            > I believe the initial wave of mouse wheel mice worked as you suggest but now
            > there is actual support in the underlying OS with a real message.

            The OS has supported it for a long time already. The problem is that many
            applications don't handle the message. Not everybody uses the latest version.

            --
            hundred-and-one symptoms of being an internet addict:
            56. You leave the modem speaker on after connecting because you think it
            sounds like the ocean wind...the perfect soundtrack for "surfing the net".

            /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
            ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim )))
            \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
          Your message has been successfully submitted and would be delivered to recipients shortly.