It seems DevTerm folks already have this kind of solutions back then.
However, DevTerm had a proper middle mouse button, the uConsole doesn’t. So after a little digging into libinput, here is the solution for uConsole, temporarily.
Step-by-Step guide
Install the package xinput
sudo apt install xinput
Edit the file .xsessionrc in your home directory (it should already have this file there, if not, create one), and add folling contents listed below.
~/.xsessionrc
# Enable scrolling emulation by using middle mouse button and moving the wheel.
xinput --set-prop 'ClockworkPI uConsole Mouse' 'libinput Scroll Method Enabled' 0 0 1
# Enable middle mouse button emulation by hold the left and right mouse button at the same time.
xinput --set-prop 'ClockworkPI uConsole Mouse' 'libinput Middle Emulation Enabled' 1
# Optional: Enable natural scrolling for touchscreen-like operating on mouse whell.
xinput --set-prop 'ClockworkPI uConsole Mouse' 'libinput Natural Scrolling Enabled' 1
Log out, and log back in to apply changes.
Then, you can hold the left and right mouse button at the same time, and scrolling with the trackball.
You can also use the scroll wheel by pressing down the trackball and rub against the trackball at the same time to get the scrolling work, but I wouldn’t recommend this because this may bad for the durability of the trackball itself.
The downside for this is the middle mouse button no longer trigger the middle mouse button function any more. If you need the clickable trackball as middle mouse button itself to work then this solution may not suitable for you. This should not affect external connected input device though, so your USB or bluetooth mouse’s middle button should function as normal.
P.S.: I hope someone can modify the keyboard firmware itself to add those functions directly in the hardware itself, just like what DevTerm folks did back then.
While I only used a small subset of its capabilities, it might be a better solution since you can config modifiers and different behavior based on hold time, etc for different results, and it is DE agnostic, fast, and it is a service. It even has different behavior per program (experimental)
If anybody is interested, I have the trackball code updated as in the previous post and a compiled binary that can be flashed using the flash program ( uconsole_keyboard_flash.tar.gz).
Someone once asked but the question is deleted so I didn’t post a link. The trackball.ino is part of the firmware for uConsole keyboard. It can be found at uConsole Github repo. You have to recompile and flash the firmware to apply those changes.
This is exactly what I was missing and looking for. Fn + trackball for scrolling is brilliant idea and works flawlessly. Simply flashed my keyboard and now I am fine using it.
With the one-line patch contributed above, the trackball works perfectly when the fn button is hold. However, I found once I release the fn button, the cursor position will be changed, which is a little bit annoying.