| 1 |
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
|
| 3 |
<!-- $Header$ -->
|
| 4 |
|
| 5 |
<guide link="/doc/en/gpm.xml">
|
| 6 |
<title>Using a Mouse within the Console</title>
|
| 7 |
|
| 8 |
<author title="Author">
|
| 9 |
<mail link="jackdark@gmail.com">Joshua Saddler</mail>
|
| 10 |
</author>
|
| 11 |
|
| 12 |
<abstract>
|
| 13 |
This guide shows you how to set up and use gpm (the General
|
| 14 |
Purpose Mouse server) from within a command line interface.
|
| 15 |
This is especially useful for new Gentoo installations or
|
| 16 |
for systems that cannot or do not use an X server.
|
| 17 |
</abstract>
|
| 18 |
|
| 19 |
<!-- The content of this document is licensed under the CC-BY-SA license -->
|
| 20 |
<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
|
| 21 |
<license/>
|
| 22 |
|
| 23 |
<version>1.0</version>
|
| 24 |
<date>2005-07-19</date>
|
| 25 |
|
| 26 |
<chapter>
|
| 27 |
<title>Getting gpm</title>
|
| 28 |
<section>
|
| 29 |
<body>
|
| 30 |
|
| 31 |
<p>
|
| 32 |
If you've just installed Gentoo, you almost certainly don't have your mouse
|
| 33 |
set up to work within a command line interface (CLI) yet. Or perhaps you
|
| 34 |
can't use or don't need an X server, yet you still need to use a mouse. The
|
| 35 |
solution is simple: <c>gpm</c>, the General Purpose Mouse server.
|
| 36 |
</p>
|
| 37 |
|
| 38 |
<p>
|
| 39 |
First, you will need to get gpm:
|
| 40 |
</p>
|
| 41 |
|
| 42 |
<pre caption="Obtaining gpm">
|
| 43 |
# <i>emerge gpm</i>
|
| 44 |
</pre>
|
| 45 |
|
| 46 |
<p>
|
| 47 |
You might have noticed a few messages during the compilation that warned
|
| 48 |
about configuring the server. You must do this before starting gpm.
|
| 49 |
</p>
|
| 50 |
|
| 51 |
</body>
|
| 52 |
</section>
|
| 53 |
</chapter>
|
| 54 |
|
| 55 |
<chapter>
|
| 56 |
<title>Configuring gpm</title>
|
| 57 |
<section>
|
| 58 |
<body>
|
| 59 |
|
| 60 |
<p>
|
| 61 |
Before you can use gpm, you will need to uncomment the lines
|
| 62 |
corresponding to the location and protocol of your mouse. You do this by
|
| 63 |
editing the gpm configuration file:
|
| 64 |
</p>
|
| 65 |
|
| 66 |
<pre caption="Setting up gpm">
|
| 67 |
# <i>nano /etc/conf.d/gpm</i>
|
| 68 |
</pre>
|
| 69 |
|
| 70 |
<p>
|
| 71 |
In my case, I have a USB mouse on <path>/dev/input/mouse0</path>. So, I
|
| 72 |
have uncommented <path>/dev/input/mice</path>, as this is the cumulative
|
| 73 |
device for all mice on the system, and the appropriate protocol.
|
| 74 |
Try using <path>/dev/input/mice</path> before <path>/dev/psaux</path>, as
|
| 75 |
the latter is deprecated and can be disabled in the latest 2.6 kernels. If
|
| 76 |
<path>/dev/input/mice</path> fails, then fall back to other devices. Here is
|
| 77 |
my example <path>/etc/conf.d/gpm</path>:
|
| 78 |
</p>
|
| 79 |
|
| 80 |
<pre caption="Example gpm config">
|
| 81 |
<comment># Please uncomment the type of mouse you have and the appropriate MOUSEDEV entry</comment>
|
| 82 |
|
| 83 |
#MOUSE=ps2
|
| 84 |
MOUSE=imps2
|
| 85 |
#MOUSEDEV=/dev/psaux
|
| 86 |
MOUSEDEV=/dev/input/mice
|
| 87 |
</pre>
|
| 88 |
|
| 89 |
<p>
|
| 90 |
If you have a wheelmouse, you will want to use the imps2 protocol, so
|
| 91 |
uncomment that line. If imps2 and ps2 both fail to work for you, please
|
| 92 |
refer to the gpm info page (<c>info gpm</c>) for other protocols to try.
|
| 93 |
Also, if you want to be able to click on hyperlinks in terminals to
|
| 94 |
navigate to a website, it is a good idea to follow the suggestion in the
|
| 95 |
<c>/etc/conf.d/gpm</c> file:
|
| 96 |
</p>
|
| 97 |
|
| 98 |
<pre caption="Other options">
|
| 99 |
<comment># Please uncomment this line if you want gpm to understand charsets</comment>
|
| 100 |
<comment># used in URLs and names with ~ or : in them, etc.</comment>
|
| 101 |
<comment># This is a good idea to turn on!</comment>
|
| 102 |
|
| 103 |
APPEND="-l \"a-zA-Z0-9_.:~/\300-\326\330-\366\370-\377\""
|
| 104 |
</pre>
|
| 105 |
|
| 106 |
<p>
|
| 107 |
The rest of the conf.d file contains other suggestions for your mouse server;
|
| 108 |
uncomment the various options according to your needs. See <c>man gpm</c>
|
| 109 |
for more information.
|
| 110 |
</p>
|
| 111 |
|
| 112 |
</body>
|
| 113 |
</section>
|
| 114 |
</chapter>
|
| 115 |
|
| 116 |
<chapter>
|
| 117 |
<title>Running gpm</title>
|
| 118 |
<section>
|
| 119 |
<body>
|
| 120 |
|
| 121 |
<p>
|
| 122 |
Now that your mouse server is installed and configured, it's time to start
|
| 123 |
using it:
|
| 124 |
</p>
|
| 125 |
|
| 126 |
<pre caption="The gpm init script">
|
| 127 |
# <i>/etc/init.d/gpm start</i>
|
| 128 |
</pre>
|
| 129 |
|
| 130 |
<p>
|
| 131 |
You should see a block cursor appear. Remember that only root can run the gpm
|
| 132 |
init script. However, to avoid having to <c>su</c> and run the script every
|
| 133 |
single time you begin a new session, why not set gpm to begin every time you
|
| 134 |
turn on your computer?
|
| 135 |
</p>
|
| 136 |
|
| 137 |
<pre caption="Adding gpm to the default runlevel">
|
| 138 |
# <i>rc-update add gpm default</i>
|
| 139 |
</pre>
|
| 140 |
|
| 141 |
<p>
|
| 142 |
Now, whenever you start your computer, you'll be greeted by the console cursor
|
| 143 |
by the time you get to the login prompt. The mouse server will continue to run
|
| 144 |
even if you're not logged in as root.
|
| 145 |
</p>
|
| 146 |
|
| 147 |
</body>
|
| 148 |
</section>
|
| 149 |
</chapter>
|
| 150 |
|
| 151 |
<chapter>
|
| 152 |
<title>Working with gpm</title>
|
| 153 |
<section>
|
| 154 |
<title>Copying and pasting</title>
|
| 155 |
<body>
|
| 156 |
|
| 157 |
<p>
|
| 158 |
Copying and pasting large blocks of text with a working mouse server is very
|
| 159 |
easy. Simply highlight the text with the left mouse button (it will stay
|
| 160 |
highlighted when you release the button), switch to a different terminal if you
|
| 161 |
wish, position the cursor, and press the middle mouse button to paste the text
|
| 162 |
where you placed the cursor. Note that you can copy and paste without ever
|
| 163 |
leaving the terminal you started. This makes posting the output of error
|
| 164 |
messages to the <uri link="http://forums.gentoo.org">Gentoo forums</uri>
|
| 165 |
extremely simple.
|
| 166 |
</p>
|
| 167 |
|
| 168 |
</body>
|
| 169 |
</section>
|
| 170 |
<section>
|
| 171 |
<title>Text-mode browsing and gpm</title>
|
| 172 |
<body>
|
| 173 |
|
| 174 |
<p>
|
| 175 |
If you have a message on one screen and a text-mode web browser on the other,
|
| 176 |
you can copy the error message by highlighting it, then change to the other
|
| 177 |
terminal, left-click the appropriate text entry box to select it, and then press
|
| 178 |
the middle mouse button. Voila! Your error message can now be posted to the
|
| 179 |
forums.
|
| 180 |
</p>
|
| 181 |
|
| 182 |
<p>
|
| 183 |
Though discussion of text-only browsers is somewhat beyond the scope of this
|
| 184 |
guide, inevitably users will need to find a compatible console browser. Though
|
| 185 |
<c>lynx</c> is most likely the oldest and well established browser, its
|
| 186 |
interface has poor mouse support and recognition. Instead, try using
|
| 187 |
<c>links</c>, the same browser which is also included in the Gentoo Installation
|
| 188 |
CDs. <c>links</c> has excellent mouse integration:
|
| 189 |
</p>
|
| 190 |
|
| 191 |
<pre caption="Obtaining links">
|
| 192 |
# <i>emerge links</i>
|
| 193 |
</pre>
|
| 194 |
|
| 195 |
<p>
|
| 196 |
This concludes the guide to using a mouse within the console. Happy mousing!
|
| 197 |
</p>
|
| 198 |
|
| 199 |
</body>
|
| 200 |
</section>
|
| 201 |
</chapter>
|
| 202 |
|
| 203 |
</guide>
|