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.