📜 ⬆️ ⬇️

Customize Trackball Marble Trackball

Not so long ago I bought this wonderful beast:



Unlike the home animal (Cordless TrackMan Optical), it does not have a scroll wheel and has four buttons. Two main and two subsidiary ones on which nothing is hung by default. But it is clear that without the usual scrolling function is somehow not convenient. The first attempt was to scroll for additional buttons. Enter in the device section (given for the evdev driver):
')
Option "WHEELRelativeAxisButtons" "5 4"


It works the way it works, but for scrolling you have to constantly press a button, and this is not convenient. Again, the standard evdev driver does not support emulation of the third button. And in the X-Window, it allows you to insert from the buffer.
Emulation support is available only in the mouse driver. In addition, when reading the documentation, it turned out that the driver supports tricky wheel emulation, which is very convenient for the trackball (the trick is that after pressing the button a ball is used as a wheel, for the mouse this will be equivalent to movement). As a result, I prenaznachil keys as follows: '
Section "InputDevice"

Identifier "Logitech TrackMan Optical"
Driver "mouse"
Option "Device" "/dev/input/mouse0"
Option "Protocol" "Auto"
Option "Emulate3Buttons" "true"
Option "Emulate3Timeout" "50"
Option "Buttons" "9"
Option "EmulateWheel" "true"
Option "XAxisMapping" "4 5"
Option "EmulateWheelButton" "6"
Option "ButtonMapping" "1 9 3 6 2 7 8 5 4"

EndSection


As a result, additional buttons work as follows:

The left additional button works like turning on the “wheel”.
The right extra button works like a middle button.
In addition, if you press the main left and right buttons together, they will work as the third one.

As a result, we have a wheel without a wheel :)

Source: https://habr.com/ru/post/44943/


All Articles