1.\" $NetBSD: moused.8,v 1.8 2006/09/12 20:48:47 pavel Exp $ 2.\" 3.\" Copyright (c) 1996 4.\" Mike Pritchard <mpp@FreeBSD.org>. All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 3. All advertising materials mentioning features or use of this software 15.\" must display the following acknowledgement: 16.\" This product includes software developed by Mike Pritchard. 17.\" 4. Neither the name of the author nor the names of its contributors 18.\" may be used to endorse or promote products derived from this software 19.\" without specific prior written permission. 20.\" 21.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 22.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 25.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" SUCH DAMAGE. 32.\" 33.\" from: 34.\" 35.\" FreeBSD: src/usr.sbin/moused/moused.8,v 1.39 2001/08/10 13:45:34 ru Exp 36.\" 37.Dd October 29, 2001 38.Dt MOUSED 8 39.Os 40.Sh NAME 41.Nm moused 42.Nd pass mouse data to mouse mux 43.Sh SYNOPSIS 44.Nm 45.Op Fl DPRacdfs 46.Op Fl I Ar file 47.Op Fl F Ar rate 48.Op Fl r Ar resolution 49.Op Fl S Ar baudrate 50.Op Fl W Ar devicename 51.Op Fl a Ar X Ns Op ,Y 52.Op Fl m Ar N=M 53.Op Fl w Ar N 54.Op Fl z Ar target 55.Op Fl t Ar mousetype 56.Op Fl 3 Op Fl E Ar timeout 57.Fl p Ar port 58.Pp 59.Nm 60.Op Fl Pd 61.Fl p Ar port 62.Fl i Ar info 63.Sh DESCRIPTION 64The mouse daemon 65.Nm 66and the console driver work together to support 67access to serial mice from user programs. 68They virtualize the mouse and provide user programs with mouse data 69in the standard format 70(see 71.Xr wsmouse 4 ) . 72.Pp 73.Nm 74listens to the specified port for mouse data, interprets and then 75passes it via ioctls to the console driver. 76It reports translation movement, button press/release events and 77movement of the roller or the wheel if available. 78The roller/wheel movement is reported as 79.Dq Z 80axis movement. 81.Pp 82If 83.Nm 84receives the signal 85.Dv SIGHUP , 86it will reopen the mouse port and reinitializes itself. 87Useful if 88the mouse is attached/detached while the system is suspended. 89.Pp 90The following options are available: 91.Bl -tag -width indent 92.It Fl 3 93Emulate the third (middle) button for 2-button mice. 94It is emulated 95by pressing the left and right physical buttons simultaneously. 96.It Fl D 97Lower DTR on the serial port. 98This option is valid only if 99.Ar mousesystems 100is selected as the protocol type. 101The DTR line may need to be dropped for a 3-button mouse 102to operate in the 103.Ar mousesystems 104mode. 105.It Fl E Ar timeout 106When the third button emulation is enabled (see above), 107.Nm 108waits 109.Ar timeout 110milliseconds at most before deciding whether two buttons are being 111pressed simultaneously. 112The default timeout is 100 milliseconds. 113.It Fl F Ar rate 114Set the report rate (reports per second) of the device if supported. 115.It Fl I Ar file 116Write the process id of 117.Nm 118in the specified file. 119Without this option, the process id will be stored in 120.Pa /var/run/moused.pid . 121.It Fl P 122Do not start the Plug and Play COM device enumeration procedure 123when identifying the serial mouse. 124If this option is given together with the 125.Fl i 126option, 127.Nm 128will not be able to print useful information for the serial mouse. 129.It Fl R 130Lower RTS on the serial port. 131This option is valid only if 132.Ar mousesystems 133is selected as the protocol type by the 134.Fl t 135option below. 136It is often used with the 137.Fl D 138option above. 139Both RTS and DTR lines may need to be dropped for 140a 3-button mouse to operate in the 141.Ar mousesystems 142mode. 143.It Fl S Ar baudrate 144Select the baudrate for the serial port (1200 to 9600). 145Not all serial mice support this option. 146.It Fl W Ar devicename 147Select the 148.Xr wsmux 4 149control device. 150The default is 151.Pa /dev/wsmuxctl0 . 152.It Fl a Ar X Ns Op ,Y 153Accelerate or decelerate the mouse input. 154This is a linear acceleration only. 155Values less than 1.0 slow down movement, values greater than 1.0 speed it 156up. 157Specifying only one value sets the acceleration for both axes. 158.It Fl c 159Some mice report middle button down events 160as if the left and right buttons are being pressed. 161This option handles this. 162.It Fl d 163Enable debugging messages. 164.It Fl f 165Do not become a daemon and instead run as a foreground process. 166Useful for testing and debugging. 167.It Fl i Ar info 168Print specified information and quit. 169Available pieces of information are: 170.Pp 171.Bl -tag -compact -width modelxxx 172.It Ar port 173Port (device file) name, e.g.\& 174.Pa /dev/tty00 . 175.It Ar if 176Interface type: serial, bus, inport or ps/2. 177.It Ar type 178Protocol type. 179It is one of the types listed under the 180.Fl t 181option below. 182.It Ar model 183Mouse model. 184.Nm 185may not always be able to identify the model. 186.It Ar all 187All of the above items. 188Print port, interface, type and model in this order in one line. 189.El 190.Pp 191If 192.Nm 193cannot determine the requested information, it prints ``unknown'' or 194``generic''. 195.It Fl m Ar N=M 196Assign the physical button 197.Ar M 198to the logical button 199.Ar N . 200You may specify as many instances of this option as you like. 201More than one physical button may be assigned to a logical button at the 202same time. 203In this case the logical button will be down, 204if either of the assigned physical buttons is held down. 205Do not put space around `='. 206.It Fl p Ar port 207Use 208.Ar port 209to communicate with the mouse. 210.It Fl r Ar resolution 211Set the resolution of the device; in Dots Per Inch, or 212.Ar low , 213.Ar medium-low , 214.Ar medium-high 215or 216.Ar high . 217This option may not be supported by all the device. 218.It Fl s 219Select a baudrate of 9600 for the serial line. 220Not all serial mice support this option. 221.It Fl t Ar type 222Specify the protocol type of the mouse attached to the port. 223You may explicitly specify a type listed below, or use 224.Ar auto 225to let 226.Nm 227automatically select an appropriate protocol for the given mouse. 228If you entirely omit this option on the command line, 229.Fl t Ar auto 230is assumed. 231Under normal circumstances, you need to use this option only if 232.Nm 233is not able to detect the protocol automatically. 234.Pp 235Note that if a protocol type is specified with this option, the 236.Fl P 237option above is implied and Plug and Play COM device enumeration 238procedure will be disabled. 239.Pp 240Valid types for this option are 241listed below. 242.Pp 243For the serial mouse: 244.Bl -tag -compact -width mousesystemsxxx 245.It Ar microsoft 246Microsoft serial mouse protocol. 247Most 2-button serial mice use this protocol. 248.It Ar intellimouse 249Microsoft IntelliMouse protocol. 250Genius NetMouse, ASCII Mie Mouse, Logitech MouseMan+ and FirstMouse+ 251use this protocol too. 252Other mice with a roller/wheel may be compatible with this protocol. 253.It Ar mousesystems 254MouseSystems 5-byte protocol. 2553-button mice may use this protocol. 256.It Ar mmseries 257MM Series mouse protocol. 258.It Ar logitech 259Logitech mouse protocol. 260Note that this is for old Logitech models. 261.Ar mouseman 262or 263.Ar intellimouse 264should be specified for newer models. 265.It Ar mouseman 266Logitech MouseMan and TrackMan protocol. 267Some 3-button mice may be compatible with this protocol. 268Note that MouseMan+ and FirstMouse+ use 269.Ar intellimouse 270protocol rather than this one. 271.It Ar glidepoint 272ALPS GlidePoint protocol. 273.It Ar thinkingmouse 274Kensington ThinkingMouse protocol. 275.It Ar mmhitab 276Hitachi tablet protocol. 277.It Ar x10mouseremote 278X10 MouseRemote. 279.It Ar kidspad 280Genius Kidspad and Easypad protocol. 281.It Ar versapad 282Interlink VersaPad protocol. 283.El 284.It Fl w Ar N 285Make the physical button 286.Ar N 287act as the wheel mode button. 288While this button is pressed, X and Y axis movement is reported to be zero 289and the Y axis movement is mapped to Z axis. 290You may further map the Z axis movement to virtual buttons by the 291.Fl z 292option below. 293.It Fl z Ar target 294Map Z axis (roller/wheel) movement to another axis or to virtual buttons. 295Valid 296.Ar target 297maybe: 298.Bl -tag -compact -width x__ 299.It Ar x 300.It Ar y 301X or Y axis movement will be reported when the Z axis movement is detected. 302.It Ar N 303Report down events for the virtual buttons 304.Ar N 305and 306.Ar N+1 307respectively when negative and positive Z axis movement 308is detected. 309There do not need to be physical buttons 310.Ar N 311and 312.Ar N+1 . 313Note that mapping to logical buttons is carried out after mapping 314from the Z axis movement to the virtual buttons is done. 315.It Ar N1 N2 316Report down events for the virtual buttons 317.Ar N1 318and 319.Ar N2 320respectively when negative and positive Z axis movement 321is detected. 322.It Ar N1 N2 N3 N4 323This is useful for the mouse with two wheels of which 324the second wheel is used to generate horizontal scroll action, 325and for the mouse which has a knob or a stick which can detect 326the horizontal force applied by the user. 327.Pp 328The motion of the second wheel will be mapped to the buttons 329.Ar N3 , 330for the negative direction, and 331.Ar N4 , 332for the positive direction. 333If the buttons 334.Ar N3 335and 336.Ar N4 337actually exist in this mouse, their actions will not be detected. 338.Pp 339Note that horizontal movement or second roller/wheel movement may not 340always be detected, 341because there appears to be no accepted standard as to how it is encoded. 342.Pp 343Note also that some mice think left is the negative horizontal direction, 344others may think otherwise. 345Moreover, there are some mice whose two wheels are both mounted vertically, 346and the direction of the second vertical wheel does not match the 347first one's. 348.El 349.El 350.Ss Multiple Mice 351As many instances of 352.Nm 353as the number of mice attached to the system may be run 354simultaneously; one instance for each serial mouse. 355.Sh FILES 356.Bl -tag -width /var/run/moused.pid -compact 357.It Pa /dev/wsmuxctl0 358default device to control mouse mux 359.It Pa /var/run/moused.pid 360process id of the currently running 361.Nm 362.El 363.Sh EXAMPLES 364.Dl moused -p /dev/tty00 -i type 365.Pp 366Let 367.Nm 368determine the protocol type of the mouse at the serial port 369.Pa /dev/tty00 . 370If successful, 371.Nm 372will print the type, otherwise it will say ``unknown''. 373.Pp 374.Dl moused -p /dev/tty00 375.Pp 376If 377.Nm 378is able to identify the protocol type of the mouse at the specified 379port automatically, you can start the daemon without the 380.Fl t 381option and enable the mouse pointer in the text console as above. 382.Pp 383.Dl moused -p /dev/tty01 -t microsoft 384.Pp 385Start 386.Nm 387on the serial port 388.Pa /dev/tty01 . 389The protocol type 390.Ar microsoft 391is explicitly specified by the 392.Fl t 393option. 394.Pp 395.Dl moused -p /dev/tty01 -m 1=3 -m 3=1 396.Pp 397Assign the physical button 3 (right button) to the logical button 1 398(logical left) and the physical button 1 (left) to the logical 399button 3 (logical right). 400This will effectively swap the left and right buttons. 401.Pp 402.Dl moused -p /dev/tty01 -t intellimouse -z 4 403.Pp 404Report negative Z axis (roller) movement as the button 4 pressed 405and positive Z axis movement as the button 5 pressed. 406.Pp 407The mouse daemon is normally enabled by setting 408.Pa moused=YES 409in 410.Pa /etc/rc.conf . 411.Sh SEE ALSO 412.Xr wsmouse 4 , 413.Xr wsmux 4 , 414.Xr rc.conf 5 , 415.Xr wsmoused 8 416.Sh STANDARDS 417.Nm 418partially supports 419.Dq Plug and Play External COM Device Specification 420in order to support PnP serial mice. 421However, due to various degrees of conformance to the specification 422by existing serial mice, it does not strictly follow version 1.0 423of the standard. 424Even with this less strict approach, it may not always determine 425an appropriate protocol type for the given serial mouse. 426.Sh HISTORY 427The mouse daemon 428.Nm 429first appeared in 430.Fx 2.2 431and 432.Nx 1.6 . 433.Sh AUTHORS 434.Nm 435was written by 436.An Michael Smith 437.Aq msmith@FreeBSD.org . 438This manual page was written by 439.An Mike Pritchard 440.Aq mpp@FreeBSD.org . 441The daemon and manual page have since been updated by 442.An Kazutaka Yokota 443.Aq yokota@FreeBSD.org . 444The 445.Nx 446port was done by 447.An Lennart Augustsson 448.Aq augustss@NetBSD.org . 449.Sh BUGS 450Many pad devices behave as if the first (left) button were pressed if 451the user `taps' the surface of the pad. 452In contrast, some ALPS GlidePoint and Interlink VersaPad models 453treat the tapping action as fourth button events. 454Use the option ``-m 1=4'' for these models 455to obtain the same effect as the other pad devices. 456