xref: /freebsd/usr.sbin/moused/msconvd/msconvd.8 (revision aef807876c305587c60f73e2cd914115d22a53fd)
1.\"-
2.\" SPDX-License-Identifier: BSD-4-Clause
3.\"
4.\" Copyright (c) 1996
5.\"	Mike Pritchard <mpp@FreeBSD.org>.  All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\" 3. All advertising materials mentioning features or use of this software
16.\"    must display the following acknowledgement:
17.\"	This product includes software developed by Mike Pritchard.
18.\" 4. Neither the name of the author nor the names of its contributors
19.\"    may be used to endorse or promote products derived from this software
20.\"    without specific prior written permission.
21.\"
22.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32.\" SUCH DAMAGE.
33.\"
34.Dd May 18, 2025
35.Dt MSCONVD 8
36.Os
37.Sh NAME
38.Nm msconvd
39.Nd mouse protocol conversion daemon
40.Sh SYNOPSIS
41.Nm
42.Op Fl DPRcdfs
43.Op Fl I Ar file
44.Op Fl F Ar rate
45.Op Fl r Ar resolution
46.Op Fl S Ar baudrate
47.Op Fl t Ar mousetype
48.Op Fl l Ar level
49.Fl p Ar port
50.Pp
51.Nm
52.Op Fl Pd
53.Fl p Ar port
54.Fl i Ar info
55.Sh DESCRIPTION
56The
57.Nm
58utility and the
59.Xr moused 8
60driver work together to support legacy devices like COM,
61.Xr ams 4
62mices and X10 remotes as well.
63.Xr psm 4 ,
64.Xr ums 4
65and some other devices are supported too but not recomended to use with
66.Nm
67unless kernel is compiled without
68.Dq option EVDEV_SUPPORT .
69The
70.Nm
71listens to the specified port for mouse data, decodes and then passes
72it via input event device a.k.a evdev to consumer aplications like
73.Xr moused 8
74or
75.Xr libinput 1 .
76It does not display the mouse pointer on the screen or provide cut and
77paste functions.
78The msconv daemon converts translation movement, button press/release
79events and movement of the roller or the wheel if available.
80.Pp
81.Pp
82If the
83.Nm
84receives the signal
85.Dv SIGHUP ,
86it will reopen the mouse port and reinitialize itself.
87Useful if
88the mouse is attached/detached while the system is suspended.
89.Pp
90If the
91.Nm
92receives the signal
93.Dv SIGUSR1 ,
94it will stop passing mouse events.
95Sending the signal
96.Dv SIGUSR1
97again will resume passing mouse events.
98Useful if your typing on a laptop is
99interrupted by accidentally touching the mouse pad.
100.Pp
101The following options are available:
102.Bl -tag -width indent
103.It Fl D
104Lower DTR on the serial port.
105This option is valid only if
106.Ar mousesystems
107is selected as the protocol type.
108The DTR line may need to be dropped for a 3-button mouse
109to operate in the
110.Ar mousesystems
111mode.
112.It Fl F Ar rate
113Set the report rate (reports/sec) of the device if supported.
114.It Fl I Ar file
115Write the process id of the
116.Nm
117utility in the specified file.
118Without this option, the process id will be stored in
119.Pa /var/run/moused.pid .
120.It Fl P
121Do not start the Plug and Play COM device enumeration procedure
122when identifying the serial mouse.
123If this option is given together with the
124.Fl i
125option, the
126.Nm
127utility will not be able to print useful information for the serial mouse.
128.It Fl R
129Lower RTS on the serial port.
130This option is valid only if
131.Ar mousesystems
132is selected as the protocol type by the
133.Fl t
134option below.
135It is often used with the
136.Fl D
137option above.
138Both RTS and DTR lines may need to be dropped for
139a 3-button mouse to operate in the
140.Ar mousesystems
141mode.
142.It Fl S Ar baudrate
143Select the baudrate for the serial port (1200 to 9600).
144Not all serial mice support this option.
145.It Fl c
146Some mice report middle button down events
147as if the left and right buttons are being pressed.
148This option handles this.
149.It Fl d
150Enable debugging messages.
151.It Fl f
152Do not become a daemon and instead run as a foreground process.
153Useful for testing and debugging.
154.It Fl i Ar info
155Print specified information and quit.
156Available pieces of
157information are:
158.Pp
159.Bl -tag -compact -width modelxxx
160.It Ar port
161Port (device file) name, i.e.\&
162.Pa /dev/cuau0 ,
163and
164.Pa /dev/psm0 .
165.It Ar if
166Interface type: serial, bus, inport or ps/2.
167.It Ar type
168Protocol type.
169It is one of the types listed under the
170.Fl t
171option below or
172.Ar sysmouse
173if the driver supports the
174.Ar sysmouse
175data format standard.
176.It Ar model
177Mouse model.
178The
179.Nm
180utility may not always be able to identify the model.
181.It Ar all
182All of the above items.
183Print port, interface, type and model in this order
184in one line.
185.El
186.Pp
187If the
188.Nm
189utility cannot determine the requested information, it prints
190.Dq Li unknown
191or
192.Dq Li generic .
193.It Fl l Ar level
194Specifies at which level
195.Nm
196should operate the mouse driver.
197Refer to
198.Sx Operation Levels
199in
200.Xr psm 4
201for more information on this.
202.It Fl p Ar port
203Use
204.Ar port
205to communicate with the mouse.
206.It Fl r Ar resolution
207Set the resolution of the device; in Dots Per Inch, or
208.Ar low ,
209.Ar medium-low ,
210.Ar medium-high
211or
212.Ar high .
213This option may not be supported by all the device.
214.It Fl s
215Select a baudrate of 9600 for the serial line.
216Not all serial mice support this option.
217.It Fl t Ar type
218Specify the protocol type of the mouse attached to the port.
219You may explicitly specify a type listed below, or use
220.Ar auto
221to let the
222.Nm
223utility automatically select an appropriate protocol for the given
224mouse.
225If you entirely omit this option in the command line,
226.Fl t Ar auto
227is assumed.
228Under normal circumstances,
229you need to use this option only if the
230.Nm
231utility is not able to detect the protocol automatically
232(see
233.Sx "Configuring Mouse Protocol Conversion Daemon" ) .
234.Pp
235Note that if a protocol type is specified with this option, the
236.Fl P
237option above is implied and Plug and Play COM device enumeration
238procedure will be disabled.
239.Pp
240Also note that if your mouse is attached to the PS/2 mouse port, you should
241always choose
242.Ar auto
243or
244.Ar ps/2 ,
245regardless of the brand and model of the mouse.
246Likewise, if your
247mouse is attached to the bus mouse port, choose
248.Ar auto
249or
250.Ar busmouse .
251Serial mouse protocols will not work with these mice.
252.Pp
253For the USB mouse, the protocol must be
254.Ar auto .
255No other protocol will work with the USB mouse.
256.Pp
257Valid types for this option are
258listed below.
259.Pp
260For the serial mouse:
261.Bl -tag -compact -width mousesystemsxxx
262.It Ar microsoft
263Microsoft serial mouse protocol.
264Most 2-button serial mice use this protocol.
265.It Ar intellimouse
266Microsoft IntelliMouse protocol.
267Genius NetMouse,
268.Tn ASCII
269Mie Mouse,
270Logitech MouseMan+ and FirstMouse+ use this protocol too.
271Other mice with a roller/wheel may be compatible with this protocol.
272.It Ar mousesystems
273MouseSystems 5-byte protocol.
2743-button mice may use this protocol.
275.It Ar mmseries
276MM Series mouse protocol.
277.It Ar logitech
278Logitech mouse protocol.
279Note that this is for old Logitech models.
280.Ar mouseman
281or
282.Ar intellimouse
283should be specified for newer models.
284.It Ar mouseman
285Logitech MouseMan and TrackMan protocol.
286Some 3-button mice may be compatible
287with this protocol.
288Note that MouseMan+ and FirstMouse+ use
289.Ar intellimouse
290protocol rather than this one.
291.It Ar glidepoint
292ALPS GlidePoint protocol.
293.It Ar thinkingmouse
294Kensington ThinkingMouse protocol.
295.It Ar mmhitab
296Hitachi tablet protocol.
297.It Ar x10mouseremote
298X10 MouseRemote.
299.It Ar kidspad
300Genius Kidspad and Easypad protocol.
301.It Ar versapad
302Interlink VersaPad protocol.
303.It Ar gtco_digipad
304GTCO Digipad protocol.
305.El
306.Pp
307For the bus and InPort mouse:
308.Bl -tag -compact -width mousesystemsxxx
309.It Ar busmouse
310This is the only protocol type available for
311the bus and InPort mouse and should be specified for any bus mice
312and InPort mice, regardless of the brand.
313.El
314.Pp
315For the PS/2 mouse:
316.Bl -tag -compact -width mousesystemsxxx
317.It Ar ps/2
318This is the only protocol type available for the PS/2 mouse
319and should be specified for any PS/2 mice, regardless of the brand.
320.El
321.Pp
322For the USB mouse,
323.Ar auto
324is the only protocol type available for the USB mouse
325and should be specified for any USB mice, regardless of the brand.
326.El
327.El
328.Ss Configuring Mouse Protocol Conversion Daemon
329The first thing you need to know is the interface type
330of the mouse you are going to use.
331It can be determined by looking at the connector of the mouse.
332The serial mouse has a D-Sub female 9- or 25-pin connector.
333The bus and InPort mice have either a D-Sub male 9-pin connector
334or a round DIN 9-pin connector.
335The PS/2 mouse is equipped with a small, round DIN 6-pin connector.
336Some mice come with adapters with which the connector can
337be converted to another.
338If you are to use such an adapter,
339remember the connector at the very end of the mouse/adapter pair is
340what matters.
341The USB mouse has a flat rectangular connector.
342.Pp
343The next thing to decide is a port to use for the given interface.
344The PS/2 mouse is always at
345.Pa /dev/psm0 .
346There may be more than one serial port to which the serial
347mouse can be attached.
348Many people often assign the first, built-in
349serial port
350.Pa /dev/cuau0
351to the mouse.
352You can attach multiple USB mice to your system or to your USB hub.
353They are accessible as
354.Pa /dev/ums0 , /dev/ums1 ,
355and so on.
356.Pp
357You may want to create a symbolic link
358.Pa /dev/mouse
359pointing to the real port to which the mouse is connected, so that you
360can easily distinguish which is your
361.Dq mouse
362port later.
363.Pp
364The next step is to guess the appropriate protocol type for the mouse.
365The
366.Nm
367utility may be able to automatically determine the protocol type.
368Run the
369.Nm
370utility with the
371.Fl i
372option and see what it says.
373If the command can identify
374the protocol type, no further investigation is necessary on your part.
375You may start the daemon without explicitly specifying a protocol type
376(see
377.Sx EXAMPLES ) .
378.Pp
379The command may print
380.Ar sysmouse
381if the mouse driver supports this protocol type.
382.Pp
383Note that the
384.Dv type
385and
386.Dv model
387printed by the
388.Fl i
389option do not necessarily match the product name of the pointing device
390in question, but they may give the name of the device with which it is
391compatible.
392.Pp
393If the
394.Fl i
395option yields nothing, you need to specify a protocol type to the
396.Nm
397utility by the
398.Fl t
399option.
400You have to make a guess and try.
401There is rule of thumb:
402.Pp
403.Bl -enum -compact -width 1.X
404.It
405The bus and InPort mice always use
406.Ar busmouse
407protocol regardless of the brand of the mouse.
408.It
409The
410.Ar ps/2
411protocol should always be specified for the PS/2 mouse
412regardless of the brand of the mouse.
413.It
414You must specify the
415.Ar auto
416protocol for the USB mouse.
417.It
418Most 2-button serial mice support the
419.Ar microsoft
420protocol.
421.It
4223-button serial mice may work with the
423.Ar mousesystems
424protocol.
425If it does not, it may work with the
426.Ar microsoft
427protocol although
428the third (middle) button will not function.
4293-button serial mice may also work with the
430.Ar mouseman
431protocol under which the third button may function as expected.
432.It
4333-button serial mice may have a small switch to choose between
434.Dq MS
435and
436.Dq PC ,
437or
438.Dq 2
439and
440.Dq 3 .
441.Dq MS
442or
443.Dq 2
444usually mean the
445.Ar microsoft
446protocol.
447.Dq PC
448or
449.Dq 3
450will choose the
451.Ar mousesystems
452protocol.
453.It
454If the mouse has a roller or a wheel, it may be compatible with the
455.Ar intellimouse
456protocol.
457.El
458.Pp
459To test if the selected protocol type is correct for the given mouse,
460ensure the
461.Xr moused 8
462is running in auto port mode,
463.Pp
464.Dl "moused -p auto"
465.Pp
466start the
467.Nm
468in the foreground mode,
469.Pp
470.Dl "msconvd -f -p <selected_port> -t <selected_protocol>"
471.Pp
472and see if the mouse pointer travels correctly
473according to the mouse movement.
474Then try cut & paste features by
475clicking the left, right and middle buttons.
476Type ^C to stop
477the command.
478.Ss Multiple Mice
479As many instances of the
480.Nm
481as the number of mice attached to the system may be run simultaneously;
482one instance for each mouse.
483This is useful if the user wants to use the built-in PS/2 pointing device
484of a laptop computer while on the road, but wants to use a serial
485mouse when s/he attaches the system to the docking station in the office.
486Run two
487.Nm
488and then the application program e.g.
489.Xr moused 8
490will always see mouse data from either mouse.
491When the serial mouse is not attached, the corresponding
492.Nm
493will not detect any movement or button state change and the application
494program will only see mouse data coming from the daemon for the
495PS/2 mouse.
496In contrast when both mice are attached and both of them
497are moved at the same time in this configuration,
498the mouse pointer will travel across the screen just as if movement of
499the mice is combined all together.
500.Sh FILES
501.Bl -tag -width /dev/input/event%d -compact
502.It Pa /dev/input/event%d
503input event device
504.It Pa /dev/psm%d
505PS/2 mouse driver
506.It Pa /dev/cuau%d
507serial port
508.It Pa /dev/ttyv%d
509virtual consoles
510.It Pa /dev/ums%d
511USB mouse driver
512.It Pa /var/run/msconvd.pid
513process id of the currently running
514.Nm
515utility
516.It Pa /var/run/MouseRemote
517UNIX-domain stream socket for X10 MouseRemote events
518.El
519.Sh EXAMPLES
520.Dl "msconvd -p /dev/cuau0 -i type"
521.Pp
522Let the
523.Nm
524utility determine the protocol type of the mouse at the serial port
525.Pa /dev/cuau0 .
526If successful, the command will print the type, otherwise it will say
527.Dq Li unknown .
528.Bd -literal -offset indent
529msconvd -p /dev/cuau0
530.Ed
531.Pp
532If the
533.Nm
534utility is able to identify the protocol type of the mouse at the specified
535port automatically, you can start the daemon without the
536.Fl t
537option.
538.Bd -literal -offset indent
539msconvd -p /dev/mouse -t microsoft
540.Ed
541.Pp
542Start the mouse daemon on the serial port
543.Pa /dev/mouse .
544The protocol type
545.Ar microsoft
546is explicitly specified by the
547.Fl t
548option.
549.Pp
550If you add
551.Pp
552.Dl "ALL ALL = NOPASSWD: /usr/bin/killall -USR1 msconvd"
553.Pp
554to your
555.Pa /usr/local/etc/sudoers
556file, and bind
557.Pp
558.Dl "killall -USR1 msconvd"
559.Pp
560to a key in your window manager, you can suspend mouse events on your laptop if
561you keep brushing over the mouse pad while typing.
562.Sh SEE ALSO
563.Xr moused 8 ,
564.Xr kill 1 ,
565.Xr xset 1 ,
566.Xr psm 4 ,
567.Xr screen 4 ,
568.Xr sysmouse 4 ,
569.Xr uart 4
570.Sh STANDARDS
571The
572.Nm
573utility partially supports
574.Dq Plug and Play External COM Device Specification
575in order to support PnP serial mice.
576However, due to various degrees of conformance to the specification by
577existing serial mice, it does not strictly follow the version 1.0 of the
578standard.
579Even with this less strict approach,
580it may not always determine an appropriate protocol type
581for the given serial mouse.
582.Sh HISTORY
583The
584.Nm
585utility first appeared in
586.Fx 15.0 .
587It is a cropped-down version of
588.Fx 14.0
589.Xr moused 8
590utility originated back in
591.Fx 2.2 .
592.Sh AUTHORS
593.An -nosplit
594The
595.Nm
596utility is based on
597.Xr moused 8
598written by
599.An Michael Smith Aq Mt msmith@FreeBSD.org .
600This manual page is extracted from
601.Xr moused 8
602page written by
603.An Mike Pritchard Aq Mt mpp@FreeBSD.org .
604The command and manual page have since been updated by
605.An Kazutaka Yokota Aq Mt yokota@FreeBSD.org .
606.Sh CAVEATS
607Many pad devices behave as if the first (left) button were pressed if
608the user
609.Dq taps
610the surface of the pad.
611In contrast, some ALPS GlidePoint and Interlink VersaPad models
612treat the tapping action
613as fourth button events.
614Use the option
615.Dq Fl m Li 1=4
616of
617.Xr moused 8
618for these models
619to obtain the same effect as the other pad devices.
620