1.\" $NetBSD: wsmoused.8,v 1.15 2004/06/08 03:28:42 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 August 6, 2003 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 SECURITY CONSIDERATIONS 118When using the 119.Sq action 120mode, commands specified in the configuration file are executed as the 121user who started the daemon. 122By default, this user is 123.Sq root 124when using the 125.Xr rc.subr 8 126framework. 127You should set 128.Sq wsmoused_user="\*[Lt]some_user\*[Gt]" 129in 130.Xr rc.conf 5 131to a safer user (and adjust file permissions accordingly) if the commands 132you want to execute do not require superuser privileges. 133An alternative is to use 134.Xr su 1 135as part of the command string in the configuration file. 136.Pp 137When enabling the kernel option 138.Cd options WSDISPLAY_CHARFUNCS , 139only needed by the 140.Sq selection 141mode, be absolutely sure that 142.Pa /dev/ttyE* 143devices have restrictive permissions; the mouse uses some functions 144that could allow terminal snooping if improperly set. 145.Sh NOTES 146The following notes apply to all work modes: 147.Bl -bullet 148.It 149When switching from the X screen to a text terminal, there is a small 150delay (five seconds) until the mouse works again. 151This time is used by X 152to close the mouse device properly. 153.El 154.Pp 155The following notes apply to the 156.Sq selection 157mode only: 158.Bl -bullet 159.It 160The mouse cursor is only visible for a short period of time. 161It will disappear 162when you stop moving it to avoid console corruption (which happens if 163it is visible and there is text output). 164.It 165.Cd options WSDISPLAY_CHARFUNCS 166is needed in your kernel configuration file. 167.It 168You need to change the getty program which is run in the first 169virtual terminal to use 170.Pa /dev/ttyE0 171instead of 172.Pa /dev/console . 173To do this, edit 174.Pa /etc/ttys 175and 176.Pa /etc/wscons.conf . 177.El 178.Sh SEE ALSO 179.Xr su 1 , 180.Xr wscons 4 , 181.Xr wsdisplay 4 , 182.Xr wsmouse 4 , 183.Xr rc.conf 5 , 184.Xr ttys 5 , 185.Xr wscons.conf 5 , 186.Xr wsmoused.conf 5 , 187.Xr moused 8 , 188.Xr rc.subr 8 189.Sh HISTORY 190The 191.Nm 192command first appeared in 193.Nx 2.0 . 194.Sh AUTHORS 195The 196.Nm 197command was developed by 198.An Julio M. Merino Vidal 199.Aq jmmv@NetBSD.org . 200