Buttons for Mouse Scroll

Introduction: Buttons for Mouse Scroll

I have had several computer mice over the years and the scroll wheel
is the one thing that consistantly either doesn't work or works erratically.

I have mostly avoided using the scroll option until recently when I decided to give the graphics package Blender a try, here I found I couldn't get away without using the scroll wheel as it is used to zoom in and out of the viewing area.

Having played around with 32U4 Pro Micro boards as keyboard and mouse input I was interested to see if there was a scroll option as this was not something I had seen used.

Checking the Arduino documentation [1] showed that there was a scroll value in the Mouse.move() function -> Mouse.move(xVal, yVal, wheel).

I wondered if instead of rotating a wheel I could use the push of a button to do each scroll increment and, after testing, found that I could.

Step 1: Hardware:

1* 32U4 Pro Micro clone

2* 6mm square momentary pushbuttons

1* Stripboard 24*37

2* 12 way 0.1 inch sockets - for the Pro Micro

Step 2: Construction;

I designed and build a small board to hold all of the components.

The Pro Micro is plugged into 2* 12 way 0.1 inch sockets and there is a small amount of wiring for the switches and ground connections (6 wires).
There are 13 track breaks 12 of which are between the Pro Micro pins and the other next to one of the switches. Connection to the PC is via the USB connector of the Pro Micro.

I plugged the 2*12 way sockets into the pro micro for stability and then soldered in the corner pins first before soldering the rest. I then soldered in the buttons and did the wiring. Finally I put in the track breaks.

Step 3: Software:

I wrote the software and programmed the Pro Micro using the Arduino IDE.

For programming purposes the Pro Micro shows up as Arduino Leonardo.

The software uses a timer interrupt to poll and debounce the buttons, when a button is pressed, or more accurately pressed then released the Mouse.Move() function is called to send the scroll value to the attached PC.

I saw no documentation on what scroll value to use so tried 1 which gave a positive increment and then -1 which gave a negative increment; the documentation specifically lists the scroll value as a signed char.

Step 4: Use:

The unit is just plug and play, it shows up as a HID device to the PC and there are no drivers to install.

Step 5: References:

[1] Arduino USB Mouse documentation https://www.arduino.cc/reference/en/language/functions/usb/mouse/mousemove/ (Retrieved 6/July/2019)

Be the First to Share


    • Tinkercad to Fusion 360 Challenge

      Tinkercad to Fusion 360 Challenge
    • Digital Fabrication Student Design Challenge

      Digital Fabrication Student Design Challenge
    • Electronics Contest

      Electronics Contest



    Question 2 years ago

    Hola como podria hacer que el scroll fuese más rápido. No entiendo como funciona el retardo y creo que la cuestión va por este camino. Te dejo mi correo jmtinformatic@gmail.com


    Answer 2 years ago

    No hay retraso cada vez que presione el botón produce un evento de desplazamiento.
    Parece que desea que el desplazamiento continúe con el botón presionado, el código tendría que volver a escribirse para lograrlo.
    Traducido usando Google.

    There is no delay each press of the button produces one scroll event.
    It sounds as if you want the scrolling to continue with the button kept pressed the code would have to be re written to accomplish that.
    Translated using Google.