2 .\" Mike Pritchard <mpp@FreeBSD.org>. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\" must display the following acknowledgement:
14 .\" This product includes software developed by Mike Pritchard.
15 .\" 4. Neither the name of the author nor the names of its contributors
16 .\" may be used to endorse or promote products derived from this software
17 .\" without specific prior written permission.
19 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
20 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
23 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38 .Nd pass mouse data to the console driver
44 .Op Fl r Ar resolution
51 .Op Fl 3 Op Fl E Ar timeout
61 and the console driver work together to support
62 mouse operation in the text console and user programs.
63 They virtualize the mouse and provide user programs with mouse data
64 in the standard format
65 .Pq see Xr sysmouse 4 .
67 The mouse daemon listens to the specified port for mouse data,
68 interprets and then passes it via ioctls to the console driver.
70 reports translation movement, button press/release
71 events and movement of the roller or the wheel if available.
72 The roller/wheel movement is reported as ``Z'' axis movement.
74 The console driver will display the mouse pointer on the screen
75 and provide cut and paste functions if the mouse pointer is enabled
76 in the virtual console via
80 is opened by the user program, the console driver also passes the mouse
81 data to the device so that the user program will see it.
83 If the mouse daemon receives the signal
85 it will reopen the mouse port and reinitializes itself.
87 the mouse is attached/detached while the system is suspended.
89 The following options are available:
90 .Bl -tag -width indent
92 Emulate the third (middle) button for 2-button mice.
94 by pressing the left and right physical buttons simultaneously.
96 Set double click speed as the maximum interval in msec between button clicks.
97 Without this option, the default value of 500 msec will be assumed.
98 This option will have effect only on the cut and paste operations
99 in the text mode console.
100 The user program which is reading mouse data
103 will not be affected.
105 Lower DTR on the serial port.
106 This option is valid only if
108 is selected as the protocol type.
109 The DTR line may need to be dropped for a 3-button mouse
114 When the third button emulation is enabled
120 msec at most before deciding whether two buttons are being pressed
122 The default timeout is 100 msec.
124 Set the report rate (reports/sec) of the device if supported.
126 Write the process id of the
128 daemon in the specified file.
129 Without this option, the process id will be stored in
130 .Pa /var/run/moused.pid .
132 Do not start the Plug and Play COM device enumeration procedure
133 when identifying the serial mouse.
134 If this option is given together with the
138 command will not be able to print useful information for the serial mouse.
140 Lower RTS on the serial port.
141 This option is valid only if
143 is selected as the protocol type by the
146 It is often used with the
149 Both RTS and DTR lines may need to be dropped for
150 a 3-button mouse to operate in the
154 Select the baudrate for the serial port (1200 to 9600).
155 Not all serial mice support this option.
157 Some mice report middle button down events
158 as if the left and right buttons are being pressed.
159 This option handles this.
161 Enable debugging messages.
163 Do not become a daemon and instead run as a foreground process.
164 Useful for testing and debugging.
166 Print specified information and quit. Available pieces of
169 .Bl -tag -compact -width modelxxx
171 Port (device file) name, i.e.
177 Interface type: serial, bus, inport or ps/2.
180 It is one of the types listed under the
184 if the driver supports the
186 data format standard.
190 command may not always be able to identify the model.
192 All of the above items. Print port, interface, type and model in this order
198 command cannot determine the requested information, it prints ``unknown''
201 Assign the physical button
203 to the logical button
205 You may specify as many instances of this option as you like.
206 More than one physical button may be assigned to a logical button at the
208 In this case the logical button will be down,
209 if either of the assigned physical buttons is held down.
210 Do not put space around `='.
214 to communicate with the mouse.
215 .It Fl r Ar resolution
216 Set the resolution of the device; in Dots Per Inch, or
222 This option may not be supported by all the device.
224 Select a baudrate of 9600 for the serial line.
225 Not all serial mice support this option.
227 Specify the protocol type of the mouse attached to the port.
228 You may explicitly specify a type listed below, or use
232 command to automatically select an appropriate protocol for the given
234 If you entirely ommit this options in the command line,
237 Under normal circumstances,
238 you need to use this option only if the
240 command is not able to detect the protocol automatically
241 .Pq see the Sx Configuring Mouse Daemon .
243 Note that if a protocol type is specified with this option, the
245 option above is implied and Plug and Play COM device enumeration
246 procedure will be disabled.
248 Also note that if your mouse is attached to the PS/2 mouse port, you should
253 regardless of the brand and model of the mouse. Likewise, if your
254 mouse is attached to the bus mouse port, choose
258 Serial mouse protocols will not work with these mice.
260 For the USB mouse, the protocol must be
262 No other protocol will work with the USB mouse.
264 Valid types for this option are
267 For the serial mouse:
268 .Bl -tag -compact -width mousesystemsxxx
270 Microsoft serial mouse protocol. Most 2-button serial mice use this protocol.
272 Microsoft IntelliMouse protocol. Genius NetMouse, ASCII Mie Mouse,
273 Logitech MouseMan+ and FirstMouse+ use this protocol too.
274 Other mice with a roller/wheel may be compatible with this protocol.
276 MouseSystems 5-byte protocol. 3-button mice may use this protocol.
278 MM Series mouse protocol.
280 Logitech mouse protocol. Note that this is for old Logitech models.
284 should be specified for newer models.
286 Logitech MouseMan and TrackMan protocol. Some 3-button mice may be compatible
287 with this protocol. Note that MouseMan+ and FirstMouse+ use
289 protocol rather than this one.
291 ALPS GlidePoint protocol.
293 Kensington ThinkingMouse protocol.
295 Hitachi tablet protocol.
296 .It Ar x10mouseremote
299 Genius Kidspad and Easypad protocol.
301 Interlink VersaPad protocol.
304 For the bus and InPort mouse:
305 .Bl -tag -compact -width mousesystemsxxx
307 This is the only protocol type available for
308 the bus and InPort mouse and should be specified for any bus mice
309 and InPort mice, regardless of the brand.
313 .Bl -tag -compact -width mousesystemsxxx
315 This is the only protocol type available for the PS/2 mouse
316 and should be specified for any PS/2 mice, regardless of the brand.
321 is the only protocol type available for the USB mouse
322 and should be specified for any USB mice, regardless of the brand.
324 Make the physical button
326 act as the wheel mode button.
327 While this button is pressed, X and Y axis movement is reported to be zero
328 and the Y axis movement is mapped to Z axis.
329 You may further map the Z axis movement to virtual buttons by the
333 Map Z axis (roller/wheel) movement to another axis or to virtual buttons.
337 .Bl -tag -compact -width x__
340 X or Y axis movement will be reported when the Z axis movement is detected.
342 Report down events for the virtual buttons
346 respectively when negative and positive Z axis movement
348 There do not need to be physical buttons
352 Note that mapping to logical buttons is carried out after mapping
353 from the Z axis movement to the virtual buttons is done.
355 Report down events for the virtual buttons
359 respectively when negative and positive Z axis movement
362 This is useful for the mouse with two wheels of which
363 the second wheel is used to generate horizontal scroll action,
364 and for the mouse which has a knob or a stick which can detect
365 the horizontal force applied by the user.
367 The motion of the second wheel will be mapped to the buttons
369 for the negative direction, and
371 for the positive direction.
376 actually exist in this mouse, their actions will not be detected.
378 Note that horizontal movement or second roller/wheel movement may not
380 because there appears to be no accepted standard as to how it is encoded.
382 Note also that some mice think left is the negative horizontal direction,
383 others may think otherwise.
384 Moreover, there are some mice whose two wheels are both mounted vertically,
385 and the direction of the second vertical wheel does not match the
389 .Ss Configuring Mouse Daemon
390 The first thing you need to know is the interface type
391 of the mouse you are going to use.
392 It can be determined by looking at the connector of the mouse.
393 The serial mouse has a D-Sub female 9- or 25-pin connector.
394 The bus and InPort mice have either a D-Sub male 9-pin connector
395 or a round DIN 9-pin connector.
396 The PS/2 mouse is equipped with a small, round DIN 6-pin connector.
397 Some mice come with adapters with which the connector can
398 be converted to another. If you are to use such an adapter,
399 remember the connector at the very end of the mouse/adapter pair is
401 The USB mouse has a flat rectangular connector.
403 The next thing to decide is a port to use for the given interface.
404 For the bus, InPort and PS/2 mice, there is little choice:
405 the bus and InPort mice always use
407 and the PS/2 mouse is always at
409 There may be more than one serial port to which the serial
410 mouse can be attached. Many people often assign the first, built-in
414 You can attach multiple USB mice to your system or to your USB hub.
415 They are accessible as
416 .Pa /dev/ums0 , /dev/ums1 ,
419 You may want to create a symbolic link
421 pointing to the real port to which the mouse is connected, so that you
422 can easily distinguish which is your ``mouse'' port later.
424 The next step is to guess the appropriate protocol type for the mouse.
427 command may be able to automatically determine the protocol type.
432 option and see what it says. If the command can identify
433 the protocol type, no further investigation is necessary on your part.
434 You may start the daemon without explicitly specifying a protocol type
435 .Pq see Sx EXAMPLES .
437 The command may print
439 if the mouse driver supports this protocol type.
447 option do not necessarily match the product name of the pointing device
448 in question, but they may give the name of the device with which it is
453 option yields nothing, you need to specify a protocol type to the
458 You have to make a guess and try.
459 There is rule of thumb:
461 .Bl -enum -compact -width 1.X
463 The bus and InPort mice always use
465 protocol regardless of the brand of the mouse.
469 protocol should always be specified for the PS/2 mouse
470 regardless of the brand of the mouse.
474 protocol for the USB mouse.
476 Most 2-button serial mice support the
480 3-button serial mice may work with the
483 If it does not, it may work with the
486 the third (middle) button will not function.
487 3-button serial mice may also work with the
489 protocol under which the third button may function as expected.
491 3-button serial mice may have a small switch to choose between ``MS''
492 and ``PC'', or ``2'' and ``3''.
493 ``MS'' or ``2'' usually mean the
496 ``PC'' or ``3'' will choose the
500 If the mouse has a roller or a wheel, it may be compatible with the
505 To test if the selected protocol type is correct for the given mouse,
506 enable the mouse pointer in the current virtual console,
510 start the mouse daemon in the foreground mode,
512 .Dl moused -f -p Ar _selected_port_ -t Ar _selected_protocol_
514 and see if the mouse pointer travels correctly
515 according to the mouse movement.
516 Then try cut & paste features by
517 clicking the left, right and middle buttons.
521 As many instances of the mouse daemon as the number of mice attached to
522 the system may be run simultaneously; one
523 instance for each mouse.
524 This is useful if the user wants to use the built-in PS/2 pointing device
525 of a laptop computer while on the road, but wants to use a serial
526 mouse when s/he attaches the system to the docking station in the office.
527 Run two mouse daemons and tell the application program
528 .Pq such as the X Window System
531 then the application program will always see mouse data from either mice.
532 When the serial mouse is not attached, the corresponding mouse daemon
533 will not detect any movement or button state change and the application
534 program will only see mouse data coming from the daemon for the
536 In contrast when both mice are attached and both of them
537 are moved at the same time in this configuration,
538 the mouse pointer will travel across the screen just as if movement of
539 the mice is combined all together.
541 .Bl -tag -width /dev/consolectl -compact
542 .It Pa /dev/consolectl
543 device to control the console
545 bus and InPort mouse driver
549 virtualized mouse driver
554 .It Pa /var/run/moused.pid
555 process id of the currently running
558 .It Pa /var/run/MouseRemote
559 UNIX-domain stream socket for X10 MouseRemote events
563 .Dl moused -p /dev/cuaa0 -i type
567 command determine the protocol type of the mouse at the serial port
569 If successful, the command will print the type, otherwise it will say
572 .Dl moused -p /dev/cuaa0
577 command is able to identify the protocol type of the mouse at the specified
578 port automatically, you can start the daemon without the
580 option and enable the mouse pointer in the text console as above.
582 .Dl moused -p /dev/mouse -t microsoft
585 Start the mouse daemon on the serial port
589 is explicitly specified by the
593 .Dl moused -p /dev/mouse -m 1=3 -m 3=1
595 Assign the physical button 3 (right button) to the logical button 1
596 (logical left) and the physical button 1 (left) to the logical
597 button 3 (logical right).
598 This will effectively swap the left and right buttons.
600 .Dl moused -p /dev/mouse -t intellimouse -z 4
602 Report negative Z axis (roller) movement as the button 4 pressed
603 and positive Z axis movement as the button 5 pressed.
607 command does not currently work with the alternative console driver
610 Many pad devices behave as if the first (left) button were pressed if
611 the user `taps' the surface of the pad.
612 In contrast, some ALPS GlidePoint and Interlink VersaPad models
613 treat the tapping action
614 as fourth button events.
615 Use the option ``-m 1=4'' for these models
616 to obtain the same effect as the other pad devices.
618 Cut and paste functions in the virtual console assume that there
619 are three buttons on the mouse.
620 The logical button 1 (logical left) selects a region of text in the
621 console and copies it to the cut buffer.
622 The logical button 3 (logical right) extends the selected region.
623 The logical button 2 (logical middle) pastes the selected text
624 at the text cursor position.
625 If the mouse has only two buttons, the middle, `paste' button
627 To obtain the paste function, use the
629 option to emulate the middle button, or use the
631 option to assign the physical right button to the logical middle button:
646 command partially supports
647 .Dq Plug and Play External COM Device Specification
648 in order to support PnP serial mice.
649 However, due to various degrees of conformance to the specification by
650 existing serial mice, it does not strictly follow the version 1.0 of the
652 Even with this less strict approach,
653 it may not always determine an appropriate protocol type
654 for the given serial mouse.
659 command was written by
660 .An Michael Smith Aq msmith@FreeBSD.org .
661 This manual page was written by
662 .An Mike Pritchard Aq mpp@FreeBSD.org .
663 The command and manual page have since been updated by
664 .An Kazutaka Yokota Aq yokota@FreeBSD.org .
668 command first appeared in