特殊:Badtitle/NS100:SerialMouseHowto

来自Ubuntu中文
Oneleaf留言 | 贡献2007年5月13日 (日) 12:47的版本
跳到导航跳到搜索

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

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

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. [only for releases prior to 6.06/Dapper] Install the 'joystick' package by running 'apt-get install joystick'

4. Run 'inputattach --help' and find the appropriate protocol option to match your mouse

5. Add 'inputattach <protocol option> /dev/ttyS0' (or whatever device your serial mouse is attached to) to /etc/rc.local

6. Restart

7. 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).
  • Kill the xserver by pressing Control-Alt-Backspace (This is NOT Control-Alt-Delete, which will make the machine shutdown).
  • 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 Xorg 2) Create an .xinitrc file in your home directory, with the following line.

xterm -geometry +300+300

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


CategoryCleanup

Installing Without a Mouse 2

1) Boot from CD

2) Press Alt+F1, and search from "Applications" menu the termianal with the arrow buttons

3) Enter "sudo ubiquity"

4) Than you get the install window. Here you can set the language, the keyboard, your name and the boot-harddisk drive for the installation with the arrow and TAB buttons. (You can't set date and time, but it will be possible later too...)

5) If your installation is ready reboot...

6) Press Ctrl+Alt+F1 to get a terminal interface

7) Log in with your username and password

8) Enter "sudo bash" and retype your password (now you are root...)

9) Enter "cd /etc/X11" (big X !!)

10) Enter "pico xorg.conf" you get a text editor with a file witch contents configurations for the graphical interface. Here you have to search the part of mouse (arrow buttons...)

11) you have to correct two rows:

Protocol "auto"

Option Device "/dev/ttyS0" (it is your first serial port)

12) save, exit

13) Press Ctrl+Alt+F7 (now you will turn back to graphical interface)

14) Press Ctrl+Alt+Backspace (and NOT del) to restart the graphical interface

15) hopefully your mouse works. if not, you have to switch to terminal mode and correct xorg.conf so:

"/dev/ttyS0" will change to "/dev/ttyS1" (it is your second serial port...)


Manual editing of the xorg.conf file

This may be the most direct method to set up a serial mouse.

In a console, navigate to /etc/X11

cd /etc/X11

There you can use an editor to manually edit the file xorg.conf You will need to do this as root. vi is a commonly used editor.

sudo <editor_of_choice> xorg.conf

You will be asked for your user password. Once given, the editor will open, displaying the xorg.conf file.

Navigate to the following section:

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" "Microsoft"
Option "ZAxisMapping" "4 5"
EndSection

ttyS0 might need to be ttyS1 on your system, depending on which COM port your mouse is plugged into.

Save your changes (be sure to make a backup first). To get these changes to take affect, you will now need to restart your X server. This is done with "Ctrl-Alt-Backspace"

If that doesn't do it, you can always try a reboot of the system.