个人工具

“UbuntuHelp:SerialMouseHowto”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
 
(未显示同一用户的5个中间版本)
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/SerialMouseHowto}}
 
{{From|https://help.ubuntu.com/community/SerialMouseHowto}}
 
{{Languages|UbuntuHelp:SerialMouseHowto}}
 
{{Languages|UbuntuHelp:SerialMouseHowto}}
 +
<<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...
 
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).
 +
Most serial mice cannot report their presence and HAL will never discover them. The simplest way to enable them is to re-allow 'Mouse' entries in the /etc/X11/xorg.conf file. This is disabled by default and can be re-enabled by adding the line:-
 +
Option "AllowEmptyInput" "false"
 +
to the ServerLayout section.
 +
'' ----
 
== Manual editing of the xorg.conf file ==
 
== Manual editing of the xorg.conf file ==
 
This is arguably the simplest method to set up a serial mouse.
 
This is arguably the simplest method to set up a serial mouse.
# Boot up normally and wait for Ubuntu to finish loading.
+
<ol><li>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).
+
</li><li>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: <pre><nowiki>
+
</li><li>Type the following exactly: <pre><nowiki>
 
sudo nano -B /etc/X11/xorg.conf
 
sudo nano -B /etc/X11/xorg.conf
 
</nowiki></pre>
 
</nowiki></pre>
# If you have one, you will be asked for your user password.
+
</li><li>If you have one, you will be asked for your user password.
# The editor will open, displaying the xorg.conf file.
+
</li><li>The editor will open, displaying the xorg.conf file.
# Navigate (using the arrow and/or Page Up/Down keys) to the following section: <pre><nowiki>
+
</li><li>Navigate (using the arrow and/or Page Up/Down keys) to the following section: (all lines may not be present) <pre><nowiki>
 
Section "InputDevice"
 
Section "InputDevice"
 
Identifier "Configured Mouse"
 
Identifier "Configured Mouse"
第22行: 第28行:
 
EndSection
 
EndSection
 
</nowiki></pre>
 
</nowiki></pre>
# Change the "Option Device" and "Option Protocol" lines as follows: <pre><nowiki>
+
</li><li>Change the "Option Device" and "Option Protocol" lines as follows: <pre><nowiki>
 
Section "InputDevice"
 
Section "InputDevice"
 
Identifier "Configured Mouse"
 
Identifier "Configured Mouse"
第31行: 第37行:
 
Option "ZAxisMapping" "4 5"
 
Option "ZAxisMapping" "4 5"
 
EndSection
 
EndSection
</nowiki></pre> change ttyS0 to ttyS1 if your mouse is connected to COM2 instead of COM1.
+
</nowiki></pre> 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.
+
</li><li>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).
+
</li><li>Press '''Ctrl+Alt+F7''' (to return to the graphical interface).
# Press '''Ctrl+Alt+Backspace''' ('''NOT''' Delete!) to restart the graphical interface.
+
</li><li>Restart X by logging out and back in, or typing <code><nowiki>sudo /etc/init.d/gdm restart</nowiki></code>.
# 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.
+
</li><li>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.</li></ol>
 +
 
 
<pre><nowiki>
 
<pre><nowiki>
 
cd /etc/X11
 
cd /etc/X11
第45行: 第52行:
 
How to set up a serial mouse using only the keyboard and without working in a text-only console.
 
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.
 
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.
+
<ol><li>Login normally and wait for Ubuntu to finish loading.
# Press '''"Alt+F1"''', to open the '''"Applications"''' menu.
+
</li><li>Press '''"Alt+F1"''', to open the '''"Applications"''' menu.
# Press '''down arrow''' to move to the '''"Accessories"''' item.
+
</li><li>Press '''down arrow''' to move to the '''"Accessories"''' item.
# Press '''right arrow''' to get into the next '''"menu"'''.
+
</li><li>Press '''right arrow''' to get into the next '''"menu"'''.
# Press '''down arrow''' to move to the '''"Terminal"''' item.
+
</li><li>Press '''down arrow''' to move to the '''"Terminal"''' item.
# Press '''Enter/Return''' to start a '''small terminal window'''.
+
</li><li>Press '''Enter/Return''' to start a '''small terminal window'''.
# Type in '''"gksudo gedit /etc/X11/xorg.conf"''' and press '''Enter/Return'''.
+
</li><li>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).
+
</li><li>When asked, enter your '''password''' and press '''Enter/Return''' (gedit will open, displaying the xorg.conf file).
## Using the keyboard, navigate to '''"Configured Mouse"'''.
+
<ol><li>Using the keyboard, navigate to '''"Configured Mouse"'''.
### Change '''"/dev/input/mice"''' to '''"/dev/ttyS0"''' (or '''"/dev/ttyS1"''' if using COM2 instead of COM1)
+
</li><li>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"'''
+
</li><li>Change '''"ExplorerPS/2"''' to '''"Auto"''' (add this line if it doesn't exist)
# Press '''"Ctrl+s"''' to save the changes.
+
</li></ol></li><li>Press '''"Ctrl+s"''' to save the changes.
# Press '''"Ctrl+q"''' to close the editor.
+
</li><li>Press '''"Ctrl+q"''' to close the editor.</li></ol>
# Press '''"Ctrl+Alt+Backspace"''' to restart the X server.
+
 
 +
---- /!\ '''Edit conflict - other version:''' ----
 +
<ol><li>Restart the X server by logging out and back in, or typing <code><nowiki>sudo /etc/init.d/gdm restart</nowiki></code>.</li></ol>
 +
 
 +
---- /!\ '''Edit conflict - your version:''' ----
 +
<ol><li>Restart the X server by logging out and back in, or typing <code><nowiki>sudo /etc/init.d/gdm restart</nowiki></code>.</li></ol>
 +
 
 +
---- /!\ '''End of edit conflict''' ----
 
Your mouse should work at this point, if it doesn't, restart the system.
 
Your mouse should work at this point, if it doesn't, restart the system.
 
== Using Inputattach ==
 
== 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).
+
<ol><li>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.
+
</li><li>Login using your username and password.
# Run 'inputattach --help' and find the appropriate protocol option to match your mouse
+
</li><li>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
+
</li><li>Add 'inputattach <protocol option> /dev/ttyS0' (or whatever device your serial mouse is attached to) to /etc/rc.local
# Restart
+
</li><li>Restart
# Hopefully your mouse is now working, if not, remove the line you added to rc.local and try another method.
+
</li><li>Hopefully your mouse is now working, if not, remove the line you added to rc.local and try another method.</li></ol>
 +
 
 
== Configure Xserver (alternate 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.
 
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.
第81行: 第96行:
 
* After you finish configuring the xserver, you will get back to a prompt in white text on a black background.
 
* 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).
 
* Switch back to the xserver by pressing Control-Alt-F7 (virtual terminal 7).
* Kill the xserver by pressing Control-Alt-Backspace (This is NOT Control-Alt-Delete, which will make the machine shutdown).
+
* Restart X by logging out and back in, or typing <code><nowiki>sudo /etc/init.d/gdm restart</nowiki></code>.
 
* 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.
 
* 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. ==
 
== 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.
 
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
+
<ol><li>Exit the xserver
# Create an .xinitrc file in your home directory, with the following line. <pre><nowiki>
+
</li><li>Create an .xinitrc file in your home directory, with the following line. <pre><nowiki>
 
xterm -geometry +300+300
 
xterm -geometry +300+300
 
</nowiki></pre>
 
</nowiki></pre>
# Save the file and run startx
+
</li><li>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: <pre><nowiki>
+
</li><li>Now you will have an X session. with a focused XTERM in the middle of your screen. Just type: <pre><nowiki>
 
sudo ubiquity
 
sudo ubiquity
</nowiki></pre> And follow the installation procedure using only your keyboard.
+
</nowiki></pre> And follow the installation procedure using only your keyboard.</li></ol>
 +
 
 
----
 
----
[[category:CategoryCleanup]]
+
[[category:CategoryX]]
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2010年5月20日 (四) 00:09的最新版本

<<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).

Most serial mice cannot report their presence and HAL will never discover them. The simplest way to enable them is to re-allow 'Mouse' entries in the /etc/X11/xorg.conf file. This is disabled by default and can be re-enabled by adding the line:- Option "AllowEmptyInput" "false" to the ServerLayout section. ----

Manual editing of the xorg.conf file

This is arguably the simplest method to set up a serial mouse.

  1. Boot up normally and wait for Ubuntu to finish loading.
  2. 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).
  3. Type the following exactly:
    sudo nano -B /etc/X11/xorg.conf
    
  4. If you have one, you will be asked for your user password.
  5. The editor will open, displaying the xorg.conf file.
  6. 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
    
  7. 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.
  8. Type Ctrl+X then Y and Enter to save the changes to the file and exit.
  9. Press Ctrl+Alt+F7 (to return to the graphical interface).
  10. Restart X by logging out and back in, or typing sudo /etc/init.d/gdm restart.
  11. 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.

  1. Login normally and wait for Ubuntu to finish loading.
  2. Press "Alt+F1", to open the "Applications" menu.
  3. Press down arrow to move to the "Accessories" item.
  4. Press right arrow to get into the next "menu".
  5. Press down arrow to move to the "Terminal" item.
  6. Press Enter/Return to start a small terminal window.
  7. Type in "gksudo gedit /etc/X11/xorg.conf" and press Enter/Return.
  8. When asked, enter your password and press Enter/Return (gedit will open, displaying the xorg.conf file).
    1. Using the keyboard, navigate to "Configured Mouse".
    2. Change "/dev/input/mice" to "/dev/ttyS0" (or "/dev/ttyS1" if using COM2 instead of COM1) (add this line if it doesn't exist)
    3. Change "ExplorerPS/2" to "Auto" (add this line if it doesn't exist)
  9. Press "Ctrl+s" to save the changes.
  10. Press "Ctrl+q" to close the editor.

/!\ Edit conflict - other version: ----
  1. Restart the X server by logging out and back in, or typing sudo /etc/init.d/gdm restart.

/!\ Edit conflict - your version: ----
  1. 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

  1. 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).
  2. Login using your username and password.
  3. Run 'inputattach --help' and find the appropriate protocol option to match your mouse
  4. Add 'inputattach <protocol option> /dev/ttyS0' (or whatever device your serial mouse is attached to) to /etc/rc.local
  5. Restart
  6. 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.

  1. Exit the xserver
  2. Create an .xinitrc file in your home directory, with the following line.
    xterm -geometry +300+300
    
  3. Save the file and run startx
  4. 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.