Sophie

Sophie

distrib > CentOS > 5 > x86_64 > by-pkgid > ac91357d6caede925de099a02fced14e > files > 4968

qt4-doc-4.2.1-1.el5_7.1.x86_64.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /tmp/qt-4.2.1-harald-1161357942206/qt-x11-opensource-src-4.2.1/doc/src/emb-charinput.qdoc -->
<head>
  <title>Qt 4.2: Character Input</title>
  <link rel="contents" href="qtopiacore.html" />
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><p>
[<a href="qtopiacore.html">Contents</a>]
</p>
<h1 align="center">Character Input<br /><small></small></h1>
<p>When running a Qtopia Core application, it either runs as a server or connects to an existing server. Internally in the client/server protocol, each key press and key release is sent as a <a href="qwsevent.html">QWSKeyEvent</a> object to the server.</p>
<p>A key event can be generated from a keyboard driver. A keyboard driver reads data from a device, finds out which keys were pressed, and then calls the static <a href="qwsserver.html#processKeyEvent">QWSServer::processKeyEvent</a>() function with the key information. But key events do not always come from a keyboard device, they can can also be generated by the server process.</p>
<p><table align="center" cellpadding="2" cellspacing="1" border="0">
<tr valign="top" class="odd"><td><b>Input Widgets</b><p>The server process may call the static <a href="qwsserver.html#sendKeyEvent">QWSServer::sendKeyEvent</a>() function at any time. Typically, this is done by popping up a widget, and letting the user specify characters with the pointer device.</p>
<p>Note that the key input widget should not take focus, since the server would then just send the key events back to the input widget. One way to make sure that the input widget never takes focus is to set the <a href="qt.html#WindowType-enum">Qt::Tool</a> widget flag in the <a href="qwidget.html">QWidget</a> constructor.</p>
<p>The <a href="http://www.trolltech.com/products/qtopia/">Qtopia</a> environment contains various input widgets such as Handwriting Recognition and Virtual Keyboard.</p>
</td></tr>
</table></p>
<p>The various keyboard drivers can be compiled into the library or loaded as plugins, and enabled and disabled using the <tt>configure</tt> script. For example:</p>
<pre> configure -qt-kbd-s15000</pre>
<p>Run <tt>./configure -help</tt> to list the available keyboard drivers. In the default Qt configuration, only the &quot;tyy&quot; driver is enabled.</p>
<ul><li><a href="#available-keyboard-drivers">Available Keyboard Drivers</a></li>
<li><a href="#specifying-a-keyboard-driver">Specifying a Keyboard Driver</a></li>
</ul>
<a name="available-keyboard-drivers"></a>
<h2>Available Keyboard Drivers</h2>
<p>Qtopia Core provides drivers for the SL5000, Yopy, Vr41XX, console (TTY) and USB protocols.</p>
<p>Note that the console keyboard driver also handles console switching (<b>Ctrl+Alt+F1</b>, ..., <b>Ctrl+Alt+F10</b>) and termination (<b>Ctrl+Alt+Backspace</b>).</p>
<p>Other drivers can be added by deriving from the <a href="qwskeyboardhandler.html">QWSKeyboardHandler</a> and <a href="qkbddriverplugin.html">QKbdDriverPlugin</a> classes and using Qt's plugin mechanism.</p>
<a name="specifying-a-keyboard-driver"></a>
<h2>Specifying a Keyboard Driver</h2>
<p>To specify which driver to use, set the <a href="qtopiacore-envvars.html#qws-keyboard">QWS_KEYBOARD</a> environment variable. For example (if the current shell is bash, ksh, zsh or sh):</p>
<pre>  export QWS_KEYBOARD=&lt;driver&gt;:&lt;device&gt;</pre>
<p>The <tt>&lt;driver&gt;</tt> argument is either <tt>SL5000</tt>, <tt>Yopy</tt>, <tt>VR41xx</tt>, <tt>TTY</tt> or <tt>USB</tt>, and the <tt>&lt;device&gt;</tt> argument is typically <tt>/dev/tty0</tt>. Note that the latter argument is optional.</p>
<p>Multiple keyboard drivers can be specified in one go:</p>
<pre>  export QWS_KEYBOARD=&quot;&lt;driver&gt; &lt;driver&gt; &lt;driver&gt;:&lt;device&gt;&quot;</pre>
<p>Input will be read from all of specified drivers.</p>
<p>
[<a href="qtopiacore.html">Contents</a>]
</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2006 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.2.1</div></td>
</tr></table></div></address></body>
</html>