haiku-website/static/legacy-docs/bebook/BInputServerFilter_Overview...

46 lines
8.8 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.

<?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 - System Overview - 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_Overview.html" title="The Input Server" /><link rel="prev" href="BInputServerDevice_Overview.html" title="BInputServerDevice" /><link rel="next" href="BInputServerMethod_Overview.html" title="BInputServerMethod" /></head><body><div id="header"><div id="headerT"><div id="headerTL"><a accesskey="p" href="BInputServerDevice_Overview.html" title="BInputServerDevice"><img src="./images/navigation/prev.png" alt="Prev" /></a> <a accesskey="u" href="TheInputServer_Overview.html" title="The Input Server"><img src="./images/navigation/up.png" alt="Up" /></a> <a accesskey="n" href="BInputServerMethod_Overview.html" title="BInputServerMethod"><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 - System Overview - The Input Server</div></div><div id="headerB">Prev: <a href="BInputServerDevice_Overview.html">BInputServerDevice</a>  Up: <a href="TheInputServer_Overview.html">The Input Server</a>  Next: <a href="BInputServerMethod_Overview.html">BInputServerMethod</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="BInputServerFilter_Overview"></a>BInputServerFilter</h2></div></div></div><p><a class="link" href="BInputServerFilter.html" title="BInputServerFilter"><code class="classname">BInputServerFilter</code></a>
is a base class for input filters; these are instances
of <a class="link" href="BInputServerFilter.html" title="BInputServerFilter"><code class="classname">BInputServerFilter</code></a>
that modify, generate, or eat input events. An
input filter add-on is privy to all the events that pass through the
Input Server's event stream. A filter is similar to the Interface Kit's
<a class="link" href="BMessageFilter.html" title="BMessageFilter"><code class="classname">BMessageFilter</code></a>,
but at a much lower level. The
<a class="link" href="BInputServerFilter.html" title="BInputServerFilter"><code class="classname">BInputServerFilter</code></a>
also sees all events, while a
<a class="link" href="BMessageFilter.html" title="BMessageFilter"><code class="classname">BMessageFilter</code></a>
only sees the events targeted at its
<a class="link" href="BLooper.html" title="BLooper"><code class="classname">BLooper</code></a>.
<a class="link" href="BMessageFilter.html" title="BMessageFilter"><code class="classname">BMessageFilter</code></a>s
can also generate additional events in
place of, or in addition to, the original input event.</p><p><a class="link" href="BInputServerFilter.html" title="BInputServerFilter"><code class="classname">BInputServerFilter</code></a>
objects are created and deleted by the Input Server
only—you never create or delete these objects in your code.</p><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="BInputServerFilter_Overview_Creating"></a>Creating</h3></div></div></div><p>To create a new input filter, you must:</p><ul class="itemizedlist"><li><p>create a subclass of
<a class="link" href="BInputServerFilter.html" title="BInputServerFilter"><code class="classname">BInputServerFilter</code></a></p></li><li><p>implement the
<a class="link" href="TheInputServer_Functions.html#instantiate_input_filter" title="instantiate_input_filter()"><code class="function">instantiate_input_filter()</code></a>
C function to create an instance of your
<a class="link" href="BInputServerFilter.html" title="BInputServerFilter"><code class="classname">BInputServerFilter</code></a>
subclass</p></li><li><p>compile the class and function as an add-on</p></li><li><p>install the add-on in one of the input filter directories</p></li></ul><p>At boot time (or whenever the Input Server is restarted; see
"<a class="xref" href="TheInputServer_Introduction.html#TheInputServer_Introduction_Loading" title="Loading">Loading</a>" in
The Input Server), the Input Server loads the add-ons it finds in the
input filter directories. For each add-on it finds, the Server invokes
<a class="link" href="TheInputServer_Functions.html#instantiate_input_filter" title="instantiate_input_filter()"><code class="function">instantiate_input_filter()</code></a>
to get a pointer to the add-ons's
<a class="link" href="BInputServerFilter.html" title="BInputServerFilter"><code class="classname">BInputServerFilter</code></a>
object. After constructing the object, the Server calls
<a class="link" href="BInputServerFilter.html#BInputServerFilter_InitCheck" title="InitCheck()"><code class="methodname">InitCheck()</code></a>
to give the add-on a chance to bail out if the constructor failed.</p></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="BInputServerFilter_Overview_Installing_An_Input_Filter"></a>Installing an Input Filter</h3></div></div></div><p>The input server looks for input filters in the
<code class="filename">input_server/filters</code>
subdirectories of <code class="constant">B_BEOS_ADDONS_DIRECTORY</code>,
<code class="constant">B_COMMON_ADDONS_DIRECTORY</code>, and
<code class="constant">B_USER_ADDONS_DIRECTORY</code>.</p><ul class="itemizedlist"><li><p>You can install your input devices in the latter two
directories—i.e. those under <code class="constant">B_COMMON_ADDONS_DIRECTORY</code>, and
<code class="constant">B_USER_ADDONS_DIRECTORY</code>.</p></li><li><p>The <code class="constant">B_BEOS_ADDONS_DIRECTORY</code> is reserved for add-ons that are supplied
with BeOS.</p></li></ul></div></div><div id="footer"><hr /><div id="footerT">Prev: <a href="BInputServerDevice_Overview.html">BInputServerDevice</a>  Up: <a href="TheInputServer_Overview.html">The Input Server</a>  Next: <a href="BInputServerMethod_Overview.html">BInputServerMethod</a> </div><div id="footerB"><div id="footerBL"><a href="BInputServerDevice_Overview.html" title="BInputServerDevice"><img src="./images/navigation/prev.png" alt="Prev" /></a> <a href="TheInputServer_Overview.html" title="The Input Server"><img src="./images/navigation/up.png" alt="Up" /></a> <a href="BInputServerMethod_Overview.html" title="BInputServerMethod"><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>