Mouse behavior: middle button behavior


#1

Hi all –

I’d like to enable my middle mouse button’s copy/paste feature and others, too:

  1. copy/paste (e.g. select text and click w/middle mouse button to paste)
  2. I’m accustomed to middle click to open links, etc

Unfortunately, I cannot recall the last time I had to enable any of these in vanilla FreeBSD, so I’m a bit perplexed. I’m using a Thinkpad (T470s), if that helps at all. rc-status shows that moused and moused.psm0 are both started.

Any thoughts or suggestions would be most welcome.
Best

Edit: I just plugged a USB mouse into the laptop and it behaves as I would expect:

  • middle mouse click on a browser link opens in a new tab
  • hilite text in a terminal, middle click in another terminal (w/active cursor) and copy/paste works
  • middle click on an OpenBox desktop shows all of the windows on all virtual desktops

What’s the difference? I’m not sure :slight_smile:


Discourse Question: editing post titles?
#2

Use xinput. Check properties.


#3

Hey @bsdtester - thanks, I’ll check that out. Appreciate the response!


#4

Again, I appreciate the response… unfortunately, xinput is basically telling me that there aren’t really any differences between the two systems I have access to right now.

# workstation
> xinput --list-props sysmouse
Device 'sysmouse':
	Device Enabled (152):	1
	Coordinate Transformation Matrix (153):	1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
	Device Accel Profile (265):	0
	Device Accel Constant Deceleration (266):	1.000000
	Device Accel Adaptive Deceleration (267):	1.000000
	Device Accel Velocity Scaling (268):	10.000000
	Device Node (269):	"/dev/sysmouse"
	Button Labels (270):	"Button Left" (155), "Button Middle" (156), "Button Right" (157), "Button Wheel Up" (158), "Button Wheel Down" (159)
	Mouse Middle Button Emulation (271):	1
	Mouse Middle Button Timeout (272):	50

and

# laptop
% xinput --list-props sysmouse
Device 'sysmouse':
        Device Enabled (137):   1
        Coordinate Transformation Matrix (138): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
        Device Accel Profile (251):     0
        Device Accel Constant Deceleration (252):       1.000000
        Device Accel Adaptive Deceleration (253):       1.000000
        Device Accel Velocity Scaling (254):    10.000000
        Device Node (255):      "/dev/sysmouse"
        Button Labels (256):    "Button Left" (140), "Button Middle" (141), "Button Right" (142), "Button Wheel Up" (143), "Button Wheel Down" (144)
        Mouse Middle Button Emulation (257):    1
        Mouse Middle Button Timeout (258):      50

#5

Use xev. Test, wether middle button is recognized, and as what button it is recognized: Number and name.


#6

With TrueOS the middle mouse button (or middle physical mouse button) isn’t recognized at all by xev - there’s no output to the terminal.

I have a Parted Magick USB and booted that and the middle mouse button is picked up by xev. I can post screenshots of the xev output, but maybe it’s sufficient to report that:

button 1 = left button 
button 2 = middle button
button 3 = right button

Looking through the Parted Magick /etc/X11/ is, uh, … different :slight_smile: and I’m not seeing anything overly obvious about the mouse configuration.

I’ll try adding the middle button w/xkb, or whatever the default utility is for TrueOS (if there is one) and report back.


#7

By default, TrueOS should set X to use the sysmouse driver, so you may need to tweak sysmouse config.

man sysmouse


#8

Thanks @mer - I’ll take a look there.


#9

@mer - hey thanks. Your suggestion got me on the right track.

In /etc/conf.d/moused there was an -3 flag being passed to moused. -3 seems to forcibly emulate a 3 button mouse on a 2 button mouse; i.e. assuming you have a two button mouse and you want copy/paste, the -3 flag lets you hilight text and then click left/right simultaneously to get middle button behavior.

Removing that flag seems to have done the trick. Thanks again to you and @bsdtester.


#10

The Honour belongs to ‘mer’. I give my part of Your thanks to him.


#11

No problem. Gald we got it figured out.