in Windows Development & Utilities

Trackball to Scroll Wheel

Having recently switched, presently on a trial basis, to using a “Logitech Trackman Marble” trackball I discovered a fatal flaw in Logitech’s software, some would argue hardware, the lack of a means of scrolling through pages, web or otherwise. I was quick to remedy this with a poorly written script, which was promptly dumped for some abandoned software written in 2009 (Marble Mouse Scroll Wheel, which as it happened was a bit too buggy) and finally today wrote a not terrible, and definitely superior to what I have so far tried, AutoHotkey script.

When holding either the back or forward mouse buttons the trackball becomes a scroll ball wheeling up, down, left and right as you would expect. The buttons retain their previous functionality if simply clicked. If you hold down a modifier (control, alt &c.), hold either the back or forward buttons and then release the modifier, scrolling will include that modifier, allowing you to zoom in and out using control for example. Sadly I couldn’t work out a way to get it to work while you continued to hold down a modifier but if I come across a solution it’ll be sure to be post here. To use the scrolling in some elevated windows (windows of programmes running as administrator) you may need to run the script as administrator. It’ll almost certainly work elsewhere unevaluated.

Requires: AutoHotkey
Download: ScrollWheelSimulator.ahk

Your thoughts? Click here to comment.


All fields voluntary.
Comment submission rules apply.

  1. Is there a way to change it so you click the left button instead of the back / forward button to enable scrolling? Seems like it would be much easier than shifting your hand over a bit to those buttons. Thanks!

    • While you can change it to the left or right mouse button or any key on the keyboard the script as it is essentially replaces holding down the chosen button with scrolling. So if you chose the left button the script will block dragging, selecting text as well as numerous other things.

      The code that needs changing to alter the keys starts with line 79 XButton1:: and ends with ; =============================== on line 134. If you wanted to change the key to the right mouse button you would replace that with the following.

        scrollActive( "RButton" )
      ; ==============================
        scrollActive( "RButton", "LCtrl" )
        scrollActive( "RButton", "RCtrl" )
      ; ==============================
        scrollActive( "RButton", "RAlt" )
      ; ==============================
        scrollActive( "RButton", "LShift" )
        scrollActive( "RButton", "RShift" )
      ; ===============================
    • I’ve been looking for a good version of this forever.. months on and off.. and finally found yours and it’s PERFECT!!! :) THANK YOU!!!!

  2. Great program. I just came across it. I am a tiny bit familiar with AHK. Would it be possible to modify the script to slow down the scrolling?


    • That’d certainly be possible. I wrote the script a few years back and the code is a little janky so implementing that seems more difficult than it ought to be. I’ll see if I can’t rewrite the thing with a variable for the speed.
      The other thing to look at is your OS mouse settings. There’s usually a setting for the mouse wheel speed, on Windows it’s set by default to move 3 lines per click. If you change this to a lower value the speed should be decreased in most scenarios. To access the mouse dialogue directly on Windows run “control main.cpl” then head to the Wheel tab.