特殊:Badtitle/NS100:SerialMouseHowto
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/SerialMouseHowto }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/af | • {{#if: UbuntuHelp:SerialMouseHowto|Afrikaans| [[::SerialMouseHowto/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/ar | • {{#if: UbuntuHelp:SerialMouseHowto|العربية| [[::SerialMouseHowto/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/az | • {{#if: UbuntuHelp:SerialMouseHowto|azərbaycanca| [[::SerialMouseHowto/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/bcc | • {{#if: UbuntuHelp:SerialMouseHowto|جهلسری بلوچی| [[::SerialMouseHowto/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/bg | • {{#if: UbuntuHelp:SerialMouseHowto|български| [[::SerialMouseHowto/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/br | • {{#if: UbuntuHelp:SerialMouseHowto|brezhoneg| [[::SerialMouseHowto/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/ca | • {{#if: UbuntuHelp:SerialMouseHowto|català| [[::SerialMouseHowto/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/cs | • {{#if: UbuntuHelp:SerialMouseHowto|čeština| [[::SerialMouseHowto/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/de | • {{#if: UbuntuHelp:SerialMouseHowto|Deutsch| [[::SerialMouseHowto/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/el | • {{#if: UbuntuHelp:SerialMouseHowto|Ελληνικά| [[::SerialMouseHowto/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/es | • {{#if: UbuntuHelp:SerialMouseHowto|español| [[::SerialMouseHowto/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/fa | • {{#if: UbuntuHelp:SerialMouseHowto|فارسی| [[::SerialMouseHowto/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/fi | • {{#if: UbuntuHelp:SerialMouseHowto|suomi| [[::SerialMouseHowto/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/fr | • {{#if: UbuntuHelp:SerialMouseHowto|français| [[::SerialMouseHowto/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/gu | • {{#if: UbuntuHelp:SerialMouseHowto|ગુજરાતી| [[::SerialMouseHowto/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/he | • {{#if: UbuntuHelp:SerialMouseHowto|עברית| [[::SerialMouseHowto/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/hu | • {{#if: UbuntuHelp:SerialMouseHowto|magyar| [[::SerialMouseHowto/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/id | • {{#if: UbuntuHelp:SerialMouseHowto|Bahasa Indonesia| [[::SerialMouseHowto/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/it | • {{#if: UbuntuHelp:SerialMouseHowto|italiano| [[::SerialMouseHowto/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/ja | • {{#if: UbuntuHelp:SerialMouseHowto|日本語| [[::SerialMouseHowto/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/ko | • {{#if: UbuntuHelp:SerialMouseHowto|한국어| [[::SerialMouseHowto/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/ksh | • {{#if: UbuntuHelp:SerialMouseHowto|Ripoarisch| [[::SerialMouseHowto/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/mr | • {{#if: UbuntuHelp:SerialMouseHowto|मराठी| [[::SerialMouseHowto/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/ms | • {{#if: UbuntuHelp:SerialMouseHowto|Bahasa Melayu| [[::SerialMouseHowto/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/nl | • {{#if: UbuntuHelp:SerialMouseHowto|Nederlands| [[::SerialMouseHowto/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/no | • {{#if: UbuntuHelp:SerialMouseHowto|norsk| [[::SerialMouseHowto/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/oc | • {{#if: UbuntuHelp:SerialMouseHowto|occitan| [[::SerialMouseHowto/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/pl | • {{#if: UbuntuHelp:SerialMouseHowto|polski| [[::SerialMouseHowto/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/pt | • {{#if: UbuntuHelp:SerialMouseHowto|português| [[::SerialMouseHowto/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/ro | • {{#if: UbuntuHelp:SerialMouseHowto|română| [[::SerialMouseHowto/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/ru | • {{#if: UbuntuHelp:SerialMouseHowto|русский| [[::SerialMouseHowto/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/si | • {{#if: UbuntuHelp:SerialMouseHowto|සිංහල| [[::SerialMouseHowto/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/sq | • {{#if: UbuntuHelp:SerialMouseHowto|shqip| [[::SerialMouseHowto/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/sr | • {{#if: UbuntuHelp:SerialMouseHowto|српски / srpski| [[::SerialMouseHowto/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/sv | • {{#if: UbuntuHelp:SerialMouseHowto|svenska| [[::SerialMouseHowto/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/th | • {{#if: UbuntuHelp:SerialMouseHowto|ไทย| [[::SerialMouseHowto/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/tr | • {{#if: UbuntuHelp:SerialMouseHowto|Türkçe| [[::SerialMouseHowto/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/vi | • {{#if: UbuntuHelp:SerialMouseHowto|Tiếng Việt| [[::SerialMouseHowto/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/yue | • {{#if: UbuntuHelp:SerialMouseHowto|粵語| [[::SerialMouseHowto/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/zh | • {{#if: UbuntuHelp:SerialMouseHowto|中文| [[::SerialMouseHowto/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/zh-hans | • {{#if: UbuntuHelp:SerialMouseHowto|中文(简体)| [[::SerialMouseHowto/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SerialMouseHowto | UbuntuHelp:SerialMouseHowto | {{#if: | :}}SerialMouseHowto}}/zh-hant | • {{#if: UbuntuHelp:SerialMouseHowto|中文(繁體)| [[::SerialMouseHowto/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:SerialMouseHowto|:SerialMouseHowto|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :SerialMouseHowto/zh | | {{#ifexist: SerialMouseHowto/zh | | {{#ifeq: {{#titleparts:SerialMouseHowto|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:SerialMouseHowto|1|-1|}} | zh | | }}
<<Include(Tag/StyleCleanup)>> If you are installing on a PC with a mouse attached to a serial port (rather than the mouse port), here's what you need to do...
/!\ All the methods described below are now deprecated and will probably not work with HAL detection used since Ubuntu 9.04 Jaunty. This article should be updated using new HAL method. Although it will work with 8.04 (hopefully) ----
Manual editing of the xorg.conf file
This is arguably the simplest method to set up a serial mouse.
- Boot up normally and wait for Ubuntu to finish loading.
- Press Ctrl+Alt+F1 to gain access to a text console (your screen will turn black with a prompt in white text, and if not running from the CD you may be asked to login).
- Type the following exactly:
sudo nano -B /etc/X11/xorg.conf
- If you have one, you will be asked for your user password.
- The editor will open, displaying the xorg.conf file.
- Navigate (using the arrow and/or Page Up/Down keys) to the following section: (all lines may not be present)
Section "InputDevice" Identifier "Configured Mouse" Driver "mouse" Option "CorePointer" Option "Device" "/dev/input/mice" Option "Protocol" "ExplorerPS/2" Option "ZAxisMapping" "4 5" Option "Emulate3Buttons" "true" EndSection
- Change the "Option Device" and "Option Protocol" lines as follows:
Section "InputDevice" Identifier "Configured Mouse" Driver "mouse" Option "CorePointer" Option "Device" "/dev/ttyS0" Option "Protocol" "auto" Option "ZAxisMapping" "4 5" EndSection
change ttyS0 to ttyS1 if your mouse is connected to COM2 instead of COM1. If the Device and Protocol lines aren't there, add them. - Type Ctrl+X then Y and Enter to save the changes to the file and exit.
- Press Ctrl+Alt+F7 (to return to the graphical interface).
- Restart X by logging out and back in, or typing
sudo /etc/init.d/gdm restart
. - Hopefully your mouse now works. If not, type the following to undo your changes, just to be safe, before trying again using ttyS1 instead of ttyS0.
cd /etc/X11 sudo cp xorg.conf~ xorg.conf
(Note the symbol immediately after the first "xorg.conf" is a tilde. The error message cp: cannot stat... indicates a typing error here.) If trying the other port also fails try another method below.
Manual editing of the xorg.conf file (without leaving graphical mode)
How to set up a serial mouse using only the keyboard and without working in a text-only console. It is highly recommended that you make a backup copy of the "xorg.conf" file before making edits.
- Login normally and wait for Ubuntu to finish loading.
- Press "Alt+F1", to open the "Applications" menu.
- Press down arrow to move to the "Accessories" item.
- Press right arrow to get into the next "menu".
- Press down arrow to move to the "Terminal" item.
- Press Enter/Return to start a small terminal window.
- Type in "gksudo gedit /etc/X11/xorg.conf" and press Enter/Return.
- When asked, enter your password and press Enter/Return (gedit will open, displaying the xorg.conf file).
- Using the keyboard, navigate to "Configured Mouse".
- Change "/dev/input/mice" to "/dev/ttyS0" (or "/dev/ttyS1" if using COM2 instead of COM1) (add this line if it doesn't exist)
- Change "ExplorerPS/2" to "Auto" (add this line if it doesn't exist)
- Press "Ctrl+s" to save the changes.
- Press "Ctrl+q" to close the editor.
/!\ Edit conflict - other version: ----
- Restart the X server by logging out and back in, or typing
sudo /etc/init.d/gdm restart
.
/!\ Edit conflict - your version: ----
- Restart the X server by logging out and back in, or typing
sudo /etc/init.d/gdm restart
.
/!\ End of edit conflict ----
Your mouse should work at this point, if it doesn't, restart the system.
Using Inputattach
- Press Control-Alt-F1 to get to Virtual Terminal 1 (your screen will turn black and you'll see a login prompt in white text).
- Login using your username and password.
- Run 'inputattach --help' and find the appropriate protocol option to match your mouse
- Add 'inputattach <protocol option> /dev/ttyS0' (or whatever device your serial mouse is attached to) to /etc/rc.local
- Restart
- Hopefully your mouse is now working, if not, remove the line you added to rc.local and try another method.
Configure Xserver (alternate method)
The installation will complete, and you will be able to log in but your mouse will not move or respond to button clicks. You need to reconfigure your xserver to see the mouse.
- Press Control-Alt-F1 to get to Virtual Terminal 1 (your screen will turn black and you'll see a login prompt in white text).
- Login using your username and password.
- Enter the following command at the prompt
sudo dpkg-reconfigure xserver-xorg
- Press Return to accept the existing settings UNTIL you get to the selection for the mouse port.
- Choose whichever port your mouse is connected to:
- first serial port: /dev/ttyS0
- second serial port: /dev/ttyS1
- Press Return to accept each the rest of the settings pages.
- After you finish configuring the xserver, you will get back to a prompt in white text on a black background.
- Switch back to the xserver by pressing Control-Alt-F7 (virtual terminal 7).
- Restart X by logging out and back in, or typing
sudo /etc/init.d/gdm restart
. - When the xserver restarts, your mouse should work normally. If not, you may have chosen the wrong port. If necessary, press Control-Alt-F1 to go back to the virtual terminal and reconfigure the xserver again (following the steps above). If the xserver gives up, you can make it try again by typing startx at a virtual terminal prompt.
Installing Without a Mouse At All.
This method will help you if you MUST install Ubuntu on a pc with a serial mouse. Clearly you cant modify xorg.conf when running from the CD, so you CAN'T have a mouse during the installation process.
- Exit the xserver
- Create an .xinitrc file in your home directory, with the following line.
xterm -geometry +300+300
- Save the file and run startx
- Now you will have an X session. with a focused XTERM in the middle of your screen. Just type:
sudo ubiquity
And follow the installation procedure using only your keyboard.