I love Logitech's trackball mouse TM-150r. Even on Ubuntu 20.04, I wanted to add a wheel function to TM-150r, and I did a lot of research, so I will leave it as a memo. Specifically, I made it possible to scroll by moving the cursor while pressing the small button (left small button) above the left mouse button.
First, I checked the id of TM-150r with the following command.
$ xinput list
↳ Logitech USB Trackball id=11 [slave pointer (2)]
I found out that the id of TM-150-r is 11.
Then I typed the following command to identify the number of the small left button.
First, without pressing anything with the mouse
$ xinput query-state 11
11 is the id you identified earlier. Then the output is
2 classes : ButtonClass button=up button=up button=up button=up button=up button=up button=up button=up button=up ValuatorClass Mode=Relative Proximity=In valuator=2427 valuator=902 valuator=119 valuator=833
I think it will look like this. All are up. Next, execute `` `xinput query-state 11``` while holding down the specified left small button
ButtonClass button=up button=up button=up button=up button=up button=up button=up button=down button=up
And since 8 is down, I know that the number of the left small button is 8.
Now that you have identified the button, rewrite /etc/X11/xorg.conf. In my case, xorg.conf was not published, so I created xorg.conf with the touch command. After creating it, just rewrite it as follows with the vi command.
Section "InputClass" Identifier "Marble Mouse" MatchProduct "Logitech USB Trackball" Driver "libinput" Option "ScrollMethod" "button" Option "ScrollButton" "8" Option "MiddleEmulation" "on" EndSection
This 8 is the number of the left small button that I checked in the preliminary survey. Finally, when
reboot is done, the setting is completed.
If you want to make it a small right button, you can specify the button number and set it by the same procedure.