# Mouse won't work in X, but will in terminal.



## curses (May 15, 2010)

I've got a weird problem in X11. I normally start it up through KDM, right? But the mouse doesn't work. If it was just KDM, I'd gripe a bit and move on. But the mouse doesn't seem to work in X Windows either. If I switch over to a virtual terminal, I can move my mouse and see it moving around on the screen. Weird, eh? I didn't touch anything! I just turned on my computer one day and it stopped working! Does anyone have any vague idea how I can fix this?


----------



## cajunman4life (May 15, 2010)

I hit something similar when I rebuilt my workstation. What worked for me was to enable/start hal and dbus. Everything seemed to work then. As a disclaimer, however, I don't use a graphical login manager (like KDM/GDM). I don't know about KDM, but I'm pretty sure GDM starts hal/dbus when it starts. For me, however, I had to specifically include the "enable" directives in /etc/rc.conf.


----------



## wblock@ (May 15, 2010)

curses said:
			
		

> I've got a weird problem in X11. I normally start it up through KDM, right? But the mouse doesn't work. If it was just KDM, I'd gripe a bit and move on. But the mouse doesn't seem to work in X Windows either. If I switch over to a virtual terminal, I can move my mouse and see it moving around on the screen. Weird, eh? I didn't touch anything! I just turned on my computer one day and it stopped working! Does anyone have any vague idea how I can fix this?



You probably have a USB mouse.  moused, the console mouse daemon, is autostarted for USB mice.  That's why you can use it in the console.

With xorg, you can set up mice a couple of ways.  One is the automatic way, which is by running dbus and hal.  When X starts, it asks hal what mice are attached and uses them.  This is usually the easier way.

Or you can tell X not to auto-detect mice with Option "AutoAddDevices" "Off" in your xorg.conf.  (Note: do not use AllowEmptyInput!)  You also have to have an InputDevice section for both the mouse and keyboard if you turn off autodetection.

What happened?  Don't know, but something changed.  If it was set to use hal, see if hal is running.  Maybe a failed or incorrect portupgrade broke things.


----------



## calebstein (May 25, 2010)

Here is what I did to solve this problem.  First, I made the xorg.conf file by typing:


```
Xorg -configure
mv /root/xorg.conf.new /etc/X11/xorg.conf
```

And then typed:

[cmd=]edit /etc/X11/xorg.conf[/cmd]

And added the following lines to the bottom:


```
Section "ServerFlags"
option "AutoAddDevices" "off"
option "AllowEmptyInput" "off"
EndSection
```

Then I typed:

[cmd=]edit /etc/rc.conf[/cmd]

And added:


```
dbus_enable="YES"
```

And removed hald_enable="YES" from the file.


----------



## wblock@ (May 25, 2010)

calebstein said:
			
		

> edit /etc/X11/xorg.conf
> 
> And added the following lines to the bottom:
> 
> ...



That's fine, it's the way you disable hal input detection by xorg.  Of course, you'll have to have InputDevice sections in xorg.conf.


```
option "AllowEmptyInput" "off"
EndSection
```

And that is... often counterproductive.  *Please don't use AllowEmptyInput*.  It can give you the "characters don't show until I move the mouse" symptoms.  Please don't let friends use AllowEmptyInput.  It's bad.


----------



## calebstein (May 25, 2010)

Well *sorry*, but I have my way of doing things, and "AllowEmptyInput" "off" works for me.


----------



## wblock@ (May 25, 2010)

Well, good, but it causes problems for many people.  A lot of people are still using AEI because it was in /usr/ports/UPDATING over a year ago.  But it was used as a temporary bug workaround.  The bug was fixed, but people are still using AEI (aka "Lisa, I'd like to buy your rock").  And that causes threads like http://forums.freebsd.org/showthread.php?t=14155

I've been trying to get the word out for a while, but it's hard to say how effective that effort has been.


----------



## calebstein (May 26, 2010)

Well, answer me this: if the bug was fixed, WHY THE F*** ARE PEOPLE STILL USING A ONE YEAR OLD WORKAROUND???


----------



## wblock@ (May 26, 2010)

calebstein said:
			
		

> Well, answer me this: if the bug was fixed, WHY THE F*** ARE PEOPLE STILL USING A ONE YEAR OLD WORKAROUND???



initially necessary workaround
+ weak notice about not needing it any more after bug fixed
+ understandable reluctance to mess with working xorg.conf
+ few people aware of AllowEmptyInput problems
+ avoidance of hald
+ few people aware that AutoAddDevices is the way to disable hal input device detection
+ long time between xorg version updates
= old cruft left around that turns out to be a problem later


----------

