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

76 lines
16 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 - 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="TheInputServer_Functions.html" title="Functions" /><link rel="next" href="TheInterfaceKit.html" title="The Interface Kit" /></head><body><div id="header"><div id="headerT"><div id="headerTL"><a accesskey="p" href="TheInputServer_Functions.html" title="Functions"><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="TheInterfaceKit.html" title="The Interface Kit"><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="TheInputServer_Functions.html">Functions</a>  Up: <a href="TheInputServer.html">The Input Server</a>  Next: <a href="TheInterfaceKit.html">The Interface Kit</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="TheInputServer_Messages"></a>Message Constants</h2></div></div></div><p>This section describes the messages that your Input Server objects are
expected to create and send, and that they're expected to respond to.</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="id966997"></a>Input Device Event Messages</h3></div></div></div><p>Declared in: <code class="filename">app/AppDefs.h</code></p><p>This section lists the event messages that a
<a class="link" href="BInputServerDevice.html" title="BInputServerDevice"><code class="classname">BInputServerDevice</code></a>
is expected to create and send through its
<a class="link" href="BInputServerDevice.html#BInputServerDevice_EnqueueMessage" title="EnqueueMessage()"><code class="methodname">EnqueueMessage()</code></a>
function.</p><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="PointingDeviceEventMessages"></a>Pointing Device Event Messages</h4></div></div></div><ul class="itemizedlist nomarker"><li><a class="link" href="TheInterfaceKit_MessageConstants.html#B_MOUSE_DOWN" title="B_MOUSE_DOWN"><code class="constant">B_MOUSE_DOWN</code></a></li><li><a class="link" href="TheInterfaceKit_MessageConstants.html#B_MOUSE_UP" title="B_MOUSE_UP"><code class="constant">B_MOUSE_UP</code></a></li><li><a class="link" href="TheInterfaceKit_MessageConstants.html#B_MOUSE_MOVED" title="B_MOUSE_MOVED"><code class="constant">B_MOUSE_MOVED</code></a></li></ul><p>Note that a pointing device isn't expected to send the
<code class="constant">B_MOUSE_ENTER_EXIT</code> message.</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="KeyboardDeviceEventMessages"></a>Keyboard Device Event Messages</h4></div></div></div><ul class="itemizedlist nomarker"><li><code class="constant">B_KEY_DOWN</code></li><li><code class="constant">B_UNMAPPED_KEY_DOWN</code></li><li><code class="constant">B_KEY_UP</code></li><li><code class="constant">B_UMAPPED_KEY_UP</code></li><li><code class="constant">B_MODIFIERS_CHANGED</code></li></ul></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="InputDeviceControlMessages"></a>Input Device Control Messages</h3></div></div></div><p>Declared in:
<code class="filename">add-ons/input_server/InputServerDevice.h</code></p><p>This section lists the control messages that are defined by the BeOS for
pointing and keyboard devices. These are messages that appear in the
<a class="link" href="BInputServerDevice.html#BInputServerDevice_Control" title="Control()"><code class="methodname">BInputServerDevice::Control()</code></a>
function. Each control message is
identified by the value that appears as the command argument in the
<a class="link" href="BInputDevice.html#BInputDevice_Control" title="Control()"><code class="methodname">Control()</code></a>
function. None of the Be-defined control messages use the
additional
<a class="link" href="BMessage.html" title="BMessage"><code class="classname">BMessage</code></a>
argument.</p><p>Control messages are used to notify input devices of downstream requests.
For example, when the user changes the mouse speed, a
<code class="constant">B_MOUSE_SPEED_CHANGED</code> command is sent back upstream. It's expected that
an input device that receives this message will tune subsequent event
messages that it generates to match the requested mouse speed.</p><p>The messages listed below are defined by the BeOS; you can send custom
control messages back upstream through the
<code class="methodname">BInput::Control()</code>
function. Of course, this is only effective if you install a custom input
device that can handle the messages.</p><p>Note that the Be-defined control messages ask a device to set parameters
(such as mouse speed), but they never ask a device for the value of a
parameter. For example, a pointing device is never asked what the mouse
speed is. This is because the Input Server maintains the state of the
keyboard and pointing device environments and can answer these requests
itself.</p><p>Furthermore, the Be-defined control messages don't contain the value of
the parameter that's being set. For example, the
<code class="constant">B_MOUSE_SPEED_CHANGED</code>
message doesn't contain the requested mouse speed. The input device must
ask the Input Server for the new value through a global function
(<a class="link" href="TheInputServer_Functions.html#get_mouse_speed"><code class="function">get_mouse_speed()</code></a>,
in this case). The functions that correspond to the
messages are listed in the descriptions below.</p><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="PointingDeviceControlMessages"></a>Pointing Device Control Messages</h4></div></div></div><table class="variablelist constants"><thead><tr><th>Constant</th><th>Description</th></tr></thead><tbody><tr><td><p><span class="term"><code class="constant">B_CLICK_SPEED_CHANGED</code></span></p></td><td><p>Requests that the receiver change the mouse double-click speed to the
value retrieved through
<a class="link" href="TheInputServer_Functions.html#get_click_speed"><code class="function">get_click_speed()</code></a>.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_MOUSE_MAP_CHANGED</code></span></p></td><td><p>Requests that the receiver change the mouse map (the correspondence
between physical mouse buttons and the <code class="constant">B_PRIMARY_MOUSE_BUTTON</code>, et. al.,
constants) to the map retrieved through
<a class="link" href="TheInputServer_Functions.html#get_mouse_map"><code class="function">get_mouse_map()</code></a>.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_MOUSE_SPEED_CHANGED</code></span></p></td><td><p>Requests that the receiver change the mouse speed to the value retrieved
through
<a class="link" href="TheInputServer_Functions.html#get_mouse_speed"><code class="function">get_mouse_speed()</code></a>.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_MOUSE_TYPE_CHANGED</code></span></p></td><td><p>Requests that the receiver change the mouse type (the number of buttons)
to the type retrieved through
<a class="link" href="TheInputServer_Functions.html#get_mouse_type"><code class="function">get_mouse_type()</code></a>.</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="KeyboardDeviceControlMessages"></a>Keyboard Device Control Messages</h4></div></div></div><table class="variablelist constants"><thead><tr><th>Constant</th><th>Description</th></tr></thead><tbody><tr><td><p><span class="term"><code class="constant">B_KEY_LOCKS_CHANGED</code></span></p></td><td><p>Requests that the receiver change the state of the locked keys (caps
lock, num lock, etc.). To get the desired state of the locking keys, read
the states out of the key map returned by
<a class="link" href="TheInputServer_Functions.html#get_key_map" title="get_key_map()"><code class="function">get_key_map()</code></a>.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_KEY_MAP_CHANGED</code></span></p></td><td><p>Requests that the receiver change the keyboard's key map—the
mapping between physical keys and the character codes they generate. The
new key map is returned by
<a class="link" href="TheInputServer_Functions.html#get_key_map" title="get_key_map()"><code class="function">get_key_map()</code></a>.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_KEY_REPEAT_DELAY_CHANGED</code></span></p></td><td><p>Requests that the receiver change the delay before a held key starts
generating repeated characters to the value retrieved through
<a class="link" href="TheInputServer_Functions.html#get_key_repeat_delay"><code class="function">get_key_repeat_delay()</code></a>.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_KEY_REPEAT_RATE_CHANGED</code></span></p></td><td><p>Requests that the receiver change the speed at which a held key generates
repeated characters to the value retrieved through
<a class="link" href="TheInputServer_Functions.html#get_key_repeat_rate"><code class="function">get_key_repeat_rate()</code></a>.</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="DeviceMonitoring"></a>Device Monitoring</h4></div></div></div><p>The <a class="link" href="BInputDevice.html#watch_input_devices" title="watch_input_devices()"><code class="function">watch_input_devices()</code></a>
function lets you ask the Input Server to send
you a message when a device starts or stops, or when the set of
registered devices changes. These "device monitoring" notifications are
sent to the target specified in the function. The command constant is
always <code class="constant">B_INPUT_DEVICES_CHANGED.</code>
The <code class="varname">be:opcode</code> field will be one of:</p><table class="variablelist constants"><thead><tr><th>Constant</th><th>Description</th></tr></thead><tbody><tr><td><p><span class="term"><code class="constant">B_INPUT_DEVICE_ADDED</code></span></p></td><td><p>An input device has been added to the system.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_INPUT_DEVICE_REMOVED</code></span></p></td><td><p>An input device has been removed from the system.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_INPUT_DEVICE_STARTED</code></span></p></td><td><p>An input device has been started.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_INPUT_DEVICE_STOPPED</code></span></p></td><td><p>An input device has been stopped.</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="InputMethodEvents"></a>Input Method Events</h4></div></div></div><p>Active input methods send input method events
(<code class="constant">B_INPUT_METHOD_EVENT</code>
messages) downstream to application views to help integrate the method's
work with the view's display. Inside each
<code class="constant">B_INPUT_METHOD_EVENT</code> message is
a <code class="varname">be:opcode</code> field indicating the type of
input method event:</p><table class="variablelist constants"><thead><tr><th>Constant</th><th>Description</th></tr></thead><tbody><tr><td><p><span class="term"><code class="constant">B_INPUT_METHOD_CHANGED</code></span></p></td><td><p>Sent whenever the user changes the text during an input transaction.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_INPUT_METHOD_LOCATION_REQUEST</code></span></p></td><td><p>Sent whenever the input method needs to know the on-screen locations of
characters in the input transaction.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_INPUT_METHOD_STARTED</code></span></p></td><td><p>Sent when a new input transaction is beginning.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_INPUT_METHOD_STOPPED</code></span></p></td><td><p>Sent when an input transaction is completed.</p></td></tr></tbody></table></div></div></div><div id="footer"><hr /><div id="footerT">Prev: <a href="TheInputServer_Functions.html">Functions</a>  Up: <a href="TheInputServer.html">The Input Server</a>  Next: <a href="TheInterfaceKit.html">The Interface Kit</a> </div><div id="footerB"><div id="footerBL"><a href="TheInputServer_Functions.html" title="Functions"><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="TheInterfaceKit.html" title="The Interface Kit"><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>