# I cannot use input devices if there is /etc/X11/xorg.conf?



## sw2wolf (Apr 17, 2012)

If there is /etc/X11/xorg.conf produced by *nvidia-xconfig*, then *I*  cannot use the keyboard and the mouse. It works without xorg.conf but X will not use the nvidia driver installed from /usr/ports/x11/nvidia-driver.

Why is it so?


----------



## wblock@ (Apr 17, 2012)

Show the xorg.conf.


----------



## sw2wolf (Apr 17, 2012)

```
>cat xorg.conf
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 285.05.09  (root@mybsd.zsoft.com)  2012å¹´ 4æœˆ 9æ—¥ æ˜ŸæœŸä¸€ 07æ—¶45åˆ†02ç§’ UTC

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
    FontPath        "/usr/local/lib/X11/fonts/misc/:unscaled"
    FontPath        "/usr/local/lib/X11/fonts/100dpi/:unscaled"
    FontPath        "/usr/local/lib/X11/fonts/75dpi/:unscaled"
    FontPath        "/usr/local/lib/X11/fonts/misc/"
    FontPath        "/usr/local/lib/X11/fonts/Type1/"
    FontPath        "/usr/local/lib/X11/fonts/100dpi/"
    FontPath        "/usr/local/lib/X11/fonts/75dpi/"
    FontPath        "/usr/local/lib/X11/fonts/cyrillic/"
    FontPath        "/usr/local/lib/X11/fonts/TTF/"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/sysmouse"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "keyboard"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection
```

Sincerely!


----------



## wblock@ (Apr 17, 2012)

Remove the InputDevice entries from ServerLayout, and remove the two InputDevice sections.  This will let X autodetect them.

Adding

```
Option "AutoAddDevices" "Off"
```
to the ServerLayout section will prevent HAL from being used for autodetection or hotplugging.


----------



## sw2wolf (Apr 17, 2012)

wblock@ said:
			
		

> Remove the InputDevice entries from ServerLayout, and remove the two InputDevice sections.  This will let X autodetect them.
> 
> Adding
> 
> ...


It works! *T*hank you.   BTW, *I* finally decided to remove hal and dbus.


----------



## wblock@ (Apr 17, 2012)

Great!  Please mark the thread "solved".

Depending on the desktop environment, dbus can be useful and hal might be required.  But HAL doesn't have to be used by the xorg server.


----------



## MadHatter (May 20, 2012)

I had the some issue, but now I can't configure my keyboard layout. I tried to edit my /etc/X11/xorg.conf.d/01-keyboard-layout.conf file

```
Section "InputClass"
	Identifier "keyboard-layout"
	Driver "evdev"
	MatchIsKeyboard "yes"
	Option "XkbLayout" "it"
EndSection
```
but it doesn't work.
Can anybody help me?


----------



## wblock@ (May 20, 2012)

That's a newer-style config, which I haven't tried.  evdev is a Linux-only driver, too.

I think you can put the layout option in a standard keyboard InputDevice entry:

```
Section "InputDevice"
       Identifier "Keyboard0"
       Driver     "kbd"
       Option     "XkbLayout" "it"
EndSection
```

Untested.  Also, see the Handbook X11 Config section.


----------

