A scroll wheel encoder is a component of a computer mouse that fails first. If the manipulator frayed the cord at the entrance to the case, almost every master knows how to solder it. If the encoder exits the stand, you will have to break another mouse to replace it. And it happens so that the pin that connects the wheel with the encoder breaks. Good advice "you need to buy quality mice from the very beginning" does not always help. The author of Instructables under the nickname Mr_Glenn was tired of fighting with mice, and he got the hang of using the PgUp and PgDn buttons instead of the encoder. But sooner or later, any user is faced with some program where scaling is performed using the wheel, and these buttons do not help. So he came across - such an application turned out to be a regular editor of three-dimensional graphics, which got its name from a kitchen appliance. Blender, of course ...
But the master did not start because of this again to mock the poor encoder. And he took an inexpensive clone of the 32U4 Pro Micro board, compatible with Arduino Leonardo Such a board can pretend to be an HID device - through a keyboard, there, or with a mouse through the same Micro USB connector, which is intended for programming it. It is enough to add two buttons to such a board, as shown in the diagram. In a good way, of course, we need two more pull-up resistors, but it works without them.
In general, it doesn’t matter how you connect these two buttons to the board. You can exclude the connectors for the comb and solder the board directly into the breadboard type perfboard. You can exclude the breadboard itself, and make all connections with wires. It is also advisable to use small microswitches with levers instead of clock buttons. The main thing is to fill small sketchusing variables xVal, yVal, wheel of function Mouse.move (). When uploading the firmware, select the Arduino Leonardo board in the Arduino IDE.
In modern operating systems, the simultaneous operation of several USB keyboards and mice is allowed. You can rotate the encoder on one mouse, move the other, and press the buttons in general on the third. This one homemade pretend to be a second mouse. Pressing the buttons of the device will simulate the rotation of the encoder in each of two directions. And with a real mouse, you will, as before, perform all other operations without consuming the encoder resource. And your nervous system.
Of course, it is better if the design will work "not in principle, but in the case." You can get around a lot of stores, but you will not find a more budgetary building than a small junction box.