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