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
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
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
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
73 The mouse daemon listens to the specified port for mouse data,
74 interprets and then passes it via ioctls to the console driver.
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
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
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.
91 If the mouse daemon receives the signal
93 it will reopen the mouse port and reinitialize itself.
95 the mouse is attached/detached while the system is suspended.
97 If the mouse daemon receives the signal
99 it will stop passing mouse events.
102 again will resume passing mouse events.
103 Useful if your typing on a laptop is
104 interrupted by accidentally touching the mouse pad.
106 The following options are available:
107 .Bl -tag -width indent
109 Emulate the third (middle) button for 2-button mice.
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
120 will not be affected.
122 Lower DTR on the serial port.
123 This option is valid only if
125 is selected as the protocol type.
126 The DTR line may need to be dropped for a 3-button mouse
131 When the third button emulation is enabled
137 msec at most before deciding whether two buttons are being pressed
139 The default timeout is 100 msec.
141 Set the report rate (reports/sec) of the device if supported.
144 .Dq Virtual Scrolling
147 option can be used to set the
149 (in pixels) that the mouse must move before a scroll event
151 This effectively controls the scrolling speed.
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.
163 option to set the distance the mouse must move before the scrolling mode is
166 option to set the scrolling speed.
167 This option may be used with or without the
171 Write the process id of the
173 utility in the specified file.
174 Without this option, the process id will be stored in
175 .Pa /var/run/moused.pid .
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
183 utility will not be able to print useful information for the serial mouse.
185 Lower RTS on the serial port.
186 This option is valid only if
188 is selected as the protocol type by the
191 It is often used with the
194 Both RTS and DTR lines may need to be dropped for
195 a 3-button mouse to operate in the
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
203 Use this option if mouse pointer slowly wanders when mouse is not moved.
206 (for example 4) pixels (X+Y) in
208 msec (default 500) are ignored, except during
210 msec (default 4000) since last real mouse movement.
213 .Dq Virtual Scrolling .
214 With this option set, holding the middle mouse
215 button down will cause motion to be interpreted as scrolling.
218 option to set the distance the mouse must move before the scrolling mode is
221 option to set the scrolling speed.
224 .Dq Virtual Scrolling
227 option can be used to set the
229 (in pixels) that the mouse must move before the scrolling
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.
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.
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.
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:
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
276 Specifying only one value sets the acceleration for both axes.
282 options at the same time to have the combined effect
283 of linear and exponential acceleration.
285 Some mice report middle button down events
286 as if the left and right buttons are being pressed.
287 This option handles this.
289 Enable debugging messages.
291 Do not become a daemon and instead run as a foreground process.
292 Useful for testing and debugging.
294 Print specified information and quit.
298 .Bl -tag -compact -width modelxxx
300 Port (device file) name, i.e.\&
305 Interface type: serial, bus, inport or ps/2.
308 It is one of the types listed under the
312 if the driver supports the
314 data format standard.
319 utility may not always be able to identify the model.
321 All of the above items.
322 Print port, interface, type and model in this order
328 utility cannot determine the requested information, it prints
333 Specifies at which level
335 should operate the mouse driver.
340 for more information on this.
342 Assign the physical button
344 to the logical button
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
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
356 to communicate with the mouse.
357 .It Fl r Ar resolution
358 Set the resolution of the device; in Dots Per Inch, or
364 This option may not be supported by all the device.
366 Select a baudrate of 9600 for the serial line.
367 Not all serial mice support this option.
369 Specify the protocol type of the mouse attached to the port.
370 You may explicitly specify a type listed below, or use
374 utility automatically select an appropriate protocol for the given
376 If you entirely omit this option in the command line,
379 Under normal circumstances,
380 you need to use this option only if the
382 utility is not able to detect the protocol automatically
384 .Sx "Configuring Mouse Daemon" ) .
386 Note that if a protocol type is specified with this option, the
388 option above is implied and Plug and Play COM device enumeration
389 procedure will be disabled.
391 Also note that if your mouse is attached to the PS/2 mouse port, you should
396 regardless of the brand and model of the mouse.
398 mouse is attached to the bus mouse port, choose
402 Serial mouse protocols will not work with these mice.
404 For the USB mouse, the protocol must be
406 No other protocol will work with the USB mouse.
408 Valid types for this option are
411 For the serial mouse:
412 .Bl -tag -compact -width mousesystemsxxx
414 Microsoft serial mouse protocol.
415 Most 2-button serial mice use this protocol.
417 Microsoft IntelliMouse protocol.
421 Logitech MouseMan+ and FirstMouse+ use this protocol too.
422 Other mice with a roller/wheel may be compatible with this protocol.
424 MouseSystems 5-byte protocol.
425 3-button mice may use this protocol.
427 MM Series mouse protocol.
429 Logitech mouse protocol.
430 Note that this is for old Logitech models.
434 should be specified for newer models.
436 Logitech MouseMan and TrackMan protocol.
437 Some 3-button mice may be compatible
439 Note that MouseMan+ and FirstMouse+ use
441 protocol rather than this one.
443 ALPS GlidePoint protocol.
445 Kensington ThinkingMouse protocol.
447 Hitachi tablet protocol.
448 .It Ar x10mouseremote
451 Genius Kidspad and Easypad protocol.
453 Interlink VersaPad protocol.
455 GTCO Digipad protocol.
458 For the bus and InPort mouse:
459 .Bl -tag -compact -width mousesystemsxxx
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.
467 .Bl -tag -compact -width mousesystemsxxx
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.
475 is the only protocol type available for the USB mouse
476 and should be specified for any USB mice, regardless of the brand.
478 Make the physical button
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
487 Map Z axis (roller/wheel) movement to another axis or to virtual buttons.
491 .Bl -tag -compact -width x__
494 X or Y axis movement will be reported when the Z axis movement is detected.
496 Report down events for the virtual buttons
500 respectively when negative and positive Z axis movement
502 There do not need to be physical buttons
506 Note that mapping to logical buttons is carried out after mapping
507 from the Z axis movement to the virtual buttons is done.
509 Report down events for the virtual buttons
513 respectively when negative and positive Z axis movement
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.
521 The motion of the second wheel will be mapped to the buttons
523 for the negative direction, and
525 for the positive direction.
530 actually exist in this mouse, their actions will not be detected.
532 Note that horizontal movement or second roller/wheel movement may not
534 because there appears to be no accepted standard as to how it is encoded.
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
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
556 The USB mouse has a flat rectangular connector.
558 The next thing to decide is a port to use for the given interface.
559 The PS/2 mouse is always at
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
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 ,
572 You may want to create a symbolic link
574 pointing to the real port to which the mouse is connected, so that you
575 can easily distinguish which is your
579 The next step is to guess the appropriate protocol type for the mouse.
582 utility may be able to automatically determine the protocol type.
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
594 The command may print
596 if the mouse driver supports this protocol type.
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
610 option yields nothing, you need to specify a protocol type to the
615 You have to make a guess and try.
616 There is rule of thumb:
618 .Bl -enum -compact -width 1.X
620 The bus and InPort mice always use
622 protocol regardless of the brand of the mouse.
626 protocol should always be specified for the PS/2 mouse
627 regardless of the brand of the mouse.
631 protocol for the USB mouse.
633 Most 2-button serial mice support the
637 3-button serial mice may work with the
640 If it does not, it may work with the
643 the third (middle) button will not function.
644 3-button serial mice may also work with the
646 protocol under which the third button may function as expected.
648 3-button serial mice may have a small switch to choose between
669 If the mouse has a roller or a wheel, it may be compatible with the
674 To test if the selected protocol type is correct for the given mouse,
675 enable the mouse pointer in the current virtual console,
677 .Dl "vidcontrol -m on"
679 start the mouse daemon in the foreground mode,
681 .Dl "moused -f -p <selected_port> -t <selected_protocol>"
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.
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
698 .Tn "X\ Window System" )
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
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.
711 .Bl -tag -width /dev/consolectl -compact
712 .It Pa /dev/consolectl
713 device to control the console
717 virtualized mouse driver
722 .It Pa /var/run/moused.pid
723 process id of the currently running
726 .It Pa /var/run/MouseRemote
727 UNIX-domain stream socket for X10 MouseRemote events
730 .Dl "moused -p /dev/cuau0 -i type"
734 utility determine the protocol type of the mouse at the serial port
736 If successful, the command will print the type, otherwise it will say
738 .Bd -literal -offset indent
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
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
754 Start the mouse daemon on the serial port
758 is explicitly specified by the
762 .Dl "moused -p /dev/mouse -m 1=3 -m 3=1"
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.
769 .Dl "moused -p /dev/mouse -t intellimouse -z 4"
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.
776 .Dl "ALL ALL = NOPASSWD: /usr/bin/killall -USR1 moused"
779 .Pa /usr/local/etc/sudoers
782 .Dl "killall -USR1 moused"
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.
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
804 Even with this less strict approach,
805 it may not always determine an appropriate protocol type
806 for the given serial mouse.
810 utility first appeared in
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 .
823 Many pad devices behave as if the first (left) button were pressed if
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.
833 to obtain the same effect as the other pad devices.
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
844 To obtain the paste function, use the
846 option to emulate the middle button, or use the
848 option to assign the physical right button to the logical middle button: