xref: /freebsd/share/man/man4/sysmouse.4 (revision df7f5d4de4592a8948a25ce01e5bddfbb7ce39dc)
1.\" Copyright (c) 1997
2.\"	John-Mark Gurney.  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. Neither the name of the author nor the names of any co-contributors
13.\"    may be used to endorse or promote products derived from this software
14.\"    without specific prior written permission.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY John-Mark Gurney AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\"	$Id$
29.\"
30.Dd February 14, 1997
31.Dt SYSMOUSE 4 i386
32.Os
33.Sh NAME
34.Nm sysmouse
35.Nd supplies mouse data from syscons for other applications
36.Sh SYNOPSIS
37.Fd #include <machine/console.h>
38.Ft int
39.Fn ioctl cfd CONS_MOUSECTL struct\ *mouse_info
40.Sh DESCRIPTION
41The
42.Dv CONS_MOUSECTL
43.Fn ioctl
44call provides syscons with mouse information, which includes mouse movement
45and button presses.  The
46.Fn ioctl
47also provides a method for a process to receive a
48.Xr signal 3
49when a button is pressed.
50.Pp
51.Xr moused 8
52uses this
53.Fn ioctl
54to inform the console of mouse actions.  Applications
55.Pq such as Tn X\ Windows
56can use
57.Pa /dev/sysmouse ,
58allowing syscons and the application to share the mouse.
59.Pp
60.Bd -literal -offset indent
61struct mouse_info {
62        int     operation;
63        union {
64                struct mouse_data data;
65                struct mouse_mode mode;
66        }u;
67};
68.Ed
69.Bl -tag -width operation
70.It Dv operation
71This can be one of
72.Bl -tag -width MOUSE_MOVEABS
73.It Dv MOUSE_SHOW
74Enables and displays mouse cursor.
75.It Dv MOUSE_HIDE
76Disables and hides mouse cursor.
77.It Dv MOUSE_MOVEABS
78Moves mouse cursor to position supplied in
79.Dv u.data .
80.It Dv MOUSE_MOVEREL
81Add position supplied in
82.Dv u.data
83to current position.
84.It Dv MOUSE_GETINFO
85Returns current mouse position and button status in
86.Dv u.data .
87.It Dv MOUSE_MODE
88This sets the
89.Xr signal 3
90to be delivered to the current process when a button is pressed.
91The signal to be delivered is set in
92.Dv u.mode .
93.It Dv MOUSE_ACTION
94This takes the information in
95.Dv u.data
96and acts upon it.  It includes processing button presses if the current vty
97is a text interface, and sending
98.Tn Mouse System
99protocol data to
100.Pa /dev/sysmouse
101if it is open.
102.El
103.It Dv u
104This union is one of
105.Bl -tag -width data
106.It Dv data
107.Bd -literal -offset indent
108struct mouse_data {
109        int     x;
110        int     y;
111        int     buttons;
112};
113.Ed
114.It Dv mode
115.Bd -literal -offset indent
116struct mouse_mode {
117        int     mode;
118        int     signal;
119};
120.Ed
121.El
122.El
123.Sh FILES
124.Bl -tag -width /dev/consolectl -compact
125.It Pa /dev/consolectl
126device to control the console
127.It Pa /dev/sysmouse
128mouse action output
129.El
130.Sh SEE ALSO
131.Xr vidcontrol 1 ,
132.Xr signal 3 ,
133.Xr moused 8
134.Sh HISTORY
135The
136.Nm
137manual page example first appeared in
138.Fx 2.2 .
139.Sh AUTHOR
140This
141manual page was written by John-Mark Gurney
142.Aq gurney_j@efn.org .
143