Community
    • Login

    Is it possible to scroll up/down with middle-click ? And/or move other view separator left/right ?

    Scheduled Pinned Locked Moved General Discussion
    6 Posts 3 Posters 66 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      shodanx2
      last edited by

      Hi,

      I wanted to move the “other view” separator with more ease

      38403c68-32df-4273-9f41-4ef2c542cccb-image.png

      That bar in the middle

      And I tried middle-click-drag, and it does nothing, there is no action associated with that button

      I was wondering if I could make a plugin that
      When I middle-click-drag left and right, it would move the separator left and right ?

      Or maybe a plugin that does this already exists ?

      df4cb183-2c57-4343-91cf-b5bceebdfe21-image.png
      ok I’ll wait

      Thanks !

      PeterJonesP Alan KilbornA 2 Replies Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @shodanx2
        last edited by

        @shodanx2 said in Is it possible to scroll up/down with middle-click ? And/or move other view separator left/right ?:

        I wanted to move the “other view” separator with more ease

        Left click and drag isn’t easy enough for you?

        Alan KilbornA S 2 Replies Last reply Reply Quote 0
        • Alan KilbornA
          Alan Kilborn @PeterJones
          last edited by

          @PeterJones said in Is it possible to scroll up/down with middle-click ? And/or move other view separator left/right ?:

          Left click and drag isn’t easy enough

          I think maybe what was meant was “middle click anywhere in either window” to initiate the desired behavior?

          1 Reply Last reply Reply Quote 0
          • Alan KilbornA
            Alan Kilborn @shodanx2
            last edited by

            @shodanx2 said :

            I was wondering if I could make a plugin that

            Yes, you could.

            maybe a plugin that does this already exists ?

            I for one don’t recall one that does this.

            1 Reply Last reply Reply Quote 0
            • S
              shodanx2 @PeterJones
              last edited by

              @PeterJones
              Hello,

              Yes by that I mean at positionning the cursor on a 15 pixel wide bar and then left-click-dragging it left and right, is more difficult than.

              Placing the cursor anywhere on the window and middle-click-dragging left and right.

              This is probably because I’m an altsnap user with the hotclick function enabled that I noticed this.

              https://github.com/RamonUnch/AltSnap

              In my operating system, I press my hotclick button and I can move window around, no matter when I click them, and I right-click-resize them also by click them almost anywhere (well, resizing is by quadrant)

              And so, I find I often need to swipe the other view separator left and right, relatively often and I find that comparatively finicky compared to moving around anything else on my desktop.

              I also use “scroll anywhere” in my browser

              https://addons.mozilla.org/en-CA/firefox/addon/scroll_anywhere/

              Which allows me to middle click drag anywhere on a page and very quickly scroll it up and down. One windowheight of dragging equals 100% document scroll height, so the most you have to scroll is one page height to get anywhere in the document, this is a kind of “rough scrolling” and I finish fine scrolling with my mouse that has a semi-automatic “smooth scroll” function (electromagnetic clutch that opens when you scroll it fast)

              So I thought that these could be easily done in notepad++. I figured I would ask before trying to make it myself.

              Since the middle-click-drag is not currently bound to any action, I think a script that listens for middle-click-dragging. Then for every pixel of left-right movement, move the other view separator by an equal amount of pixel in the same (or opposite ? maybe some people would prefer opposite) direction. And maybe also for up/down movement, scroll the document up and down by a percentage of the document height by the amount of cursor movement divided with the windowheight of notepad++, in the view that was initially click at the start of middle-click dragging

              I tried doing this with pythonscript however it appears that pythonscript does not have mouse movement event hooks and it would need an external application (like altsnap and x mouse button control) to monitor the mousemovements ? but maybe a “real” plugin could do it ?

              Here is a tentative non-working pseudo code of what that might look like

              from pynput import mouse
              from time import sleep
              from Npp import notepad
              
              initial_x = None
              initial_splitter = None
              
              def on_click(x, y, button, pressed):
                  global initial_x, initial_splitter
                  if button == mouse.Button.middle:
                      if pressed:
                          initial_x = x
                          initial_splitter = notepad.getSplitterPos()[0]
                      else:
                          initial_x = None
              
              def on_move(x, y):
                  global initial_x, initial_splitter
                  if initial_x is not None:
                      delta = x - initial_x
                      notepad.setSplitterPos(initial_splitter + delta)
              
              listener = mouse.Listener(on_click=on_click, on_move=on_move)
              listener.start()
              
              # Keep script running
              while True:
                  sleep(1)
              
              Alan KilbornA 1 Reply Last reply Reply Quote 0
              • Alan KilbornA
                Alan Kilborn @shodanx2
                last edited by

                @shodanx2 said :

                I tried doing this with pythonscript however

                You can do it in a PythonScript, but you have to obtain the window handle for the control of interest and then set up a hook function to be able to monitor its messages. When you get the message(s) of interest, then run the logic(s) that you’d like to have.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                The Community of users of the Notepad++ text editor.
                Powered by NodeBB | Contributors