diff options
Diffstat (limited to 'static/freebsd/man4/sysmouse.4 3.html')
| -rw-r--r-- | static/freebsd/man4/sysmouse.4 3.html | 371 |
1 files changed, 371 insertions, 0 deletions
diff --git a/static/freebsd/man4/sysmouse.4 3.html b/static/freebsd/man4/sysmouse.4 3.html new file mode 100644 index 00000000..9f2c9cee --- /dev/null +++ b/static/freebsd/man4/sysmouse.4 3.html @@ -0,0 +1,371 @@ +<table class="head"> + <tr> + <td class="head-ltitle">SYSMOUSE(4)</td> + <td class="head-vol">Device Drivers Manual</td> + <td class="head-rtitle">SYSMOUSE(4)</td> + </tr> +</table> +<div class="manual-text"> +<section class="Sh"> +<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1> +<p class="Pp"><code class="Nm">sysmouse</code> — + <span class="Nd">virtualized mouse driver</span></p> +</section> +<section class="Sh"> +<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1> +<p class="Pp"><code class="In">#include + <<a class="In">sys/mouse.h</a>></code> + <br/> + <code class="In">#include <<a class="In">sys/consio.h</a>></code></p> +</section> +<section class="Sh"> +<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1> +<p class="Pp">The console driver, in conjunction with the mouse daemon + <a class="Xr">moused(8)</a>, supplies mouse data to the user process in the + standardized way via the <code class="Nm">sysmouse</code> driver. This + arrangement makes it possible for the console and the user process (such as + the X Window System) to share the mouse.</p> +<p class="Pp">The user process which wants to utilize mouse operation simply + opens <span class="Pa">/dev/sysmouse</span> with a <a class="Xr">open(2)</a> + call and reads mouse data from the device via <a class="Xr">read(2)</a>. + Make sure that <a class="Xr">moused(8)</a> is running, otherwise the user + process will not see any data coming from the mouse.</p> +<section class="Ss"> +<h2 class="Ss" id="Operation_Levels"><a class="permalink" href="#Operation_Levels">Operation + Levels</a></h2> +<p class="Pp">The <code class="Nm">sysmouse</code> driver has two levels of + operation. The current operation level can be referred to and changed via + ioctl calls.</p> +<p class="Pp">The level zero, the basic level, is the lowest level at which the + driver offers the basic service to user programs. The + <code class="Nm">sysmouse</code> driver provides horizontal and vertical + movement of the mouse and state of up to three buttons in the MouseSystems + format as follows.</p> +<p class="Pp"></p> +<dl class="Bl-tag Bl-compact"> + <dt>Byte 1</dt> + <dd> + <dl class="Bl-tag Bl-compact"> + <dt>bit 7</dt> + <dd>Always one.</dd> + <dt>bit 6..3</dt> + <dd>Always zero.</dd> + <dt>bit 2</dt> + <dd>Left button status; cleared if pressed, otherwise set.</dd> + <dt>bit 1</dt> + <dd>Middle button status; cleared if pressed, otherwise set. Always one, + if the device does not have the middle button.</dd> + <dt>bit 0</dt> + <dd>Right button status; cleared if pressed, otherwise set.</dd> + </dl> + </dd> + <dt>Byte 2</dt> + <dd>The first half of horizontal movement count in two's complement; -128 + through 127.</dd> + <dt>Byte 3</dt> + <dd>The first half of vertical movement count in two's complement; -128 + through 127.</dd> + <dt>Byte 4</dt> + <dd>The second half of the horizontal movement count in two's complement; -128 + through 127. To obtain the full horizontal movement count, add the byte 2 + and 4.</dd> + <dt>Byte 5</dt> + <dd>The second half of the vertical movement count in two's complement; -128 + through 127. To obtain the full vertical movement count, add the byte 3 + and 5.</dd> +</dl> +<p class="Pp">At the level one, the extended level, mouse data is encoded in the + standard format <code class="Dv">MOUSE_PROTO_SYSMOUSE</code> as defined in + <a class="Xr">mouse(4)</a>.</p> +</section> +</section> +<section class="Sh"> +<h1 class="Sh" id="IOCTLS"><a class="permalink" href="#IOCTLS">IOCTLS</a></h1> +<p class="Pp">This section describes two classes of <a class="Xr">ioctl(2)</a> + commands: commands for the <code class="Nm">sysmouse</code> driver itself, + and commands for the console and the console control drivers.</p> +<section class="Ss"> +<h2 class="Ss" id="Sysmouse_Ioctls"><a class="permalink" href="#Sysmouse_Ioctls">Sysmouse + Ioctls</a></h2> +<p class="Pp">There are a few commands for mouse drivers. General description of + the commands is given in <a class="Xr">mouse(4)</a>. Following are the + features specific to the <code class="Nm">sysmouse</code> driver.</p> +<p class="Pp"></p> +<dl class="Bl-tag Bl-compact"> + <dt id="MOUSE_GETLEVEL"><a class="permalink" href="#MOUSE_GETLEVEL"><code class="Dv">MOUSE_GETLEVEL</code></a> + <var class="Ar">int *level</var></dt> + <dd style="width: auto;"> </dd> + <dt id="MOUSE_SETLEVEL"><a class="permalink" href="#MOUSE_SETLEVEL"><code class="Dv">MOUSE_SETLEVEL</code></a> + <var class="Ar">int *level</var></dt> + <dd>These commands manipulate the operation level of the mouse driver. + <p class="Pp"></p> + </dd> + <dt id="MOUSE_GETHWINFO"><a class="permalink" href="#MOUSE_GETHWINFO"><code class="Dv">MOUSE_GETHWINFO</code></a> + <var class="Ar">mousehw_t *hw</var></dt> + <dd>Returns the hardware information of the attached device in the following + structure. Only the <var class="Va">iftype</var> field is guaranteed to be + filled with the correct value in the current version of the + <code class="Nm">sysmouse</code> driver. + <div class="Bd Pp Li"> + <pre>typedef struct mousehw { + int buttons; /* number of buttons */ + int iftype; /* I/F type */ + int type; /* mouse/track ball/pad... */ + int model; /* I/F dependent model ID */ + int hwid; /* I/F dependent hardware ID */ +} mousehw_t;</pre> + </div> + <p class="Pp">The <var class="Va">buttons</var> field holds the number of + buttons detected by the driver.</p> + <p class="Pp">The <var class="Va">iftype</var> is always + <code class="Dv">MOUSE_IF_SYSMOUSE</code>.</p> + <p class="Pp">The <var class="Va">type</var> tells the device type: + <code class="Dv">MOUSE_MOUSE</code>, + <code class="Dv">MOUSE_TRACKBALL</code>, + <code class="Dv">MOUSE_STICK</code>, <code class="Dv">MOUSE_PAD</code>, + or <code class="Dv">MOUSE_UNKNOWN</code>.</p> + <p class="Pp">The <var class="Va">model</var> is always + <code class="Dv">MOUSE_MODEL_GENERIC</code> at the operation level 0. It + may be <code class="Dv">MOUSE_MODEL_GENERIC</code> or one of + <code class="Dv">MOUSE_MODEL_XXX</code> constants at higher operation + levels.</p> + <p class="Pp">The <var class="Va">hwid</var> is always zero.</p> + <p class="Pp"></p> + </dd> + <dt id="MOUSE_GETMODE"><a class="permalink" href="#MOUSE_GETMODE"><code class="Dv">MOUSE_GETMODE</code></a> + <var class="Ar">mousemode_t *mode</var></dt> + <dd>The command gets the current operation parameters of the mouse driver. + <div class="Bd Pp Li"> + <pre>typedef struct mousemode { + int protocol; /* MOUSE_PROTO_XXX */ + int rate; /* report rate (per sec) */ + int resolution; /* MOUSE_RES_XXX, -1 if unknown */ + int accelfactor; /* acceleration factor */ + int level; /* driver operation level */ + int packetsize; /* the length of the data packet */ + unsigned char syncmask[2]; /* sync. bits */ +} mousemode_t;</pre> + </div> + <p class="Pp">The <var class="Va">protocol</var> field tells the format in + which the device status is returned when the mouse data is read by the + user program. It is <code class="Dv">MOUSE_PROTO_MSC</code> at the + operation level zero. <code class="Dv">MOUSE_PROTO_SYSMOUSE</code> at + the operation level one.</p> + <p class="Pp">The <var class="Va">rate</var> is always set to -1.</p> + <p class="Pp">The <var class="Va">resolution</var> is always set to -1.</p> + <p class="Pp">The <var class="Va">accelfactor</var> is always 0.</p> + <p class="Pp">The <var class="Va">packetsize</var> field specifies the + length of the data packet. It depends on the operation level.</p> + <p class="Pp"></p> + <dl class="Bl-tag Bl-compact"> + <dt id="level"><a class="permalink" href="#level"><i class="Em">level + 0</i></a></dt> + <dd>5 bytes</dd> + <dt id="level~2"><a class="permalink" href="#level~2"><i class="Em">level + 1</i></a></dt> + <dd>8 bytes</dd> + </dl> + <p class="Pp">The array <var class="Va">syncmask</var> holds a bit mask and + pattern to detect the first byte of the data packet. + <var class="Va">syncmask[0]</var> is the bit mask to be ANDed with a + byte. If the result is equal to <var class="Va">syncmask[1]</var>, the + byte is likely to be the first byte of the data packet. Note that this + method of detecting the first byte is not 100% reliable; thus, it should + be taken only as an advisory measure.</p> + <p class="Pp"></p> + </dd> + <dt id="MOUSE_SETMODE"><a class="permalink" href="#MOUSE_SETMODE"><code class="Dv">MOUSE_SETMODE</code></a> + <var class="Ar">mousemode_t *mode</var></dt> + <dd>The command changes the current operation parameters of the mouse driver + as specified in <var class="Ar">mode</var>. Only + <var class="Va">level</var> may be modifiable. Setting values in the other + field does not generate error and has no effect. + <p class="Pp"></p> + </dd> + <dt id="MOUSE_READDATA"><a class="permalink" href="#MOUSE_READDATA"><code class="Dv">MOUSE_READDATA</code></a> + <var class="Ar">mousedata_t *data</var></dt> + <dd style="width: auto;"> </dd> + <dt id="MOUSE_READSTATE"><a class="permalink" href="#MOUSE_READSTATE"><code class="Dv">MOUSE_READSTATE</code></a> + <var class="Ar">mousedata_t *state</var></dt> + <dd>These commands are not supported by the <code class="Nm">sysmouse</code> + driver. + <p class="Pp"></p> + </dd> + <dt id="MOUSE_GETSTATUS"><a class="permalink" href="#MOUSE_GETSTATUS"><code class="Dv">MOUSE_GETSTATUS</code></a> + <var class="Ar">mousestatus_t *status</var></dt> + <dd>The command returns the current state of buttons and movement counts in + the structure as defined in <a class="Xr">mouse(4)</a>.</dd> +</dl> +</section> +<section class="Ss"> +<h2 class="Ss" id="Console_and_Consolectl_Ioctls"><a class="permalink" href="#Console_and_Consolectl_Ioctls">Console + and Consolectl Ioctls</a></h2> +<p class="Pp">The user process issues console + <a class="permalink" href="#ioctl"><code class="Fn" id="ioctl">ioctl</code></a>() + calls to the current virtual console in order to control the mouse pointer. + The console <code class="Fn">ioctl</code>() also provides a method for the + user process to receive a <a class="Xr">signal(3)</a> when a button is + pressed.</p> +<p class="Pp" id="ioctl~2">The mouse daemon <a class="Xr">moused(8)</a> uses + <a class="permalink" href="#ioctl~2"><code class="Fn">ioctl</code></a>() + calls to the console control device <span class="Pa">/dev/consolectl</span> + to inform the console of mouse actions including mouse movement and button + status.</p> +<p class="Pp" id="ioctl~3">Both classes of + <a class="permalink" href="#ioctl~3"><code class="Fn">ioctl</code></a>() + commands are defined as <code class="Dv">CONS_MOUSECTL</code> which takes + the following argument.</p> +<div class="Bd Pp Li"> +<pre>struct mouse_info { + int operation; + union { + struct mouse_data data; + struct mouse_mode mode; + struct mouse_event event; + } u; +};</pre> +</div> +<p class="Pp"></p> +<dl class="Bl-tag Bl-compact"> + <dt id="operation"><var class="Va">operation</var></dt> + <dd>This can be one of + <p class="Pp"></p> + <dl class="Bl-tag Bl-compact"> + <dt id="MOUSE_SHOW"><a class="permalink" href="#MOUSE_SHOW"><code class="Dv">MOUSE_SHOW</code></a></dt> + <dd>Enables and displays mouse cursor.</dd> + <dt id="MOUSE_HIDE"><a class="permalink" href="#MOUSE_HIDE"><code class="Dv">MOUSE_HIDE</code></a></dt> + <dd>Disables and hides mouse cursor.</dd> + <dt id="MOUSE_MOVEABS"><a class="permalink" href="#MOUSE_MOVEABS"><code class="Dv">MOUSE_MOVEABS</code></a></dt> + <dd>Moves mouse cursor to position supplied in + <var class="Va">u.data</var>.</dd> + <dt id="MOUSE_MOVEREL"><a class="permalink" href="#MOUSE_MOVEREL"><code class="Dv">MOUSE_MOVEREL</code></a></dt> + <dd>Adds position supplied in <var class="Va">u.data</var> to current + position.</dd> + <dt id="MOUSE_GETINFO"><a class="permalink" href="#MOUSE_GETINFO"><code class="Dv">MOUSE_GETINFO</code></a></dt> + <dd>Returns current mouse position in the current virtual console and + button status in <var class="Va">u.data</var>.</dd> + <dt id="MOUSE_MODE"><a class="permalink" href="#MOUSE_MODE"><code class="Dv">MOUSE_MODE</code></a></dt> + <dd>This sets the <a class="Xr">signal(3)</a> to be delivered to the + current process when a button is pressed. The signal to be delivered + is set in <var class="Va">u.mode</var>.</dd> + </dl> + <p class="Pp">The above operations are for virtual consoles. The operations + defined below are for the console control device and are used by + <a class="Xr">moused(8)</a> to pass mouse data to the console + driver.</p> + <p class="Pp"></p> + <dl class="Bl-tag Bl-compact"> + <dt id="MOUSE_ACTION"><a class="permalink" href="#MOUSE_ACTION"><code class="Dv">MOUSE_ACTION</code></a></dt> + <dd style="width: auto;"> </dd> + <dt id="MOUSE_MOTION_EVENT"><a class="permalink" href="#MOUSE_MOTION_EVENT"><code class="Dv">MOUSE_MOTION_EVENT</code></a></dt> + <dd>These operations take the information in <var class="Va">u.data</var> + and act upon it. Mouse data will be sent to the + <code class="Nm">sysmouse</code> driver if it is open. + <code class="Dv">MOUSE_ACTION</code> also processes button press + actions and sends signal to the process if requested or performs cut + and paste operations if the current console is a text interface.</dd> + <dt id="MOUSE_BUTTON_EVENT"><a class="permalink" href="#MOUSE_BUTTON_EVENT"><code class="Dv">MOUSE_BUTTON_EVENT</code></a></dt> + <dd><var class="Va">u.data</var> specifies a button and its click count. + The console driver will use this information for signal delivery if + requested or for cut and paste operations if the console is in text + mode.</dd> + </dl> + <p class="Pp"><code class="Dv">MOUSE_MOTION_EVENT</code> and + <code class="Dv">MOUSE_BUTTON_EVENT</code> are newer interface and are + designed to be used together. They are intended to replace functions + performed by <code class="Dv">MOUSE_ACTION</code> alone.</p> + <p class="Pp"></p> + </dd> + <dt id="u"><var class="Va">u</var></dt> + <dd>This union is one of + <p class="Pp"></p> + <dl class="Bl-tag Bl-compact"> + <dt id="data"><var class="Va">data</var></dt> + <dd> + <div class="Bd Pp Li"> + <pre>struct mouse_data { + int x; + int y; + int z; + int buttons; +};</pre> + </div> + <p class="Pp"><var class="Va">x</var>, <var class="Va">y</var> and + <var class="Va">z</var> represent movement of the mouse along + respective directions. <var class="Va">buttons</var> tells the state + of buttons. It encodes up to 31 buttons in the bit 0 though the bit + 30. If a button is held down, the corresponding bit is set.</p> + <p class="Pp"></p> + </dd> + <dt id="mode"><var class="Va">mode</var></dt> + <dd> + <div class="Bd Pp Li"> + <pre>struct mouse_mode { + int mode; + int signal; +};</pre> + </div> + <p class="Pp">The <var class="Va">signal</var> field specifies the + signal to be delivered to the process. It must be one of the values + defined in + <code class="In"><<a class="In">signal.h</a>></code>. The + <var class="Va">mode</var> field is currently unused.</p> + <p class="Pp"></p> + </dd> + <dt id="event"><var class="Va">event</var></dt> + <dd> + <div class="Bd Pp Li"> + <pre>struct mouse_event { + int id; + int value; +};</pre> + </div> + <p class="Pp">The <var class="Va">id</var> field specifies a button + number as in <var class="Va">u.data.buttons</var>. Only one + bit/button is set. The <var class="Va">value</var> field holds the + click count: the number of times the user has clicked the button + successively.</p> + </dd> + </dl> + </dd> +</dl> +</section> +</section> +<section class="Sh"> +<h1 class="Sh" id="FILES"><a class="permalink" href="#FILES">FILES</a></h1> +<dl class="Bl-tag Bl-compact"> + <dt><span class="Pa">/dev/consolectl</span></dt> + <dd>device to control the console</dd> + <dt><span class="Pa">/dev/sysmouse</span></dt> + <dd>virtualized mouse driver</dd> + <dt><span class="Pa">/dev/ttyv%d</span></dt> + <dd>virtual consoles</dd> +</dl> +</section> +<section class="Sh"> +<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE + ALSO</a></h1> +<p class="Pp"><a class="Xr">vidcontrol(1)</a>, <a class="Xr">ioctl(2)</a>, + <a class="Xr">signal(3)</a>, <a class="Xr">mouse(4)</a>, + <a class="Xr">moused(8)</a></p> +</section> +<section class="Sh"> +<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1> +<p class="Pp">The <code class="Nm">sysmouse</code> driver first appeared in + <span class="Ux">FreeBSD 2.2</span>.</p> +</section> +<section class="Sh"> +<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1> +<p class="Pp">This manual page was written by <span class="An">John-Mark + Gurney</span> + <<a class="Mt" href="mailto:jmg@FreeBSD.org">jmg@FreeBSD.org</a>> and + <span class="An">Kazutaka Yokota</span> + <<a class="Mt" href="mailto:yokota@FreeBSD.org">yokota@FreeBSD.org</a>>.</p> +</section> +</div> +<table class="foot"> + <tr> + <td class="foot-date">March 25, 2014</td> + <td class="foot-os">FreeBSD 15.0</td> + </tr> +</table> |
