haiku-website/static/legacy-docs/bebook/BInputServerDevice.html

159 lines
28 KiB
HTML
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>The Be Book - Classes And Methods - The Input Server</title><link rel="stylesheet" href="be_book.css" type="text/css" media="all" /><link rel="shortcut icon" type="image/vnd.microsoft.icon" href="./images/favicon.ico" /><!--[if IE]>
<link rel="stylesheet" type="text/css" href="be_book_ie.css" />
<![endif]--><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /><meta name="keywords" content="Access, BeOS, BeBook, API" /><link rel="start" href="index.html" title="The Be Book" /><link rel="up" href="TheInputServer.html" title="The Input Server" /><link rel="prev" href="BInputDevice.html" title="BInputDevice" /><link rel="next" href="BInputServerFilter.html" title="BInputServerFilter" /></head><body><div id="header"><div id="headerT"><div id="headerTL"><a accesskey="p" href="BInputDevice.html" title="BInputDevice"><img src="./images/navigation/prev.png" alt="Prev" /></a> <a accesskey="u" href="TheInputServer.html" title="The Input Server"><img src="./images/navigation/up.png" alt="Up" /></a> <a accesskey="n" href="BInputServerFilter.html" title="BInputServerFilter"><img src="./images/navigation/next.png" alt="Next" /></a></div><div id="headerTR"><div id="navigpeople"><a href="http://www.haiku-os.org"><img src="./images/People_24.png" alt="haiku-os.org" title="Visit The Haiku Website" /></a></div><div class="navighome" title="Home"><a accesskey="h" href="index.html"><img src="./images/navigation/home.png" alt="Home" /></a></div><div class="navigboxed" id="navigindex"><a accesskey="i" href="ClassIndex.html" title="Index">I</a></div><div class="navigboxed" id="naviglang" title="English">en</div></div><div id="headerTC">The Be Book - Classes And Methods - The Input Server</div></div><div id="headerB">Prev: <a href="BInputDevice.html">BInputDevice</a>  Up: <a href="TheInputServer.html">The Input Server</a>  Next: <a href="BInputServerFilter.html">BInputServerFilter</a></div><hr /></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h2 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BInputServerDevice"></a>BInputServerDevice</h2></div></div></div><a id="id960029" class="indexterm"></a><div class="classheader"><table border="0"><colgroup><col /><col /></colgroup><tbody><tr><td><table width="100%" border="0"><colgroup><col /><col /></colgroup><tbody><tr><td>Derived From:</td><td></td></tr><tr><td>Mix-in Classes:</td><td></td></tr><tr><td>Declared In:</td><td><code class="filename">add-ons/input_server/InputServerDevice.h</code></td></tr><tr><td>Library:</td><td>The Input Server</td></tr><tr><td>Allocation:</td><td>By the Input Server only</td></tr></tbody></table></td><td>
<a class="link overview" href="BInputServerDevice_Overview.html" title="BInputServerDevice">Class Overview</a>
<div class="toc"><ul><li><span class="section"><a href="BInputServerDevice.html#BInputServerDevice_ConstructorDestructor">Constructor and Destructor</a></span></li><li><span class="section"><a href="BInputServerDevice.html#BInputServerDevice_HookFunctions">Hook Functions</a></span></li><li><span class="section"><a href="BInputServerDevice.html#BInputServerDevice_MemberFunctions">Member Functions</a></span></li></ul></div>
</td></tr></tbody></table></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BInputServerDevice_ConstructorDestructor"></a>Constructor and Destructor</h3></div></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BInputServerDevice_Constructor"></a>BInputServerDevice()</h4></div></div></div><code class="constructorsynopsis cpp"><span class="methodname">BInputServerDevice</span>();</code><p>Creates a new BInputServerDevice object. You can initialize your
object—set initial values, spawn (but not necessarily resume; do
that in <a class="link" href="BInputServerDevice.html#BInputServerDevice_Start" title="Start(), Stop()"><code class="methodname">Start()</code></a>)
threads, open drivers, etc.—either here or in the
<a class="link" href="BInputServerDevice.html#BInputServerDevice_InitCheck" title="InitCheck()"><code class="methodname">InitCheck()</code></a>
function, which is called immediately after the constructor.</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BInputServerDevice_Destructor"></a>~BInputServerDevice()</h4></div></div></div><code class="destructorsynopsis cpp"><span class="methodname">BInputServerDevice</span>();</code><p>Deletes the <code class="classname">BInputServerDevice</code> object. The
destructor is invoked by the Input Server only—you never delete a
<code class="classname">BInputServerDevice</code> object from your own code. When
the destructor is called, the object's devices will already be unregistered
and <a class="link" href="BInputServerDevice.html#BInputServerDevice_Stop"><code class="methodname">Stop()</code></a>
will already have been called. If this object spawned its own threads or
allocated memory on the heap, it must clean up after itself here.</p></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BInputServerDevice_HookFunctions"></a>Hook Functions</h3></div></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BInputServerDevice_Control"></a>Control()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">status_t </span><span class="methodname">Control</span>(<span class="methodparam"><span class="modifier">const </span><span class="type">char* </span><span class="parameter">name</span></span>,<br />                 <span class="methodparam"><span class="type">voi* </span><span class="parameter">cookie</span></span>,<br />                 <span class="methodparam"><span class="type">uint32 </span><span class="parameter">command</span></span>,<br />                 <span class="methodparam"><span class="type"><a class="link" href="BMessage.html" title="BMessage"><code class="classname">BMessage</code></a>* </span><span class="parameter">message</span></span>);</code><p>The <code class="methodname">Control()</code> hook function is invoked by the Input Server to send an
input device control message or a Node Monitor message to this object.
name and cookie are the readable name and pointer-to-whatever-you-want
that you used when registering the device (with the
<a class="link" href="BInputServerDevice.html#BInputServerDevice_RegisterDevices" title="RegisterDevices(), UnregisterDevices()"><code class="methodname">RegisterDevices()</code></a>
function).</p><div class="admonition warning"><div class="title">Warning</div><div class="graphic"><img class="icon" alt="Warning" width="32" src="./images/admonitions/Stop_32.png" /><div class="text"><p>The function's return value is ignored.</p></div></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h5 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BInputServerDevice_Input_Device_Control_Messages"></a>Input Device Control Messages</h5></div></div></div><p>An input device control message is sent when a downstream change
needs to be propagated to an input device. For example, when the user
resets the mouse speed (through the Mouse preference), a
<code class="constant">B_MOUSE_SPEED_CHANGED</code> control message is sent to all
objects that have registered a <code class="constant">B_POINTING_DEVICE</code>
device (see
<a class="link" href="BInputServerDevice.html#BInputServerDevice_RegisterDevices" title="RegisterDevices(), UnregisterDevices()"><code class="methodname">RegisterDevices()</code></a>).
<code class="parameter">name</code> and <code class="parameter">cookie</code> identify the
device that this message applies to. The control message itself is
represented by the <code class="parameter">command</code> constant, optionally
supplemented by <code class="parameter">message</code>.</p><p>See "Input Device Control Messages" for a list of the
control messages that the BeOS defines, and instructions for how to respond
to them. An application can send a custom control message through a
<a class="link" href="BInputDevice.html" title="BInputDevice"><code class="classname">BInputDevice</code></a> object;
see <a class="link" href="BInputDevice.html#BInputDevice_Control" title="Control()"><code class="methodname">BInputDevice::Control()</code></a>
for details.</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h5 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BInputServerDevice_Node_Monitor_Messages"></a>Node Monitor Messages</h5></div></div></div><p>A Node Monitor message is sent if an entry is added to or removed from
one of the device directories that the object is monitoring, as set
through
<a class="link" href="BInputServerDevice.html#BInputServerDevice_StartMonitoringDevice" title="StartMonitoringDevice(), StopMonitoringDevice()"><code class="methodname">StartMonitoringDevice()</code></a>.
In this case, <code class="parameter">name</code> and <code class="parameter">cookie</code>
are <code class="constant">NULL</code>, <code class="parameter">command</code> is
<code class="constant">B_NODE_MONITOR</code>, and <code class="parameter">message</code>
describes the file that was added or deleted. The
<code class="parameter">message</code>'s <code class="varname">opcode</code> field will be
<code class="constant">B_ENTRY_CREATED</code> or
<code class="constant">B_ENTRY_REMOVED</code> (or, potentially but nonsensically,
<code class="constant">B_ENTRY_MOVED</code>). For instructions on how to read these
messages, see "The Node Monitor" in the Storage Kit (or click on
the opcode constants).</p></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BInputServerDevice_InitCheck"></a>InitCheck()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="type">status_t </span><span class="methodname">InitCheck</span>();</code><p>Invoked by the Input Server immediately after the object is constructed
to test the validity of the initialization. If the object is properly
initialized (i.e. all required resources are located or allocated), this
function should return <code class="constant">B_OK</code>.
<a class="link" href="BInputServerDevice.html#BInputServerDevice_Start" title="Start(), Stop()"><code class="methodname">Start()</code></a>
will be invoked soon if you need to
do any extra initialization. If the object returns non-<code class="constant">B_OK</code>, the object
is deleted and the add-on is unloaded.</p><p>The default implementation returns <code class="constant">B_OK</code>.</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BInputServerDevice_Start"></a><a id="BInputServerDevice_Stop"></a>
Start(), Stop()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="type">status_t </span><span class="methodname">Start</span>(<span class="methodparam"><span class="modifier">const </span><span class="type">char* </span><span class="parameter">name</span></span>,<br />                       <span class="methodparam"><span class="type">void* </span><span class="parameter">cookie</span></span>);</code><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="type">status_t </span><span class="methodname">Stop</span>(<span class="methodparam"><span class="modifier">const </span><span class="type">char* </span><span class="parameter">name</span></span>,<br />                      <span class="methodparam"><span class="type">void* </span><span class="parameter">cookie</span></span>);</code><p><code class="methodname">Start()</code> is invoked by the Input Server to tell the object that it can
begin sending events for the registered device identified by the
arguments. The values of the arguments are taken from the
<span class="type">input_device_ref</span> structure you used to register the device (see
<a class="link" href="BInputServerDevice.html#BInputServerDevice_RegisterDevices" title="RegisterDevices(), UnregisterDevices()"><code class="methodname">RegisterDevices()</code></a>).
If your object needs to resume a thread (spawned in the constructor, in
<a class="link" href="BInputServerDevice.html#BInputServerDevice_InitCheck" title="InitCheck()"><code class="methodname">InitCheck()</code></a>,
or here), this is the place to do it.</p><p><code class="methodname">Stop()</code> is invoked to tell the object to stop sending events for the
registered device. The device is not unregistered—you can still
receive <a class="link" href="BInputServerDevice.html#BInputServerDevice_Control" title="Control()"><code class="methodname">Control()</code></a>
messages for the device while it's stopped. You should
pause or kill any threads associated with the device (that were spawned
by this object) from here.</p><p>The return value (for both of these functions) is ignored.</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BInputServerDevice_SystemShuttingDown"></a>SystemShuttingDown()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="type">status_t </span><span class="methodname">SystemShuttingDown</span>() <span class="modifier">const</span>;</code><p>Tells the object that the Input Server is in the process of shutting
down. Unless something interrupts the shutdown, this notification will be
followed by a
<a class="link" href="BInputServerDevice.html#BInputServerDevice_Stop"><code class="methodname">Stop()</code></a>
and delete, thus you don't have to do much from this
function (other than note that the end is near).</p><div class="admonition warning"><div class="title">Warning</div><div class="graphic"><img class="icon" alt="Warning" width="32" src="./images/admonitions/Stop_32.png" /><div class="text"><p>The return value is ignored.</p></div></div></div></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BInputServerDevice_MemberFunctions"></a>Member Functions</h3></div></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BInputServerDevice_EnqueueMessage"></a>EnqueueMessage()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">status_t </span><span class="methodname">EnqueueMessage</span>(<span class="methodparam"><span class="type"><a class="link" href="BMessage.html" title="BMessage"><code class="classname">BMessage</code></a>* </span><span class="parameter">message</span></span>);</code><p>Sends an event message to the Input Server, which passes it through the
input methods and input filters before sending it to the App Server. The
message you create should be appropriate for the action you're trying to
depict. For example, if the user presses a key, you should create and
send a <code class="constant">B_KEY_DOWN</code> message. A list of the system-defined event messages
that an input device is expected to create and send is given in
"Input Device Event Messages".</p><table class="variablelist returncodes"><thead><tr><th>Return Code</th><th>Description</th></tr></thead><tbody><tr><td><p><span class="term"><code class="constant">B_OK</code>.</span></p></td><td><p>The message was sent.</p></td></tr><tr><td><p><span class="term">Anything else.</span></p></td><td><p>The connection to the App Server has been
broken—this isn't good, and you may want to check the
<a class="link" href="TheKernelKit_SystemInfo.html#is_computer_on_fire" title="is_computer_on_fire()"><code class="function">is_computer_on_fire()</code></a>
function found in the Kernel Kit.</p></td></tr></tbody></table></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BInputServerDevice_RegisterDevices"></a><a id="BInputServerDevice_UnregisterDevices"></a>
RegisterDevices(), UnregisterDevices()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">status_t </span><span class="methodname">RegisterDevices</span>(<span class="methodparam"><span class="type">input_device_ref ** </span><span class="parameter">devices</span></span>);</code><code class="methodsynopsis cpp"><span class="type">status_t </span><span class="methodname">UnregisterDevices</span>(<span class="methodparam"><span class="type">input_device_ref ** </span><span class="parameter">devices</span></span>);</code><p><code class="methodname">RegisterDevices()</code> tells the Input Server that this object is responsible
for the listed devices. This means that when a control message is sent
back upstream, the message—which is tagged as being relevant for a
specific device, or type of device—will be forwarded (through the
<a class="link" href="BInputServerDevice.html#BInputServerDevice_Control" title="Control()"><code class="methodname">Control()</code></a>
hook) to the responsible <code class="classname">BInputServerDevice</code> object(s).
Typically, you initially register your devices as part of the constructor
or
<a class="link" href="BInputServerDevice.html#BInputServerDevice_InitCheck" title="InitCheck()"><code class="methodname">InitCheck()</code></a>.
Registration is cumulative—each <code class="methodname">RegisterDevices()</code>
call adds to the object's current list of devices.</p><p><code class="methodname">UnregisterDevices()</code> tells the Input Server that this object is no longer
responsible for the listed devices. The devices are automatically
unregistered when your object is deleted.</p><p><code class="methodname">RegisterDevices()</code> invokes
<a class="link" href="BInputServerDevice.html#BInputServerDevice_Start" title="Start(), Stop()"><code class="methodname">Start()</code></a>
for each device in the devices list;
<code class="methodname">UnregisterDevices()</code> invokes
<a class="link" href="BInputServerDevice.html#BInputServerDevice_Stop"><code class="methodname">Stop()</code></a>.</p><p>For both functions, the devices list must be <code class="constant">NULL</code>-terminated, and the
caller retains ownership of the list and its contents.</p><p>Note that the BeOS currently only targets the device types when sending a
<a class="link" href="BInputServerDevice.html#BInputServerDevice_Control" title="Control()"><code class="methodname">Control()</code></a>
message. For example, let's say you've registered two pointing
devices and a keyboard:</p><pre class="programlisting example cpp"><span class="type">status_t</span> <code class="classname">MyISDevice</code>::<code class="methodname">InitCheck</code>()
{
...
<span class="type">input_device_ref **</span><code class="varname">devices</code> =
(<span class="type">input_device_ref **</span>)<code class="function">malloc</code>(<code class="function">sizeof</code>(*<span class="type">input_device_ref</span> * 4));
<span class="type">input_device_ref</span> <code class="varname">mouse1</code> = {"Mouse 1", <code class="constant">B_POINTING_DEVICE</code>,
(<span class="type">void *</span>)<code class="varname">this</code>)};
<span class="type">input_device_ref</span> <code class="varname">mouse2</code> = {"Mouse 2", <code class="constant">B_POINTING_DEVICE</code>,
(<span class="type">void *</span>)<code class="varname">this</code>)};
<span class="type">input_device_ref</span> <code class="varname">keyboard</code> = {"Keyboard", <code class="constant">B_KEYBOARD_DEVICE</code>,
(<span class="type">void *</span>)<code class="varname">this</code>)};
<code class="varname">devices</code>[0] = &amp;<code class="varname">mouse1</code>;
<code class="varname">devices</code>[1] = &amp;<code class="varname">mouse2</code>;
<code class="varname">devices</code>[2] = &amp;<code class="varname">keyboard</code>;
<code class="varname">devices</code>[3] = <code class="constant">NULL</code>;
<code class="methodname">RegisterDevices</code>(<code class="varname">devices</code>);
...
}</pre><p>When the user fiddles with the Mouse preference (more specifically, if an
application calls
<a class="link" href="TheInputServer_Functions.html#set_mouse_speed"><code class="function">set_mouse_speed()</code></a>
et. al.), this object will receive two
<a class="link" href="BInputServerDevice.html#BInputServerDevice_Control" title="Control()"><code class="methodname">Control()</code></a>
messages: one targets "Mouse 1", and the other targets
"Mouse 2". That's because the mouse and keyboard functions (as defined by
the BeOS and as used by the system preferences) know which type of device
to control, but they don't provide a means for more granular
identification. If you need a UI that identifies specific devices, you
have to create the UI yourself, and use a
<a class="link" href="BInputDevice.html" title="BInputDevice"><code class="classname">BInputDevice</code></a> object to tune the
control messages that are sent back upstream.</p><div class="admonition warning"><div class="title">Warning</div><div class="graphic"><img class="icon" alt="Warning" width="32" src="./images/admonitions/Stop_32.png" /><div class="text"><p>The functions don't let you un/register the same device definition
twice, and <code class="methodname">RegisterDevices()</code> won't register a device that doesn't have a
name (although the name can be ""). However, the functions don't complain
about violations of these conditions as long as at least one definition
is properly formed.</p></div></div></div><table class="variablelist returncodes"><thead><tr><th>Return Code</th><th>Description</th></tr></thead><tbody><tr><td><p><span class="term"><code class="constant">B_OK</code>.</span></p></td><td><p>At least one of the devices was registered.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_ERROR</code>.</span></p></td><td><p>None of the devices were registered.</p></td></tr></tbody></table></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BInputServerDevice_StartMonitoringDevice"></a><a id="BInputServerDevice_StopMonitoringDevice"></a>
StartMonitoringDevice(), StopMonitoringDevice()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">status_t </span><span class="methodname">StartMonitoringDevice</span>(<span class="methodparam"><span class="modifier">const </span><span class="type">char* </span><span class="parameter">deviceDir</span></span>);</code><code class="methodsynopsis cpp"><span class="type">status_t </span><span class="methodname">StopMonitoringDevice</span>(<span class="methodparam"><span class="modifier">const </span><span class="type">char* </span><span class="parameter">deviceDir</span></span>);</code><p>These are convenient covers for the
<a class="link" href="The_Node_Monitor.html" title="The Node Monitor">Node Monitor</a>'s
<a class="link" href="The_Node_Monitor.html#watch_node" title="watch_node()"><code class="function">watch_node()</code></a> and
<a class="link" href="The_Node_Monitor.html#stop_watching" title="stop_watching()"><code class="function">stop_watching()</code></a>
functions. You use them to watch for physical devices
that are attached and detached, as indicated by changes to subdirectories
of the system device directory (<code class="filename">/dev</code>).</p><p><code class="parameter">deviceDir</code> is the name of the device subdirectory that you want to watch.
The <code class="filename">/dev/</code> root is automatically prepended; for example, if you want to
watch for new ps2 mice, you would pass
<code class="filename">input/mouse/ps2</code> as the <code class="parameter">deviceDir</code>
name. The Node Monitor is told to look for changes to the directory
(<code class="constant">B_WATCH_DIRECTORY</code> opcode). When an entry is added or removed, this
object receives a <code class="constant">B_NODE_MONITOR</code> message delivered to its
<a class="link" href="BInputServerDevice.html#BInputServerDevice_Control" title="Control()"><code class="methodname">Control()</code></a>
function.</p><table class="variablelist returncodes"><thead><tr><th>Return Code</th><th>Description</th></tr></thead><tbody><tr><td><p><span class="term"><code class="constant">B_OK</code>.</span></p></td><td><p>Success.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_ERROR</code>.</span></p></td><td><p>Unspecified failure.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_NOT_A_DIRECTORY</code>.</span></p></td><td><p>You're trying to monitor a node that isn't a
directory.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_BAD_VALUE</code>.</span></p></td><td><p><code class="parameter">deviceDir</code> not found.</p></td></tr></tbody></table></div></div></div><div id="footer"><hr /><div id="footerT">Prev: <a href="BInputDevice.html">BInputDevice</a>  Up: <a href="TheInputServer.html">The Input Server</a>  Next: <a href="BInputServerFilter.html">BInputServerFilter</a> </div><div id="footerB"><div id="footerBL"><a href="BInputDevice.html" title="BInputDevice"><img src="./images/navigation/prev.png" alt="Prev" /></a> <a href="TheInputServer.html" title="The Input Server"><img src="./images/navigation/up.png" alt="Up" /></a> <a href="BInputServerFilter.html" title="BInputServerFilter"><img src="./images/navigation/next.png" alt="Next" /></a></div><div id="footerBR"><div><a href="http://www.haiku-os.org"><img src="./images/People_24.png" alt="haiku-os.org" title="Visit The Haiku Website" /></a></div><div class="navighome" title="Home"><a accesskey="h" href="index.html"><img src="./images/navigation/home.png" alt="Home" /></a></div></div><div id="footerBC"><a href="http://www.access-company.com/home.html" title="ACCESS Co."><img alt="Access Company" src="./images/access_logo.png" /></a></div></div></div><div id="licenseFooter"><div id="licenseFooterBL"><a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/" title="Creative Commons License"><img alt="Creative Commons License" style="border-width:0" src="https://licensebuttons.net/l/by-nc-nd/3.0/88x31.png" /></a></div><div id="licenseFooterBR"><a href="./LegalNotice.html">Legal Notice</a></div><div id="licenseFooterBC"><span id="licenseText">This work is licensed under a
<a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/">Creative
Commons Attribution-Non commercial-No Derivative Works 3.0 License</a>.</span></div></div></body></html>