]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.sbin/moused/moused.8
bsddialog: import version 1.0
[FreeBSD/FreeBSD.git] / usr.sbin / moused / moused.8
1 .\" Copyright (c) 1996
2 .\"     Mike Pritchard <mpp@FreeBSD.org>.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
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.
18 .\"
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
29 .\" SUCH DAMAGE.
30 .\"
31 .Dd May 15, 2008
32 .Dt MOUSED 8
33 .Os
34 .Sh NAME
35 .Nm moused
36 .Nd pass mouse data to the console driver
37 .Sh SYNOPSIS
38 .Nm
39 .Op Fl DPRacdfs
40 .Op Fl I Ar file
41 .Op Fl F Ar rate
42 .Op Fl r Ar resolution
43 .Op Fl S Ar baudrate
44 .Op Fl VH Op Fl U Ar distance Fl L Ar distance
45 .Op Fl A Ar exp Ns Op , Ns Ar offset
46 .Op Fl a Ar X Ns Op , Ns Ar Y
47 .Op Fl C Ar threshold
48 .Op Fl m Ar N=M
49 .Op Fl w Ar N
50 .Op Fl z Ar target
51 .Op Fl t Ar mousetype
52 .Op Fl l Ar level
53 .Op Fl 3 Op Fl E Ar timeout
54 .Op Fl T Ar distance Ns Op , Ns Ar time Ns Op , Ns Ar after
55 .Fl p Ar port
56 .Pp
57 .Nm
58 .Op Fl Pd
59 .Fl p Ar port
60 .Fl i Ar info
61 .Sh DESCRIPTION
62 The
63 .Nm
64 utility and the console driver work together to support
65 mouse operation in the text console and user programs.
66 They virtualize the mouse and provide user programs with mouse data
67 in the standard format
68 (see
69 .Xr sysmouse 4 ) .
70 .Pp
71 The mouse daemon listens to the specified port for mouse data,
72 interprets and then passes it via ioctls to the console driver.
73 The mouse daemon
74 reports translation movement, button press/release
75 events and movement of the roller or the wheel if available.
76 The roller/wheel movement is reported as
77 .Dq Z
78 axis movement.
79 .Pp
80 The console driver will display the mouse pointer on the screen
81 and provide cut and paste functions if the mouse pointer is enabled
82 in the virtual console via
83 .Xr vidcontrol 1 .
84 If
85 .Xr sysmouse 4
86 is opened by the user program, the console driver also passes the mouse
87 data to the device so that the user program will see it.
88 .Pp
89 If the mouse daemon receives the signal
90 .Dv SIGHUP ,
91 it will reopen the mouse port and reinitialize itself.
92 Useful if
93 the mouse is attached/detached while the system is suspended.
94 .Pp
95 If the mouse daemon receives the signal
96 .Dv SIGUSR1 ,
97 it will stop passing mouse events.
98 Sending the signal
99 .Dv SIGUSR1
100 again will resume passing mouse events.
101 Useful if your typing on a laptop is
102 interrupted by accidentally touching the mouse pad.
103 .Pp
104 The following options are available:
105 .Bl -tag -width indent
106 .It Fl 3
107 Emulate the third (middle) button for 2-button mice.
108 It is emulated
109 by pressing the left and right physical buttons simultaneously.
110 .It Fl C Ar threshold
111 Set double click speed as the maximum interval in msec between button clicks.
112 Without this option, the default value of 500 msec will be assumed.
113 This option will have effect only on the cut and paste operations
114 in the text mode console.
115 The user program which is reading mouse data
116 via
117 .Xr sysmouse 4
118 will not be affected.
119 .It Fl D
120 Lower DTR on the serial port.
121 This option is valid only if
122 .Ar mousesystems
123 is selected as the protocol type.
124 The DTR line may need to be dropped for a 3-button mouse
125 to operate in the
126 .Ar mousesystems
127 mode.
128 .It Fl E Ar timeout
129 When the third button emulation is enabled
130 (see above),
131 the
132 .Nm
133 utility waits
134 .Ar timeout
135 msec at most before deciding whether two buttons are being pressed
136 simultaneously.
137 The default timeout is 100 msec.
138 .It Fl F Ar rate
139 Set the report rate (reports/sec) of the device if supported.
140 .It Fl L Ar distance
141 When
142 .Dq Virtual Scrolling
143 is enabled, the
144 .Fl L
145 option can be used to set the
146 .Ar distance
147 (in pixels) that the mouse must move before a scroll event
148 is generated.
149 This effectively controls the scrolling speed.
150 The default
151 .Ar distance
152 is 2 pixels.
153 .It Fl H
154 Enable
155 .Dq Horizontal Virtual Scrolling .
156 With this option set, holding the middle mouse
157 button down will cause motion to be interpreted as
158 horizontal scrolling.
159 Use the
160 .Fl U
161 option to set the distance the mouse must move before the scrolling mode is
162 activated and the
163 .Fl L
164 option to set the scrolling speed.
165 This option may be used with or without the
166 .Fl V
167 option.
168 .It Fl I Ar file
169 Write the process id of the
170 .Nm
171 utility in the specified file.
172 Without this option, the process id will be stored in
173 .Pa /var/run/moused.pid .
174 .It Fl P
175 Do not start the Plug and Play COM device enumeration procedure
176 when identifying the serial mouse.
177 If this option is given together with the
178 .Fl i
179 option, the
180 .Nm
181 utility will not be able to print useful information for the serial mouse.
182 .It Fl R
183 Lower RTS on the serial port.
184 This option is valid only if
185 .Ar mousesystems
186 is selected as the protocol type by the
187 .Fl t
188 option below.
189 It is often used with the
190 .Fl D
191 option above.
192 Both RTS and DTR lines may need to be dropped for
193 a 3-button mouse to operate in the
194 .Ar mousesystems
195 mode.
196 .It Fl S Ar baudrate
197 Select the baudrate for the serial port (1200 to 9600).
198 Not all serial mice support this option.
199 .It Fl T Ar distance Ns Op , Ns Ar time Ns Op , Ns Ar after
200 Terminate drift.
201 Use this option if mouse pointer slowly wanders when mouse is not moved.
202 Movements up to
203 .Ar distance
204 (for example 4) pixels (X+Y) in
205 .Ar time
206 msec (default 500) are ignored, except during
207 .Ar after
208 msec (default 4000) since last real mouse movement.
209 .It Fl V
210 Enable
211 .Dq Virtual Scrolling .
212 With this option set, holding the middle mouse
213 button down will cause motion to be interpreted as scrolling.
214 Use the
215 .Fl U
216 option to set the distance the mouse must move before the scrolling mode is
217 activated and the
218 .Fl L
219 option to set the scrolling speed.
220 .It Fl U Ar distance
221 When
222 .Dq Virtual Scrolling
223 is enabled, the
224 .Fl U
225 option can be used to set the
226 .Ar distance
227 (in pixels) that the mouse must move before the scrolling
228 mode is activated.
229 The default
230 .Ar distance
231 is 3 pixels.
232 .It Fl A Ar exp Ns Op , Ns Ar offset
233 Apply exponential (dynamic) acceleration to mouse movements:
234 the faster you move the mouse, the more it will be accelerated.
235 That means that small mouse movements are not accelerated,
236 so they are still very accurate, while a faster movement will
237 drive the pointer quickly across the screen.
238 .Pp
239 The
240 .Ar exp
241 value specifies the exponent, which is basically
242 the amount of acceleration.
243 Useful values are in the range 1.1 to 2.0, but it depends on
244 your mouse hardware and your personal preference.
245 A value of 1.0 means no exponential acceleration.
246 A value of 2.0 means squared acceleration (i.e. if
247 you move the mouse twice as fast, the pointer will move
248 four times as fast on the screen).
249 Values beyond 2.0 are possible but not recommended.
250 A good value to start is probably 1.5.
251 .Pp
252 The optional
253 .Ar offset
254 value specifies the distance at which the acceleration begins.
255 The default is 1.0, which means that the acceleration is applied
256 to movements larger than one unit.
257 If you specify a larger value, it takes more speed for
258 the acceleration to kick in, i.e. the speed range for
259 small and accurate movements is wider.
260 Usually the default should be sufficient, but if you're
261 not satisfied with the behaviour, try a value of 2.0.
262 .Pp
263 Note that the
264 .Fl A
265 option interacts badly with the X server's own acceleration,
266 which doesn't work very well anyway.
267 Therefore it is recommended to switch it off if necessary:
268 .Dq xset m 1 .
269 .It Fl a Ar X Ns Op , Ns Ar Y
270 Accelerate or decelerate the mouse input.
271 This is a linear acceleration only.
272 Values less than 1.0 slow down movement, values greater than 1.0 speed it
273 up.
274 Specifying only one value sets the acceleration for both axes.
275 .Pp
276 You can use the
277 .Fl a
278 and
279 .Fl A
280 options at the same time to have the combined effect
281 of linear and exponential acceleration.
282 .It Fl c
283 Some mice report middle button down events
284 as if the left and right buttons are being pressed.
285 This option handles this.
286 .It Fl d
287 Enable debugging messages.
288 .It Fl f
289 Do not become a daemon and instead run as a foreground process.
290 Useful for testing and debugging.
291 .It Fl i Ar info
292 Print specified information and quit.
293 Available pieces of
294 information are:
295 .Pp
296 .Bl -tag -compact -width modelxxx
297 .It Ar port
298 Port (device file) name, i.e.\&
299 .Pa /dev/cuau0 ,
300 and
301 .Pa /dev/psm0 .
302 .It Ar if
303 Interface type: serial, bus, inport or ps/2.
304 .It Ar type
305 Protocol type.
306 It is one of the types listed under the
307 .Fl t
308 option below or
309 .Ar sysmouse
310 if the driver supports the
311 .Ar sysmouse
312 data format standard.
313 .It Ar model
314 Mouse model.
315 The
316 .Nm
317 utility may not always be able to identify the model.
318 .It Ar all
319 All of the above items.
320 Print port, interface, type and model in this order
321 in one line.
322 .El
323 .Pp
324 If the
325 .Nm
326 utility cannot determine the requested information, it prints
327 .Dq Li unknown
328 or
329 .Dq Li generic .
330 .It Fl l Ar level
331 Specifies at which level
332 .Nm
333 should operate the mouse driver.
334 Refer to
335 .Sx Operation Levels
336 in
337 .Xr psm 4
338 for more information on this.
339 .It Fl m Ar N=M
340 Assign the physical button
341 .Ar M
342 to the logical button
343 .Ar N .
344 You may specify as many instances of this option as you like.
345 More than one physical button may be assigned to a logical button at the
346 same time.
347 In this case the logical button will be down,
348 if either of the assigned physical buttons is held down.
349 Do not put space around
350 .Ql = .
351 .It Fl p Ar port
352 Use
353 .Ar port
354 to communicate with the mouse.
355 .It Fl r Ar resolution
356 Set the resolution of the device; in Dots Per Inch, or
357 .Ar low ,
358 .Ar medium-low ,
359 .Ar medium-high
360 or
361 .Ar high .
362 This option may not be supported by all the device.
363 .It Fl s
364 Select a baudrate of 9600 for the serial line.
365 Not all serial mice support this option.
366 .It Fl t Ar type
367 Specify the protocol type of the mouse attached to the port.
368 You may explicitly specify a type listed below, or use
369 .Ar auto
370 to let the
371 .Nm
372 utility automatically select an appropriate protocol for the given
373 mouse.
374 If you entirely omit this option in the command line,
375 .Fl t Ar auto
376 is assumed.
377 Under normal circumstances,
378 you need to use this option only if the
379 .Nm
380 utility is not able to detect the protocol automatically
381 (see
382 .Sx "Configuring Mouse Daemon" ) .
383 .Pp
384 Note that if a protocol type is specified with this option, the
385 .Fl P
386 option above is implied and Plug and Play COM device enumeration
387 procedure will be disabled.
388 .Pp
389 Also note that if your mouse is attached to the PS/2 mouse port, you should
390 always choose
391 .Ar auto
392 or
393 .Ar ps/2 ,
394 regardless of the brand and model of the mouse.
395 Likewise, if your
396 mouse is attached to the bus mouse port, choose
397 .Ar auto
398 or
399 .Ar busmouse .
400 Serial mouse protocols will not work with these mice.
401 .Pp
402 For the USB mouse, the protocol must be
403 .Ar auto .
404 No other protocol will work with the USB mouse.
405 .Pp
406 Valid types for this option are
407 listed below.
408 .Pp
409 For the serial mouse:
410 .Bl -tag -compact -width mousesystemsxxx
411 .It Ar microsoft
412 Microsoft serial mouse protocol.
413 Most 2-button serial mice use this protocol.
414 .It Ar intellimouse
415 Microsoft IntelliMouse protocol.
416 Genius NetMouse,
417 .Tn ASCII
418 Mie Mouse,
419 Logitech MouseMan+ and FirstMouse+ use this protocol too.
420 Other mice with a roller/wheel may be compatible with this protocol.
421 .It Ar mousesystems
422 MouseSystems 5-byte protocol.
423 3-button mice may use this protocol.
424 .It Ar mmseries
425 MM Series mouse protocol.
426 .It Ar logitech
427 Logitech mouse protocol.
428 Note that this is for old Logitech models.
429 .Ar mouseman
430 or
431 .Ar intellimouse
432 should be specified for newer models.
433 .It Ar mouseman
434 Logitech MouseMan and TrackMan protocol.
435 Some 3-button mice may be compatible
436 with this protocol.
437 Note that MouseMan+ and FirstMouse+ use
438 .Ar intellimouse
439 protocol rather than this one.
440 .It Ar glidepoint
441 ALPS GlidePoint protocol.
442 .It Ar thinkingmouse
443 Kensington ThinkingMouse protocol.
444 .It Ar mmhitab
445 Hitachi tablet protocol.
446 .It Ar x10mouseremote
447 X10 MouseRemote.
448 .It Ar kidspad
449 Genius Kidspad and Easypad protocol.
450 .It Ar versapad
451 Interlink VersaPad protocol.
452 .It Ar gtco_digipad
453 GTCO Digipad protocol.
454 .El
455 .Pp
456 For the bus and InPort mouse:
457 .Bl -tag -compact -width mousesystemsxxx
458 .It Ar busmouse
459 This is the only protocol type available for
460 the bus and InPort mouse and should be specified for any bus mice
461 and InPort mice, regardless of the brand.
462 .El
463 .Pp
464 For the PS/2 mouse:
465 .Bl -tag -compact -width mousesystemsxxx
466 .It Ar ps/2
467 This is the only protocol type available for the PS/2 mouse
468 and should be specified for any PS/2 mice, regardless of the brand.
469 .El
470 .Pp
471 For the USB mouse,
472 .Ar auto
473 is the only protocol type available for the USB mouse
474 and should be specified for any USB mice, regardless of the brand.
475 .It Fl w Ar N
476 Make the physical button
477 .Ar N
478 act as the wheel mode button.
479 While this button is pressed, X and Y axis movement is reported to be zero
480 and the Y axis movement is mapped to Z axis.
481 You may further map the Z axis movement to virtual buttons by the
482 .Fl z
483 option below.
484 .It Fl z Ar target
485 Map Z axis (roller/wheel) movement to another axis or to virtual buttons.
486 Valid
487 .Ar target
488 maybe:
489 .Bl -tag -compact -width x__
490 .It Ar x
491 .It Ar y
492 X or Y axis movement will be reported when the Z axis movement is detected.
493 .It Ar N
494 Report down events for the virtual buttons
495 .Ar N
496 and
497 .Ar N+1
498 respectively when negative and positive Z axis movement
499 is detected.
500 There do not need to be physical buttons
501 .Ar N
502 and
503 .Ar N+1 .
504 Note that mapping to logical buttons is carried out after mapping
505 from the Z axis movement to the virtual buttons is done.
506 .It Ar N1 N2
507 Report down events for the virtual buttons
508 .Ar N1
509 and
510 .Ar N2
511 respectively when negative and positive Z axis movement
512 is detected.
513 .It Ar N1 N2 N3 N4
514 This is useful for the mouse with two wheels of which
515 the second wheel is used to generate horizontal scroll action,
516 and for the mouse which has a knob or a stick which can detect
517 the horizontal force applied by the user.
518 .Pp
519 The motion of the second wheel will be mapped to the buttons
520 .Ar N3 ,
521 for the negative direction, and
522 .Ar N4 ,
523 for the positive direction.
524 If the buttons
525 .Ar N3
526 and
527 .Ar N4
528 actually exist in this mouse, their actions will not be detected.
529 .Pp
530 Note that horizontal movement or second roller/wheel movement may not
531 always be detected,
532 because there appears to be no accepted standard as to how it is encoded.
533 .Pp
534 Note also that some mice think left is the negative horizontal direction;
535 others may think otherwise.
536 Moreover, there are some mice whose two wheels are both mounted vertically,
537 and the direction of the second vertical wheel does not match the
538 first one.
539 .El
540 .El
541 .Ss Configuring Mouse Daemon
542 The first thing you need to know is the interface type
543 of the mouse you are going to use.
544 It can be determined by looking at the connector of the mouse.
545 The serial mouse has a D-Sub female 9- or 25-pin connector.
546 The bus and InPort mice have either a D-Sub male 9-pin connector
547 or a round DIN 9-pin connector.
548 The PS/2 mouse is equipped with a small, round DIN 6-pin connector.
549 Some mice come with adapters with which the connector can
550 be converted to another.
551 If you are to use such an adapter,
552 remember the connector at the very end of the mouse/adapter pair is
553 what matters.
554 The USB mouse has a flat rectangular connector.
555 .Pp
556 The next thing to decide is a port to use for the given interface.
557 The PS/2 mouse is always at
558 .Pa /dev/psm0 .
559 There may be more than one serial port to which the serial
560 mouse can be attached.
561 Many people often assign the first, built-in
562 serial port
563 .Pa /dev/cuau0
564 to the mouse.
565 You can attach multiple USB mice to your system or to your USB hub.
566 They are accessible as
567 .Pa /dev/ums0 , /dev/ums1 ,
568 and so on.
569 .Pp
570 You may want to create a symbolic link
571 .Pa /dev/mouse
572 pointing to the real port to which the mouse is connected, so that you
573 can easily distinguish which is your
574 .Dq mouse
575 port later.
576 .Pp
577 The next step is to guess the appropriate protocol type for the mouse.
578 The
579 .Nm
580 utility may be able to automatically determine the protocol type.
581 Run the
582 .Nm
583 utility with the
584 .Fl i
585 option and see what it says.
586 If the command can identify
587 the protocol type, no further investigation is necessary on your part.
588 You may start the daemon without explicitly specifying a protocol type
589 (see
590 .Sx EXAMPLES ) .
591 .Pp
592 The command may print
593 .Ar sysmouse
594 if the mouse driver supports this protocol type.
595 .Pp
596 Note that the
597 .Dv type
598 and
599 .Dv model
600 printed by the
601 .Fl i
602 option do not necessarily match the product name of the pointing device
603 in question, but they may give the name of the device with which it is
604 compatible.
605 .Pp
606 If the
607 .Fl i
608 option yields nothing, you need to specify a protocol type to the
609 .Nm
610 utility by the
611 .Fl t
612 option.
613 You have to make a guess and try.
614 There is rule of thumb:
615 .Pp
616 .Bl -enum -compact -width 1.X
617 .It
618 The bus and InPort mice always use
619 .Ar busmouse
620 protocol regardless of the brand of the mouse.
621 .It
622 The
623 .Ar ps/2
624 protocol should always be specified for the PS/2 mouse
625 regardless of the brand of the mouse.
626 .It
627 You must specify the
628 .Ar auto
629 protocol for the USB mouse.
630 .It
631 Most 2-button serial mice support the
632 .Ar microsoft
633 protocol.
634 .It
635 3-button serial mice may work with the
636 .Ar mousesystems
637 protocol.
638 If it does not, it may work with the
639 .Ar microsoft
640 protocol although
641 the third (middle) button will not function.
642 3-button serial mice may also work with the
643 .Ar mouseman
644 protocol under which the third button may function as expected.
645 .It
646 3-button serial mice may have a small switch to choose between
647 .Dq MS
648 and
649 .Dq PC ,
650 or
651 .Dq 2
652 and
653 .Dq 3 .
654 .Dq MS
655 or
656 .Dq 2
657 usually mean the
658 .Ar microsoft
659 protocol.
660 .Dq PC
661 or
662 .Dq 3
663 will choose the
664 .Ar mousesystems
665 protocol.
666 .It
667 If the mouse has a roller or a wheel, it may be compatible with the
668 .Ar intellimouse
669 protocol.
670 .El
671 .Pp
672 To test if the selected protocol type is correct for the given mouse,
673 enable the mouse pointer in the current virtual console,
674 .Pp
675 .Dl "vidcontrol -m on"
676 .Pp
677 start the mouse daemon in the foreground mode,
678 .Pp
679 .Dl "moused -f -p <selected_port> -t <selected_protocol>"
680 .Pp
681 and see if the mouse pointer travels correctly
682 according to the mouse movement.
683 Then try cut & paste features by
684 clicking the left, right and middle buttons.
685 Type ^C to stop
686 the command.
687 .Ss Multiple Mice
688 As many instances of the mouse daemon as the number of mice attached to
689 the system may be run simultaneously; one
690 instance for each mouse.
691 This is useful if the user wants to use the built-in PS/2 pointing device
692 of a laptop computer while on the road, but wants to use a serial
693 mouse when s/he attaches the system to the docking station in the office.
694 Run two mouse daemons and tell the application program
695 (such as the
696 .Tn "X\ Window System" )
697 to use
698 .Xr sysmouse 4 ,
699 then the application program will always see mouse data from either mouse.
700 When the serial mouse is not attached, the corresponding mouse daemon
701 will not detect any movement or button state change and the application
702 program will only see mouse data coming from the daemon for the
703 PS/2 mouse.
704 In contrast when both mice are attached and both of them
705 are moved at the same time in this configuration,
706 the mouse pointer will travel across the screen just as if movement of
707 the mice is combined all together.
708 .Sh FILES
709 .Bl -tag -width /dev/consolectl -compact
710 .It Pa /dev/consolectl
711 device to control the console
712 .It Pa /dev/psm%d
713 PS/2 mouse driver
714 .It Pa /dev/sysmouse
715 virtualized mouse driver
716 .It Pa /dev/ttyv%d
717 virtual consoles
718 .It Pa /dev/ums%d
719 USB mouse driver
720 .It Pa /var/run/moused.pid
721 process id of the currently running
722 .Nm
723 utility
724 .It Pa /var/run/MouseRemote
725 UNIX-domain stream socket for X10 MouseRemote events
726 .El
727 .Sh EXAMPLES
728 .Dl "moused -p /dev/cuau0 -i type"
729 .Pp
730 Let the
731 .Nm
732 utility determine the protocol type of the mouse at the serial port
733 .Pa /dev/cuau0 .
734 If successful, the command will print the type, otherwise it will say
735 .Dq Li unknown .
736 .Bd -literal -offset indent
737 moused -p /dev/cuau0
738 vidcontrol -m on
739 .Ed
740 .Pp
741 If the
742 .Nm
743 utility is able to identify the protocol type of the mouse at the specified
744 port automatically, you can start the daemon without the
745 .Fl t
746 option and enable the mouse pointer in the text console as above.
747 .Bd -literal -offset indent
748 moused -p /dev/mouse -t microsoft
749 vidcontrol -m on
750 .Ed
751 .Pp
752 Start the mouse daemon on the serial port
753 .Pa /dev/mouse .
754 The protocol type
755 .Ar microsoft
756 is explicitly specified by the
757 .Fl t
758 option.
759 .Pp
760 .Dl "moused -p /dev/mouse -m 1=3 -m 3=1"
761 .Pp
762 Assign the physical button 3 (right button) to the logical button 1
763 (logical left) and the physical button 1 (left) to the logical
764 button 3 (logical right).
765 This will effectively swap the left and right buttons.
766 .Pp
767 .Dl "moused -p /dev/mouse -t intellimouse -z 4"
768 .Pp
769 Report negative Z axis movement (i.e., mouse wheel) as the button 4 pressed
770 and positive Z axis movement (i.e., mouse wheel) as the button 5 pressed.
771 .Pp
772 If you add
773 .Pp
774 .Dl "ALL ALL = NOPASSWD: /usr/bin/killall -USR1 moused"
775 .Pp
776 to your
777 .Pa /usr/local/etc/sudoers
778 file, and bind
779 .Pp
780 .Dl "killall -USR1 moused"
781 .Pp
782 to a key in your window manager, you can suspend mouse events on your laptop if
783 you keep brushing over the mouse pad while typing.
784 .Sh SEE ALSO
785 .Xr kill 1 ,
786 .Xr vidcontrol 1 ,
787 .Xr xset 1 ,
788 .Xr keyboard 4 ,
789 .Xr psm 4 ,
790 .Xr screen 4 ,
791 .Xr sysmouse 4 ,
792 .Xr ums 4
793 .Sh STANDARDS
794 The
795 .Nm
796 utility partially supports
797 .Dq Plug and Play External COM Device Specification
798 in order to support PnP serial mice.
799 However, due to various degrees of conformance to the specification by
800 existing serial mice, it does not strictly follow the version 1.0 of the
801 standard.
802 Even with this less strict approach,
803 it may not always determine an appropriate protocol type
804 for the given serial mouse.
805 .Sh HISTORY
806 The
807 .Nm
808 utility first appeared in
809 .Fx 2.2 .
810 .Sh AUTHORS
811 .An -nosplit
812 The
813 .Nm
814 utility was written by
815 .An Michael Smith Aq Mt msmith@FreeBSD.org .
816 This manual page was written by
817 .An Mike Pritchard Aq Mt mpp@FreeBSD.org .
818 The command and manual page have since been updated by
819 .An Kazutaka Yokota Aq Mt yokota@FreeBSD.org .
820 .Sh CAVEATS
821 Many pad devices behave as if the first (left) button were pressed if
822 the user
823 .Dq taps
824 the surface of the pad.
825 In contrast, some ALPS GlidePoint and Interlink VersaPad models
826 treat the tapping action
827 as fourth button events.
828 Use the option
829 .Dq Fl m Li 1=4
830 for these models
831 to obtain the same effect as the other pad devices.
832 .Pp
833 Cut and paste functions in the virtual console assume that there
834 are three buttons on the mouse.
835 The logical button 1 (logical left) selects a region of text in the
836 console and copies it to the cut buffer.
837 The logical button 3 (logical right) extends the selected region.
838 The logical button 2 (logical middle) pastes the selected text
839 at the text cursor position.
840 If the mouse has only two buttons, the middle, `paste' button
841 is not available.
842 To obtain the paste function, use the
843 .Fl 3
844 option to emulate the middle button, or use the
845 .Fl m
846 option to assign the physical right button to the logical middle button:
847 .Dq Fl m Li 2=3 .