xref: /netbsd-src/usr.sbin/wsmoused/wsmoused.8 (revision c38e7cc395b1472a774ff828e46123de44c628e9)
1.\" $NetBSD: wsmoused.8,v 1.19 2017/07/03 21:35:32 wiz Exp $
2.\"
3.\" Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Julio M. Merino Vidal.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Neither the name of The NetBSD Foundation nor the names of its
15.\"    contributors may be used to endorse or promote products derived
16.\"    from this software without specific prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28.\" POSSIBILITY OF SUCH DAMAGE.
29.\"
30.Dd January 1, 2012
31.Dt WSMOUSED 8
32.Os
33.Sh NAME
34.Nm wsmoused
35.Nd multipurpose mouse daemon
36.Sh SYNOPSIS
37.Nm
38.Op Fl d Ar device
39.Op Fl f Ar conf_file
40.Op Fl m Ar modes
41.Op Fl n
42.Sh DESCRIPTION
43The
44.Nm
45daemon provides mouse support in console, allowing copying and pasting
46text.
47The left mouse button is used to select text when held and you
48use the right button to paste it in the active console.
49.Pp
50Supported options are as follows:
51.Bl -tag -width XfXconfXfileXX
52.It Fl d Ar device
53specifies the device file to be used as the
54.Xr wsmouse 4
55device.
56Defaults to
57.Pa /dev/wsmouse .
58.It Fl f Ar conf_file
59specifies the configuration file to be used.
60Defaults to
61.Pa /etc/wsmoused.conf .
62.It Fl m Ar modes
63specifies which modes should be activated.
64Mode names are given in the argument as a whitespace separated list.
65Overrides the
66.Sq modes
67directive in the configuration file.
68.It Fl n
69do not fork in the background (for debugging purposes).
70Overrides the
71.Sq nodaemon
72directive in the configuration file.
73.El
74.Pp
75Many other details can be tuned.
76See
77.Xr wsmoused.conf 5
78for more information.
79.Pp
80.Nm
81is designed to be a multipurpose mouse daemon.
82Functionality is provided through independent
83.Em modes ,
84enabled either through the
85.Fl m
86flag or through the
87.Sq modes
88property in the configuration file (the former takes precedence).
89.Ss The action mode
90The
91.Sq action
92mode executes commands upon receiving mouse button events.
93Commands can be associated on a button basis, and can differentiate between
94push or release events.
95.Ss The selection mode
96The
97.Sq selection
98mode provides visual copy and paste support in text consoles when using
99the
100.Xr wscons 4
101device.
102A selection is created by clicking with the primary mouse button at any
103point on the screen and dragging it while clicked.
104When the button is released, the selected text is copied to an internal
105buffer for further pasting with the secondary button.
106.Sh FILES
107.Bl -tag -width /dev/wsmoused.conf -compact
108.It Pa /dev/ttyE[0-n]
109tty devices
110.It Pa /dev/ttyEstat
111wsdisplay status notification device
112.It Pa /dev/wsmouse[0-n]
113mouse control device
114.It Pa /etc/wsmoused.conf
115default configuration file
116.El
117.Sh SEE ALSO
118.Xr su 1 ,
119.Xr wscons 4 ,
120.Xr wsdisplay 4 ,
121.Xr wsmouse 4 ,
122.Xr rc.conf 5 ,
123.Xr ttys 5 ,
124.Xr wscons.conf 5 ,
125.Xr wsmoused.conf 5 ,
126.Xr moused 8 ,
127.Xr rc.subr 8
128.Sh HISTORY
129The
130.Nm
131command first appeared in
132.Nx 2.0 .
133.Sh AUTHORS
134The
135.Nm
136command was developed by
137.An Julio M. Merino Vidal
138.Aq jmmv@NetBSD.org .
139.Sh CAVEATS
140.Nm
141does work properly only with display drivers, which implement
142.Dv WSDISPLAYIO_GETWSCHAR
143and
144.Dv WSDISPLAYIO_PUTWSCHAR
145ioctls.
146Currently only
147.Xr vga 4
148and drivers utilizing
149.Xr vcons 9
150support it.
151.Sh SECURITY CONSIDERATIONS
152When using the
153.Sq action
154mode, commands specified in the configuration file are executed as the
155user who started the daemon.
156By default, this user is
157.Sq root
158when using the
159.Xr rc.subr 8
160framework.
161You should set
162.Sq wsmoused_user="<some_user>"
163in
164.Xr rc.conf 5
165to a safer user (and adjust file permissions accordingly) if the commands
166you want to execute do not require superuser privileges.
167An alternative is to use
168.Xr su 1
169as part of the command string in the configuration file.
170.Sh NOTES
171The following notes apply to all work modes:
172.Bl -bullet
173.It
174When switching from the X screen to a text terminal, there is a small
175delay (five seconds) until the mouse works again.
176This time is used by X
177to close the mouse device properly.
178.El
179.Pp
180The following notes apply to the
181.Sq selection
182mode only:
183.Bl -bullet
184.It
185The mouse cursor is only visible for a short period of time.
186It will disappear
187when you stop moving it to avoid console corruption (which happens if
188it is visible and there is text output).
189.It
190You need to change the getty program which is run in the first
191virtual terminal to use
192.Pa /dev/ttyE0
193instead of
194.Pa /dev/console .
195To do this, edit
196.Pa /etc/ttys
197and
198.Pa /etc/wscons.conf .
199.El
200