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