特殊:Badtitle/NS100:BadDeviceError

来自Ubuntu中文
Wikibot留言 | 贡献2007年11月22日 (四) 12:04的版本 (新页面: {{From|https://help.ubuntu.com/community/BadDeviceError}} {{Languages|UbuntuHelp:BadDeviceError}} === Removing the 'BadDevice' Errors === This page describes how to get rid of the BadDev...)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳到导航跳到搜索
可打印版本不再受到支持且可能有渲染错误。请更新您的浏览器书签并改用浏览器默认打印功能。

{{#ifexist: :BadDeviceError/zh | | {{#ifexist: BadDeviceError/zh | | {{#ifeq: {{#titleparts:BadDeviceError|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:BadDeviceError|1|-1|}} | zh | | }}

Removing the 'BadDevice' Errors

This page describes how to get rid of the BadDevice errors when starting a GUI application from a Terminal:

X Error: BadDevice, invalid or uninitialized input device 170
Major opcode:  146
Minor opcode:  3
Resource id:  0x0
Failed to open device
X Error: BadDevice, invalid or uninitialized input device 170
Major opcode:  146
Minor opcode:  3
Resource id:  0x0
Failed to open device

The Fix

To stop these errors from appearing you need to modify your /etc/X11/xorg.conf file and remove the relevant parts. First we'll make a backup, just in case.

Open the file by pressing Alt+F2 and putting in:

gksu gedit /etc/X11/xorg.conf

For Ubuntu, or

kdesu kate /etc/X11/xorg.conf

For Kubuntu

Then choose File -> Save As and save it as xorg.conf.backup

Now to change the file, Find this part:

Section "InputDevice"
	Driver		"wacom"
	Identifier	"stylus"
	Option		"Device"	"/dev/input/wacom"
	Option		"Type"		"stylus"
	Option		"ForceDevice"	"ISDV4"		# Tablet PC ONLY
EndSection

Section "InputDevice"
	Driver		"wacom"
	Identifier	"eraser"
	Option		"Device"	"/dev/input/wacom"
	Option		"Type"		"eraser"
	Option		"ForceDevice"	"ISDV4"		# Tablet PC ONLY
EndSection

Section "InputDevice"
	Driver		"wacom"
	Identifier	"cursor"
	Option		"Device"	"/dev/input/wacom"
	Option		"Type"		"cursor"
	Option		"ForceDevice"	"ISDV4"		# Tablet PC ONLY
EndSection

and either delete or comment out the lines. (To comment out the lines you put a '#' character at the beginning of each line) Then find the lines:

	InputDevice     "stylus"	"SendCoreEvents"
	InputDevice     "cursor"	"SendCoreEvents"
	InputDevice     "eraser"	"SendCoreEvents"

In the Section "ServerLayout" section and delete/comment out those too.

Once you've done that, choose File -> Save As and save it as xorg.conf to replace the origional.

You will then have to restart the X server for the settings to take effect. First save anything you are working on and logout, then from the login screen menu choose "Restart the X server", then you can log back in.

If Something Went Wrong

If, after you chose to restart the X server, you don't get the login screen back, then the you may have not competed the steps properly or just made a mistake somewhere, but that's why we created a backup.

Login to the console and from there run this command:

sudo cp /etc/X11/xorg.conf.backup /etc/X11/xorg.conf

That will restore your X configuration back to how it was before, then restart the login manager:

In Ubuntu

sudo /etc/init.d/gdm restart

In Kubuntu

sudo /etc/init.d/kdm restart

Then you can log back in and try again.