# middle click doesn't paste in terminal



## kenorb (Oct 29, 2010)

I can't figure out why my middle/right click doesn't paste in Xorg.
My rc.conf settings:

```
# MOUSE
moused_flags="-3"
moused_port="/dev/psm0"
moused_type="auto"
moused_enable="YES"
moused_nondefault_enable="NO"
hald_enable="YES"
dbus_enable="YES"
devd_enable="YES"
```


```
> ps wuax | grep mouse
root         797  0.0  0.0  8020   772  ??  Ss   Thu09AM   0:30.84 /usr/sbin/moused -3 -p /dev/ums0 -t auto -I /var/run/moused.ums0.pid
root        2325  0.0  0.0 16548     0  ??  IW   -         0:00.00 hald-addon-mouse-sysmouse: /dev/ums0 (hald-addon-mouse-sy)
```

I've read as well following similar topics:
http://forums.freebsd.org/showthread.php?t=12800
http://forums.freebsd.org/showthread.php?t=5006

Couldn't find any special options in System->Preferences->Mouse or in terminal settings.
Basically I'm interested to make it working in Terminal.
Any suggestions?


----------



## SirDice (Oct 29, 2010)

Does the middle button work on the console?

Have a look at your /var/log/Xorg.0.log. Specifially look for *Emulate3Buttons*. When this option is turned on, pressing both the left and right button will act as the third button. This option is for mice that only have 2 buttons. If it's turned on turn it off.


----------



## kenorb (Oct 29, 2010)

Yes, both mouse buttons does work to paste, how can I activate the middle button then?


----------



## expl (Oct 29, 2010)

Open /etc/X11/xorg.conf find your mouse section and set 'Emulate3Buttons' option to 'false'.


----------



## kenorb (Nov 2, 2010)

Changed yesterday to this:


```
Section "InputDevice"
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/sysmouse"
    Option         "ZAxisMapping" "4 5 6 7"
    Option         "Emulate3Buttons" "FALSE"
EndSection
```
Today after reboot, still the same. Right click open context menu.

In Xorg logs I've got:

```
II) config/hal: Adding input device USB Optical Mouse
(II) LoadModule: "mouse"
(II) Loading /usr/local/lib/xorg/modules/input/mouse_drv.so
(II) Module mouse: vendor="X.Org Foundation"
        compiled for 1.7.5, module version = 1.5.0
        Module class: X.Org XInput Driver
        ABI class: X.Org XInput driver, version 7.0
(**) USB Optical Mouse: Device: "/dev/ums0"
(==) USB Optical Mouse: Protocol: "Auto"
(**) USB Optical Mouse: always reports core events
(**) Option "Device" "/dev/ums0"
(==) USB Optical Mouse: Emulate3Buttons, Emulate3Timeout: 50
(**) USB Optical Mouse: ZAxisMapping: buttons 4 and 5
(**) USB Optical Mouse: Buttons: 9
(**) USB Optical Mouse: Sensitivity: 1
(II) XINPUT: Adding extended input device "USB Optical Mouse" (type: MOUSE)
(**) USB Optical Mouse: (accel) keeping acceleration scheme 1
(**) USB Optical Mouse: (accel) acceleration profile 0
(II) USB Optical Mouse: SetupAuto: hw.iftype is 5, hw.model is 0
(II) USB Optical Mouse: SetupAuto: protocol is SysMouse
(WW) fcntl(24, F_SETOWN): Inappropriate ioctl for device
(II) config/hal: Adding input device AT Keyboard
```


----------



## SirDice (Nov 2, 2010)

Use lowercase for false.


----------



## wblock@ (Nov 2, 2010)

kenorb said:
			
		

> I can't figure out why my middle/right click doesn't paste in Xorg.
> My rc.conf settings:
> 
> ```
> ...



Your later post shows you have a USB mouse.  Messing with all the defaults as above is a mistake, just remove them:


```
# MOUSE
moused_enable="YES"
hald_enable="YES"
dbus_enable="YES"
```

You're also using hal to autoconfig the mouse in X.  So remove the entire mouse InputDevice section and references to it from your xorg.conf.


----------



## wblock@ (Nov 2, 2010)

SirDice said:
			
		

> Use lowercase for false.



It's not case-sensitive: `% man xorg.conf | less +/Config`


----------



## SirDice (Nov 2, 2010)

wblock said:
			
		

> It's not case-sensitive: `% man xorg.conf | less +/Config`


It shouldn't be, yes. But I ran into this a few times in the past.


----------



## SirDice (Nov 2, 2010)

Just a recap.. 

Remove all the moused entries in /etc/rc.conf if you have an USB mouse.
Remove the *devd_enable="YES"*. It's useless.
Leave hald and dbus.

In your xorg.conf, remove all the InputDevice sections and all references to them. Since you're using HAL they are not needed anymore and will be ignored.


----------



## wblock@ (Nov 2, 2010)

With a USB mouse, if you leave moused_enable="YES" it makes switching from X to console and back faster by several seconds.  Doesn't cost anything, either, since moused is run for USB mice by default anyway.  It just runs a little better this way.


----------

