GPM/zh-cn

This guide shows you how to set up and use GPM (the General Purpose Mouse server) from within a command line interface. This is especially useful for new Gentoo installations or for systems that cannot or do not use an X server.

获得 GPM
If you've just installed Gentoo, you almost certainly don't have your mouse set up to work within a command line interface (CLI) yet. Or perhaps you can't use or don't need an X server, yet you still need to use a mouse. The solution is simple:, the General Purpose Mouse server.

首先，你需要获得 GPM：

你可能已经注意到在编译过程中出现了一些警告配置服务器的信息. 你必须在启动 GPM 之前执行此操作.

配置 GPM
在使用 GPM 之前，你需要取消注释与鼠标位置和协议相对应的行. 你可以通过编辑 GPM 配置文件来执行此操作：

In the next example, we have a USB mouse on. So, we uncomment, as this is the cumulative device for all mice on the system, and the appropriate protocol. Try using before, as the latter is deprecated and can be disabled in more recent kernels. If fails, then fall back to other devices. Here is the example :

If you have a wheelmouse, you will want to use the imps2 protocol, so uncomment that line. If imps2 and ps2 both fail to work for you, please refer to the GPM info page for other protocols to try. Also, if you want to be able to click on hyperlinks in terminals to navigate to a website, it is a good idea to follow the suggestion in the file:

The rest of the conf.d file contains other suggestions for your mouse server; uncomment the various options according to your needs. See for more information.

运行 GPM
现在你的鼠标服务器已经安装和配置，是时候开始使用它了：

你应该能看到一个光标块出现. 请记住，只有 root 可以运行 GPM 初始化脚本. 但是，为了避免每次开始新的会话时都必须使用 并运行脚本，为什么不将 GPM 设置为每次打开计算机时开始？

现在，无论何时启动计算机，当你进入登录提示时，控制台光标都会向你致意. 即使你没有以 root 身份登录，鼠标服务器也会继续运行.

复制和粘贴
使用工作鼠标服务器复制和粘贴大块文本非常容易. 只需使用鼠标左键高亮文本（释放按钮时它会保持高亮显示），如果愿意，切换到不同的终端，定位光标，然后按鼠标中键将文本粘贴到光标的位置. 请注意，你可以在不离开启动终端的情况下进行复制和粘贴. 这使得将错误消息的输出发布到 Gentoo 论坛变得非常简单.

文本模式浏览和 GPM
如果你在一个屏幕上有一条消息，而在另一个屏幕上有一个文本模式的 Web 浏览器，你可以通过突出显示来复制错误消息，然后切换到另一个终端，左键单击相应的文本输入框以将其选中，然后按下鼠标中键. 你的错误消息现在就可以发布到论坛.

Though discussion of text-only browsers is somewhat beyond the scope of this guide, inevitably users will need to find a compatible console browser. Though is most likely the oldest and well established browser, its interface has poor mouse support and recognition. Instead, try using which has excellent mouse integration.

This concludes the guide to using a mouse within the console. Happy mousing!