2

EDIT: TL;DR version (kinda): On a mouse with three buttons, is it possible to disable the actual middle button while still having middle button emulation in xorg?

Full version:

I bought a Lenovo keyboard with trackpoint and am trying to get it to work nicely in Linux/xorg. The problem is I noticed when doing the middle-click-scroll (you press and hold the middle button and then use the trackpoint to scroll) it first sends a middle button down event which of course pastes text or opens links or something, depending on where you are. The scrolling works just fine but is useless like this.

So, I tried disabling middle click with xinput set-button-map <id> 1 0 3. Now scrolling works and there is no pre-scroll button-down event, but also I can't use middle click when I want to.

So, I thought I just enable middle button emulation. Apparently disabling middle click also disables the emulation of it because the emulation works if I re-enable middle click but not otherwise.

So, I thought I can live without middle-click paste and Firefox can open links in new tab with ctrl+click. However, this only works for regular links. If you have a weird link then it seems the only way to open the link in a new tab is middle click (which works even if ctrl+click doesn't... wtf?). Plus, a one-handed ctrl+click requires more work than left+right-click.

What to do? I think I would ideally like to disable the middle-click events coming from the real middle button while still having middle-click-scrolling and middle-click emulation. Or perhaps somehow program the middle button so that it does nothing on button down. Then if the button is kept down and trackpoint is moved, scrolling happens. If nothing happens between button down and button up, then a middle click event is sent on button up. Actually this second solution is probably the ideal.

Other suggestions are welcome, too. Note: I can't switch to the Chrome browser (if that would work, I don't know) because it doesn't like my weird keyboard mappings. Also I would prefer a more "global" fix.

2
  • Thanks for asking this. I have two different external trackpoint keyboards made by Lenovo, and one model has this problem. The other one (and my laptop keyboard) behave nicely. As far as I can tell, the default xinput settings are all the same. Could this be a driver or hardware issue? Commented Oct 27, 2019 at 2:27
  • Found someone else with this problem: unix.stackexchange.com/questions/192124/… Commented Oct 27, 2019 at 2:48

1 Answer 1

3

Okay, so apparently this is kind of implemented already. One just has to say xinput set-prop <device-id> "Evdev Wheel Emulation" 1 (I wonder why it almost worked without). Then one can control the timeout so that a click shorter than that is just a regular middle click.

But it's not perfect: if you start scrolling before timeout then it sends a click event anyway. I see two solutions not involving driver hacking: 1) set timeout to 0 and use middle click emulation (which now works), or 2) learn to wait a while before scrolling. Neither is ideal but fine for now.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .