30 lines
9.3 KiB
HTML
30 lines
9.3 KiB
HTML
<?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 - Special Topics - The Keyboard</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="TheKeyboard.html" title="The Keyboard" /><link rel="prev" href="TheKeyboard_MoreOnKeyboardMapping.html" title="More On Keyboard Mapping" /><link rel="next" href="TheKeyboard_JourneyOfAKeystroke.html" title="Journey Of A Keystroke" /></head><body><div id="header"><div id="headerT"><div id="headerTL"><a accesskey="p" href="TheKeyboard_MoreOnKeyboardMapping.html" title="More On Keyboard Mapping"><img src="./images/navigation/prev.png" alt="Prev" /></a> <a accesskey="u" href="TheKeyboard.html" title="The Keyboard"><img src="./images/navigation/up.png" alt="Up" /></a> <a accesskey="n" href="TheKeyboard_JourneyOfAKeystroke.html" title="Journey Of A Keystroke"><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 - Special Topics - The Keyboard</div></div><div id="headerB">Prev: <a href="TheKeyboard_MoreOnKeyboardMapping.html">More On Keyboard Mapping</a> Up: <a href="TheKeyboard.html">The Keyboard</a> Next: <a href="TheKeyboard_JourneyOfAKeystroke.html">Journey Of A Keystroke</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="TheKeyboard_CharacterConstants"></a>Character Constants</h2></div></div></div><p>The Interface Kit defines constants for characters that aren't normally
|
||
represented by a visible symbol. This includes the usual space and
|
||
backspace characters, but most invisible characters are produced by the
|
||
function keys and the navigation keys located between the main keyboard
|
||
and the numeric keypad. The character values associated with these keys
|
||
are more or less arbitrary, so you should always use the constant in your
|
||
code rather than the actual character value. Many of these characters are
|
||
also produced by alphabetic keys when a <span class="keycap">Control</span> key is held down.</p><p>The table below lists character constants defined in the kit and the keys
|
||
they're associated with.</p><div class="informaltable"><table border="1"><colgroup><col /><col /><col /></colgroup><thead><tr><th>Key label</th><th>Key code</th><th>Character reported</th></tr></thead><tbody><tr><td>Backspace</td><td>0x1e</td><td><code class="constant">B_BACKSPACE</code></td></tr><tr><td>Tab</td><td>0x26</td><td><code class="constant">B_TAB</code></td></tr><tr><td>Enter</td><td>0x47</td><td><code class="constant">B_ENTER</code></td></tr><tr><td>space bar</td><td>0x5e</td><td><code class="constant">B_SPACE</code></td></tr><tr><td>Escape</td><td>0x01</td><td><code class="constant">B_ESCAPE</code></td></tr><tr><td>F1–F12 0x02 through</td><td>0x0d</td><td><code class="constant">B_FUNCTION_KEY</code></td></tr><tr><td>Print Screen</td><td>0x0e</td><td><code class="constant">B_FUNCTION_KEY</code></td></tr><tr><td>Scroll Lock</td><td>0x0f</td><td><code class="constant">B_FUNCTION_KEY</code></td></tr><tr><td>Pause</td><td>0x10</td><td><code class="constant">B_FUNCTION_KEY</code></td></tr><tr><td>System Request</td><td>0x7e</td><td>0xc8</td></tr><tr><td>Break</td><td>0x7f</td><td>0xca</td></tr><tr><td>Insert</td><td>0x1f</td><td><code class="constant">B_INSERT</code></td></tr><tr><td>Home</td><td>0x20</td><td><code class="constant">B_HOME</code></td></tr><tr><td>Page Up</td><td>0x21</td><td><code class="constant">B_PAGE_UP</code></td></tr><tr><td>Delete</td><td>0x34</td><td><code class="constant">B_DELETE</code></td></tr><tr><td>End</td><td>0x35</td><td><code class="constant">B_END</code></td></tr><tr><td>Page Down</td><td>0x36</td><td><code class="constant">B_PAGE_DOWN</code></td></tr><tr><td>up arrow</td><td>0x57</td><td><code class="constant">B_UP_ARROW</code></td></tr><tr><td>left arrow</td><td>0x61</td><td><code class="constant">B_LEFT_ARROW</code></td></tr><tr><td>down arrow</td><td>0x62</td><td><code class="constant">B_DOWN_ARROW</code></td></tr><tr><td>right arrow</td><td>0x63</td><td><code class="constant">B_RIGHT_ARROW</code></td></tr></tbody></table></div><p>Several keys are mapped to the <code class="constant">B_FUNCTION_KEY</code> character. An application
|
||
can determine which function key was pressed to produce the character by
|
||
testing the key code against these constants:</p><div class="informaltable"><table border="1"><colgroup><col /><col /><col /></colgroup><tbody><tr><td><code class="constant">B_F1_KEY</code></td><td><code class="constant">B_F6_KEY</code></td><td><code class="constant">B_F11_KEY</code></td></tr><tr><td><code class="constant">B_F2_KEY</code></td><td><code class="constant">B_F7_KEY</code></td><td><code class="constant">B_F12_KEY</code></td></tr><tr><td><code class="constant">B_F3_KEY</code></td><td><code class="constant">B_F8_KEY</code></td><td><code class="constant">B_PRINT_KEY</code> (the "Print Screen" key)</td></tr><tr><td><code class="constant">B_F4_KEY</code></td><td><code class="constant">B_F9_KEY</code></td><td><code class="constant">B_SCROLL_KEY</code> (the "Scroll Lock" key)</td></tr><tr><td><code class="constant">B_F5_KEY</code></td><td><code class="constant">B_F10_KEY</code></td><td><code class="constant">B_PAUSE_KEY</code></td></tr></tbody></table></div><p>Note that key 0x30 <span class="keycap">P</span> is also mapped to
|
||
<code class="constant">B_FUNCTION_KEY</code> when the <span class="keycap">Control</span>
|
||
key is held down.</p><p>Each of the character constants listed above is a one-byte value falling
|
||
in the range of values where <acronym class="acronym">ASCII</acronym> and
|
||
<span class="trademark">Unicode</span>™ overlap. For convenience,
|
||
the Interface Kit also defines some constants for common characters that
|
||
fall outside that range. These characters have multibyte representations
|
||
in <acronym class="acronym">UTF-8</acronym>, so the constant is defined as a character string. For example:</p><pre class="programlisting example cpp">#define <code class="constant">B_UTF8_OPEN_QUOTE</code> "xE2x80x9C"
|
||
#define <code class="constant">B_UTF8_CLOSE_QUOTE</code> "xE2x80x9D"
|
||
#define <code class="constant">B_UTF8_COPYRIGHT</code> "xC2xA9"</pre><p>See "<a class="xref" href="TheInterfaceKit_GeneralConstants.html#Constants_Character" title="Character Constants">Character Constants</a>" in the
|
||
"<a class="xref" href="TheInterfaceKit_GeneralConstants.html" title="General Constants">General Constants</a>"
|
||
section of The Interface Kit for a full list of these
|
||
constants.</p></div><div id="footer"><hr /><div id="footerT">Prev: <a href="TheKeyboard_MoreOnKeyboardMapping.html">More On Keyboard Mapping</a> Up: <a href="TheKeyboard.html">The Keyboard</a> Next: <a href="TheKeyboard_JourneyOfAKeystroke.html">Journey Of A Keystroke</a> </div><div id="footerB"><div id="footerBL"><a href="TheKeyboard_MoreOnKeyboardMapping.html" title="More On Keyboard Mapping"><img src="./images/navigation/prev.png" alt="Prev" /></a> <a href="TheKeyboard.html" title="The Keyboard"><img src="./images/navigation/up.png" alt="Up" /></a> <a href="TheKeyboard_JourneyOfAKeystroke.html" title="Journey Of A Keystroke"><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>
|