个人工具
119.28.94.63
该IP地址的讨论
登录
查看“UbuntuHelp:SerialMouseHowto”的源代码 - Ubuntu中文
UbuntuHelp
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“UbuntuHelp:SerialMouseHowto”的源代码
来自Ubuntu中文
←
UbuntuHelp:SerialMouseHowto
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{From|https://help.ubuntu.com/community/SerialMouseHowto}} {{Languages|UbuntuHelp:SerialMouseHowto}} 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... == Manual editing of the xorg.conf file == This is arguably the simplest method to set up a serial mouse. <ol><li>Boot up normally and wait for Ubuntu to finish loading. </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). </li><li>Type the following exactly: <pre><nowiki> sudo nano -B /etc/X11/xorg.conf </nowiki></pre> </li><li>If you have one, you will be asked for your user password. </li><li>The editor will open, displaying the xorg.conf file. </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" Identifier "Configured Mouse" Driver "mouse" Option "CorePointer" Option "Device" "/dev/input/mice" Option "Protocol" "ExplorerPS/2" Option "ZAxisMapping" "4 5" Option "Emulate3Buttons" "true" EndSection </nowiki></pre> </li><li>Change the "Option Device" and "Option Protocol" lines as follows: <pre><nowiki> Section "InputDevice" Identifier "Configured Mouse" Driver "mouse" Option "CorePointer" Option "Device" "/dev/ttyS0" Option "Protocol" "auto" Option "ZAxisMapping" "4 5" EndSection </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. </li><li>Type '''Ctrl+X''' then '''Y''' and '''Enter''' to save the changes to the file and exit. </li><li>Press '''Ctrl+Alt+F7''' (to return to 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>. </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> cd /etc/X11 sudo cp xorg.conf~ xorg.conf </nowiki></pre> (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. <ol><li>Login normally and wait for Ubuntu to finish loading. </li><li>Press '''"Alt+F1"''', to open the '''"Applications"''' menu. </li><li>Press '''down arrow''' to move to the '''"Accessories"''' item. </li><li>Press '''right arrow''' to get into the next '''"menu"'''. </li><li>Press '''down arrow''' to move to the '''"Terminal"''' item. </li><li>Press '''Enter/Return''' to start a '''small terminal window'''. </li><li>Type in '''"gksudo gedit /etc/X11/xorg.conf"''' and press '''Enter/Return'''. </li><li>When asked, enter your '''password''' and press '''Enter/Return''' (gedit will open, displaying the xorg.conf file). <ol><li>Using the keyboard, navigate to '''"Configured Mouse"'''. </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) </li><li>Change '''"ExplorerPS/2"''' to '''"Auto"''' (add this line if it doesn't exist) </li></ol></li><li>Press '''"Ctrl+s"''' to save the changes. </li><li>Press '''"Ctrl+q"''' to close the editor.</li></ol> ---- /!\ '''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. == Using Inputattach == <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). </li><li>Login using your username and password. </li><li>Run 'inputattach --help' and find the appropriate protocol option to match your mouse </li><li>Add 'inputattach <protocol option> /dev/ttyS0' (or whatever device your serial mouse is attached to) to /etc/rc.local </li><li>Restart </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) == 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 <pre><nowiki> sudo dpkg-reconfigure xserver-xorg </nowiki></pre> * 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 <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. == 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. <ol><li>Exit the xserver </li><li>Create an .xinitrc file in your home directory, with the following line. <pre><nowiki> xterm -geometry +300+300 </nowiki></pre> </li><li>Save the file and run startx </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 </nowiki></pre> And follow the installation procedure using only your keyboard.</li></ol> ---- [[category:CategoryCleanup]] [[category:CategoryX]] [[category:UbuntuHelp]]
该页面使用的模板:
模板:From
(
查看源代码
)
模板:Languages
(
查看源代码
)(受保护)
模板:Languages/Lang
(
查看源代码
)(受保护)
返回至
UbuntuHelp:SerialMouseHowto
。