Posted on Mon 11 March 2024

new mouse report

My RSI prevention strategy involves change: I use three different keyboards, four or five pointing devices, and move around to different places. On my main desktop, I mostly use a thumb trackball, with a mouse in second place and a drawing pad in distant third.

On Friday the trackball died in a peculiar way.

It decided that Y-axis measurements should be much more precise than the normal X-axis reporting, and so I needed to roll the ball about eight times further in one dimension than the other. Not good. I changed the battery, which did nothing, and unplugged and replugged the dongle. Nothing changed. I flipped the mouse off and on again, and that killed it – the system reported that the mouse connected and had a charge, but did not accept clicks or geometry from it.

Well, I have a spare, retired because the main button refused to acknowledge being held down. That’s a problem for dragging over text for copying it. Time to buy a replacement.

The new trackball, an Elecom EX-G Pro, appeared about 20 hours later. Unlike the former occupant, a Logitech M570, the Elecom can be used with a USB connection, a proprietary dongle, or a generic Bluetooth connection. X11 recognizes it as having 12 buttons:

left, wheel-click, right, wheel-roll-down, wheel-roll-up, wheel-tilt-left, wheel-tilt-right, leftside “back”, leftside “forward”, far-left-by-thumb, far- right-finger, and a central button just south of the wheel

which is actually one button too many: the far-left-by-thumb button is nearly impossible to tap without changing my grip on the mouse.

There are also bottom buttons for BT pairing, resolution switching, and a slider for off/slow-report/fast-report – for battery saving, I guess. And an additional slider for switching from BT to proprietary wireless dongle.

The ball is exactly the same size as the Logitech M570 series. It feels smooth. The wheel, however, is high-friction and clicky. Some of the corners of the mouse actually feel sharp.

Some config to help things out:

In .xsessionrc:

xinput set-prop "ELECOM TrackBall Mouse EX-G Pro TrackBall Mouse" 305 12
xinput set-prop "ELECOM TrackBall Mouse EX-G Pro TrackBall Mouse" 290 0, 0, 1
xinput set-prop "ELECOM TrackBall Mouse EX-G Pro TrackBall Mouse" 292 11

The first line sets the top-of-mouse button as the universal drag lock button. Tap it, tap another button (usually 1, the main button), and it is considered to be held down until you tap the other button again. Excellent for precise copying to the primary buffer.

The second and third lines enable scroll-by-ball: hold down the far-right button and roll the ball to scroll. Much smoother than the wheel.

In .xbindkeysrc:

"xvkbd  -text "\[XF86Copy]""
       m:0x0 + b:8
"xvkbd  -text "\[XF86Paste]""
       m:0x0 + b:9

Sets the nominal forward-and-back buttons to copy and paste, very useful if your terminals support bracketed paste mode (they almost all do). Requires xbindkey to be running.

All together, this creates a workflow on the mouse: position the cursor at one end of a selection-to-be. Top button, button 1. Roll the cursor to the other anchor point, taking as long as desired, repositioning until you get it right without having to hold down a button. Button 1 again. ‘Back’ to copy, go find your desired window, ‘Forward’ to paste. Not quite as fast as holding down a button while dragging to select, but much easier on my finger joints.


© -dsr-. Send feedback or comments via email — by continuing to use this site you agree to certain terms and conditions.

Built using Pelican. Derived from the svbhack theme by Giulio Fidente on github.