[Feature] Added stub guide and tutorial. Added links on "main" pages to navigate to new added input device doc.
Change-Id: Ie9caf7bc51e084765a2b80843a75af3485b36005
Signed-off-by: Piotr Kosko <p.kosko@samsung.com>
<ul>
<li><a href="web/tizen/ui/badge_w.htm">Badge</a></li>
<li><a href="web/tizen/ui/noti_w.htm">Notification</a></li>
+ <li><a href="web/tizen/ui/inputdevice_w.htm">Input Device</a></li>
</ul>
</li>
<li><a href="web/tizen/social/social_guide_w.htm">Social</a>
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+ <meta http-equiv="X-UA-Compatible" content="IE=9" />
+ <link rel="stylesheet" type="text/css" href="../../../css/styles.css" />
+ <link rel="stylesheet" type="text/css" href="../../../css/snippet.css" />
+ <script type="text/javascript" src="../../../scripts/snippet.js"></script>
+ <script type="text/javascript" src="../../../scripts/jquery.util.js" charset="utf-8"></script>
+ <script type="text/javascript" src="../../../scripts/common.js" charset="utf-8"></script>
+ <script type="text/javascript" src="../../../scripts/core.js" charset="utf-8"></script>
+ <script type="text/javascript" src="../../../scripts/search.js" charset="utf-8"></script>
+ <title>Input Device</title>
+ </head>
+ <body onload="prettyPrint()" style="overflow: auto;">
+
+ <div id="toc-navigation">
+ <div id="profile">
+ <p><img alt="Mobile Web" src="../../../images/mw_icon.png"/> <img alt="Wearable Web" src="../../../images/ww_icon.png"/></p>
+ </div>
+
+ <div id="toc_border"><div id="toc">
+ <p class="toc-title">Related Info</p>
+ <ul class="toc">
+ <li><a href="../../../../../org.tizen.tutorials/html/web/tizen/ui/inputdevice_tutorial_w.htm">InputDevice Tutorial</a></li>
+ <li><a href="../../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/inputdevice.html">InputDevice API for Mobile Web</a></li>
+ <li><a href="../../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/inputdevice.html">InputDevice API for Wearable Web</a></li>
+ </ul>
+ </div></div>
+</div>
+
+<div id="container"><div id="contents"><div class="content">
+<h1>Input Device</h1>
+<!-- TODO changed this content for inputdevice plugin
+ <p>Tizen enables you to operate on the zip archive files.</p>
+
+ <table class="note">
+ <tbody>
+ <tr>
+ <th class="note">Note</th>
+ </tr>
+ <tr>
+ <td class="note">The Archive API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices.
+<p>The Archive API is supported on all Tizen Emulators.</p></td>
+ </tr>
+ </tbody>
+ </table>
+
+ <p>To use the Archive API, your application must have the following privileges:</p>
+ <ul><li><a href="http://tizen.org/privilege/filesystem.read" target="blank">http://tizen.org/privilege/filesystem.read</a></li>
+ <li><a href="http://tizen.org/privilege/filesystem.write" target="blank">http://tizen.org/privilege/filesystem.write</a></li></ul>
+
+ <p>The main features of the Archive API include:</p>
+ <ul>
+ <li>Accessing archive content <p>You can <a href="../../../../../org.tizen.tutorials/html/web/tizen/input_output/archive_tutorial_w.htm#read">read the content of an archive file</a> using the <span style="font-family: Courier New,Courier,monospace">ArchiveFile</span> interface (in <a href="../../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/archive.html#ArchiveFile">mobile</a> and <a href="../../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/archive.html#ArchiveFile">wearable</a> applications).</p> </li>
+ <li>Creating new archives<p>You can <a href="../../../../../org.tizen.tutorials/html/web/tizen/input_output/archive_tutorial_w.htm#create">create archive files and add files into them</a> using the <span style="font-family: Courier New,Courier,monospace">ArchiveFile</span> interface.</p> </li>
+ <li>Extracting archived files<p>You can <a href="../../../../../org.tizen.tutorials/html/web/tizen/input_output/archive_tutorial_w.htm#extract">extract a single file or all files from an archive file</a> using the <span style="font-family: Courier New,Courier,monospace">ArchiveFile</span> interface.</p> </li>
+ <li>Aborting operations<p>You can abort an on-going archive operation using the operation ID and the <span style="font-family: Courier New,Courier,monospace">abort()</span> method of the <span style="font-family: Courier New,Courier,monospace">ArchiveManager </span> interface.</p>
+ <p>You can abort the operations for the <span style="font-family: Courier New,Courier,monospace">open()</span>, <span style="font-family: Courier New,Courier,monospace">add()</span>, <span style="font-family: Courier New,Courier,monospace">extractAll()</span>, <span style="font-family: Courier New,Courier,monospace">getEntries()</span>, <span style="font-family: Courier New,Courier,monospace">getEntryByName()</span>, and <span style="font-family: Courier New,Courier,monospace">extract()</span> methods.</p></li>
+ </ul>
+
+
+ <p>To start any kind of zip operation (packing or unpacking), you must first call the <span style="font-family: Courier New,Courier,monospace">open()</span> method of the <span style="font-family: Courier New,Courier,monospace">ArchiveManager</span> interface (in <a href="../../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/archive.html#ArchiveManager">mobile</a> and <a href="../../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/archive.html#ArchiveManager">wearable</a> applications). The first parameter of is a <span style="font-family: Courier New,Courier,monospace">FileReference</span> object (in <a href="../../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/archive.html#FileReference">mobile</a> and <a href="../../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/archive.html#FileReference">wearable</a> applications), which can be a <span style="font-family: Courier New,Courier,monospace">File</span> object (in <a href="../../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/filesystem.html#File">mobile</a> and <a href="../../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/filesystem.html#File">wearable</a> applications) or the virtual path. The second parameter is a <span style="font-family: Courier New,Courier,monospace">FileMode</span> enumerator (in <a href="../../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/filesystem.html#FileMode">mobile</a> and <a href="../../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/filesystem.html#FileMode">wearable</a> applications), whose values are described in the following table.</p>
+
+
+ <table border="1" style="width: 100%">
+ <caption>
+ Table: File modes
+ </caption>
+ <tbody>
+ <tr>
+ <th>Mode</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td><span style="font-family: Courier New,Courier,monospace">r</span></td>
+ <td>Use this mode to extract or get information about the archive file content.
+ <p>The file must exist, or the <span style="font-family: Courier New,Courier,monospace">NotFoundError</span> exception occurs.</p>
+ <p>When the archive file is opened in this mode, the <span style="font-family: Courier New,Courier,monospace">add()</span> method is not available.</p></td>
+ </tr>
+ <tr>
+ <td><span style="font-family: Courier New,Courier,monospace">w</span></td>
+ <td>Use this mode to create an archive file and add files to it.
+ <p>If the file does not exist, it is created. If it exists and the <span style="font-family: Courier New,Courier,monospace">overwrite</span> option is <span style="font-family: Courier New,Courier,monospace">true</span>, the existing file is overwritten with an empty archive. If the file exists and the <span style="font-family: Courier New,Courier,monospace">overwrite</span> option is <span style="font-family: Courier New,Courier,monospace">false</span>, the error callback is invoked.</p>
+ <p>When the archive file is opened in this mode, the <span style="font-family: Courier New,Courier,monospace">getEntries()</span>, <span style="font-family: Courier New,Courier,monospace">getEntryByName()</span>, and <span style="font-family: Courier New,Courier,monospace">extractAll()</span> methods are not available.</p></td>
+ </tr>
+ <tr>
+ <td><span style="font-family: Courier New,Courier,monospace">rw</span></td>
+ <td>Use this mode to zip or unzip an archive file.
+ <p>If the file does not exist, it is created. If it exists and the <span style="font-family: Courier New,Courier,monospace">overwrite</span> option is <span style="font-family: Courier New,Courier,monospace">true</span>, the existing file is overwritten with an empty archive. If the file exists and the <span style="font-family: Courier New,Courier,monospace">overwrite</span> option is <span style="font-family: Courier New,Courier,monospace">false</span>, the existing content is preserved, and both adding and extracting are available.</p></td>
+ </tr>
+ <tr>
+ <td><span style="font-family: Courier New,Courier,monospace">a</span></td>
+ <td>Use this mode to add new files to an archive file.
+ <p>If the file does not exist, it is created. If it exists, the previous content of the archive file is preserved and new files can be added.</p>
+ <p>When the archive file is opened in this mode, the <span style="font-family: Courier New,Courier,monospace">getEntries()</span>, <span style="font-family: Courier New,Courier,monospace">getEntryByName()</span>, and <span style="font-family: Courier New,Courier,monospace">extractAll()</span> methods are not available.</p></td>
+ </tr>
+ </tbody>
+ </table>
+
+ -->
+
+<script type="text/javascript" src="../../../scripts/jquery.zclip.min.js"></script>
+<script type="text/javascript" src="../../../scripts/showhide.js"></script>
+</div></div></div>
+
+<a class="top sms" href="#"><img src="../../../images/btn_top.gif" alt="Go to top" /></a>
+
+<div id="footer">
+<p class="footer">Except as noted, this content - excluding the Code Examples - is licensed under <a href="http://creativecommons.org/licenses/by/3.0/legalcode" target="_blank">Creative Commons Attribution 3.0</a> and all of the Code Examples contained herein are licensed under <a href="https://www.tizen.org/bsd-3-clause-license" target="_blank">BSD-3-Clause</a>.<br/>For details, see the <a href="https://www.tizen.org/content-license" target="_blank">Content License</a>.</p>
+</div>
+
+<script type="text/javascript">
+var _gaq = _gaq || [];
+_gaq.push(['_setAccount', 'UA-25976949-1']);
+_gaq.push(['_trackPageview']);
+(function() {
+var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+})();
+</script>
+
+</body>
+</html>
<p>The main UI features are:</p>
<ul>
<li><a href="badge_w.htm">Badge</a> <p>Allows you to create and update badges on the home screen.</p></li>
- <li><a href="noti_w.htm">Notification</a> <p>Allows you to create and display different types of notifications.</p></li>
+ <li><a href="noti_w.htm">Notification</a> <p>Allows you to create and display different types of notifications.</p></li>
+ <li><a href="inputdevice_w.htm">Input Device</a> <p>Allows you to manage input keys in application.</p></li>
</ul>
<script type="text/javascript" src="../../../scripts/jquery.zclip.min.js"></script>
</script>
</body>
-</html>
\ No newline at end of file
+</html>
<li><a href="web/tizen/ui/ui_tutorials_w.htm">User Interface</a>
<ul>
<li><a href="web/tizen/ui/badge_tutorial_w.htm">Badge</a></li>
- <li><a href="web/tizen/ui/noti_tutorial_w.htm">Notification</a></li>
+ <li><a href="web/tizen/ui/noti_tutorial_w.htm">Notification</a></li>
+ <li><a href="web/tizen/ui/inputdevice_tutorial_w.htm">Input Device</a></li>
</ul>
</li>
<li><a href="web/tizen/social/social_tutorials_w.htm">Social</a>
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+ <meta http-equiv="X-UA-Compatible" content="IE=9" />
+ <link rel="stylesheet" type="text/css" href="../../../css/styles.css" />
+ <link rel="stylesheet" type="text/css" href="../../../css/snippet.css" />
+ <script type="text/javascript" src="../../../scripts/snippet.js"></script>
+ <script type="text/javascript" src="../../../scripts/jquery.util.js" charset="utf-8"></script>
+ <script type="text/javascript" src="../../../scripts/common.js" charset="utf-8"></script>
+ <script type="text/javascript" src="../../../scripts/core.js" charset="utf-8"></script>
+ <script type="text/javascript" src="../../../scripts/search.js" charset="utf-8"></script>
+
+ <title>Input Device: Managing input keys in application</title>
+</head>
+
+<body onload="prettyPrint()" style="overflow: auto;">
+
+<div id="toc-navigation">
+ <div id="profile">
+ <p><img alt="Mobile Web" src="../../../images/mw_icon.png"/> <img alt="Wearable Web" src="../../../images/ww_icon.png"/></p>
+ </div>
+ <div id="toc_border"><div id="toc">
+ <p class="toc-title">Content</p>
+ <ul class="toc">
+ <!-- TODO change internal links
+ <li><a href="#read">Reading the Content of an Archive</a></li>
+ <li><a href="#create">Creating an Archive</a></li>
+ <li><a href="#extract">Extracting Files from an Archive</a></li>-->
+ </ul>
+ <p class="toc-title">Related Info</p>
+ <ul class="toc">
+ <li><a href="../../../../../org.tizen.guides/html/web/tizen/ui/inputdevice_w.htm">InputDevice Guide</a></li>
+ <li><a href="../../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/inputdevice.html">InputDevice API for Mobile Web</a></li>
+ <li><a href="../../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/inputdevice.html">InputDevice API for Mobile Web</a></li>
+ </ul>
+ </div></div>
+</div>
+
+<div id="container"><div id="contents"><div class="content">
+<h1>Input Device: Example operations with InputDevice API</h1>
+
+<!-- TODO changed this content for inputdevice plugin
+<p>This tutorial demonstrates how you can create, browse, and extract ZIP archives.</p>
+
+ <table class="note">
+<tbody>
+ <tr>
+ <th class="note">Note</th>
+ </tr>
+ <tr>
+ <td class="note">The Archive API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices.
+<p>The Archive API is supported on all Tizen Emulators.</p></td>
+ </tr>
+ </tbody>
+ </table>
+
+<h2>Warm-up</h2>
+<p>Become familiar with the Archive API basics by learning about:</p>
+<ul>
+ <li><a href="#read">Reading the Content of an Archive</a> <p>Open an archive and check its content.</p> </li>
+ <li><a href="#create">Creating an Archive</a> <p>Create a new archive file and add files to it.</p> </li>
+ <li><a href="#extract">Extracting Files from an Archive</a> <p>Extract all files from an archive, or extract a selected file.</p></li>
+</ul>
+
+ <h2 id="read" name="read">Reading the Content of an Archive</h2>
+
+<p>Opening an archive and accessing a list of its members is a basic archive management skill:</p>
+<ol>
+<li><p>To access the archive file, use the <span style="font-family: Courier New,Courier,monospace">open()</span> method of the <span style="font-family: Courier New,Courier,monospace">ArchiveManager</span> interface (in <a href="../../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/archive.html#ArchiveManager">mobile</a> and <a href="../../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/archive.html#ArchiveManager">wearable</a> applications). The provided callback function receives an <span style="font-family: Courier New,Courier,monospace">ArchiveFile</span> object (in <a href="../../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/archive.html#ArchiveFile">mobile</a> and <a href="../../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/archive.html#ArchiveFile">wearable</a> applications).</p>
+
+<pre class="prettyprint">var myArchive = null;
+function openSuccess(arch)
+{
+ console.log("ArchiveFile mode: " + arch.mode);
+ myArchive = arch;
+}
+tizen.archive.open("downloads/archive.zip", "r", openSuccess); </pre> </li>
+
+<li> <p>Get the list of all files contained inside the archive using the <span style="font-family: Courier New,Courier,monospace">getEntries()</span> method of the <span style="font-family: Courier New,Courier,monospace">ArchiveFile</span> interface.</p>
+
+<pre class="prettyprint">
+function listSuccess(members)
+{
+ if (members.length === 0)
+ {
+ console.log("The archive is empty");
+ return;
+ }
+ console.log("Files in the archive:")
+ for (var i=0; i<members.length; i++)
+ {
+ console.log(members[i].name);
+ }
+}
+myArchive.getEntries(listSuccess);</pre>
+</li>
+<li><p>After the work with the archive is finished, close the archive using the <span style="font-family: Courier New,Courier,monospace">close()</span> method of the <span style="font-family: Courier New,Courier,monospace">ArchiveFile</span> interface.</p>
+
+<pre class="prettyprint">
+archive.close();</pre>
+</li>
+</ol>
+
+ <h2 id="create" name="create">Creating an Archive</h2>
+
+<p>Creating an archive and adding files to it is a basic archive management skill:</p>
+<ol>
+
+<li><p>To create the archive file, use the <span style="font-family: Courier New,Courier,monospace">open()</span> method of the <span style="font-family: Courier New,Courier,monospace">ArchiveManager</span> interface (in <a href="../../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/archive.html#ArchiveManager">mobile</a> and <a href="../../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/archive.html#ArchiveManager">wearable</a> applications) and set the mode as <span style="font-family: Courier New,Courier,monospace">w</span>:</p>
+
+<pre class="prettyprint">
+tizen.archive.open("downloads/new_archive.zip", "w", createSuccess);</pre>
+</li>
+
+<li>Add a file to the archive using the <span style="font-family: Courier New,Courier,monospace">add()</span> method. The file can be specified using a virtual path:
+
+
+<pre class="prettyprint">
+function progressCallback(opId, val, name)
+{
+ console.log("opId: " + opId + " with progress val: " + (val * 100).toFixed(0) + "%");
+}
+function successCallback()
+{
+ console.log("File added");
+}
+function createSuccess(archive)
+{
+ archive.add("downloads/file.txt", successCallback, null, progressCallback);
+}
+</pre>
+</li>
+</ol>
+
+ <h2 id="extract" name="extract">Extracting Files from an Archive</h2>
+
+<p>Extracting a file from an archive is a basic archive management skill:</p>
+
+<ol>
+<li>
+<p>To access an archive file, use the <span style="font-family: Courier New,Courier,monospace">open()</span> method of the <span style="font-family: Courier New,Courier,monospace">ArchiveManager</span> interface (in <a href="../../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/archive.html#ArchiveManager">mobile</a> and <a href="../../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/archive.html#ArchiveManager">wearable</a> applications). The "r" mode is suitable for extracting from the archive.</p>
+
+<pre class="prettyprint">
+tizen.archive.open("downloads/some_archive.zip", "r", openSuccess, openError);</pre>
+</li>
+
+<li>To extract files:
+<ul>
+<li>
+<p>To extract all files from the archive, use the <span style="font-family: Courier New,Courier,monospace">extractAll()</span> method of the <span style="font-family: Courier New,Courier,monospace">ArchiveFile</span> interface (in <a href="../../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/archive.html#ArchiveFile">mobile</a> and <a href="../../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/archive.html#ArchiveFile">wearable</a> applications).</p>
+
+<pre class="prettyprint">
+function progressCallback(opId, val, name)
+{
+ console.log("extracting operation (: " + opId + ") is in progress (" + (val * 100).toFixed(1) + "%)");
+}
+
+function openSuccess(archive)
+{
+ archive.extractAll("music", null, null, progressCallback);
+}</pre>
+</li>
+<li>
+<p>To extract only a selected file from the archive, use the <span style="font-family: Courier New,Courier,monospace">extract()</span> method of the <span style="font-family: Courier New,Courier,monospace">ArchiveFileEntry</span> interface (in <a href="../../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/archive.html#ArchiveFileEntry">mobile</a> and <a href="../../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/archive.html#ArchiveFileEntry">wearable</a> applications).</p>
+<p>First, get the <span style="font-family: Courier New,Courier,monospace">archiveFileEntry</span> object using the <span style="font-family: Courier New,Courier,monospace">getEntryByName()</span> or <span style="font-family: Courier New,Courier,monospace">getEntries()</span> method of the <span style="font-family: Courier New,Courier,monospace">ArchiveFile</span> interface.</p>
+
+<pre class="prettyprint">
+function extractSuccessCallback()
+{
+ console.log("File extracted");
+}
+function getEntrySuccess(entry)
+{
+ entry.extract("downloads/extract", extractSuccessCallback);
+}
+
+function openSuccess(archive)
+{
+ archive.getEntryByName("my_file.txt", getEntrySuccess);
+}</pre>
+</li>
+</ul>
+</li>
+</ol>
+-->
+<script type="text/javascript" src="../../../scripts/jquery.zclip.min.js"></script>
+<script type="text/javascript" src="../../../scripts/showhide.js"></script>
+
+</div></div></div>
+
+<a class="top sms" href="#"><img src="../../../images/btn_top.gif" alt="Go to top" /></a>
+
+<div id="footer">
+<p class="footer">Except as noted, this content - excluding the Code Examples - is licensed under <a href="http://creativecommons.org/licenses/by/3.0/legalcode" target="_blank">Creative Commons Attribution 3.0</a> and all of the Code Examples contained herein are licensed under <a href="https://www.tizen.org/bsd-3-clause-license" target="_blank">BSD-3-Clause</a>.<br/>For details, see the <a href="https://www.tizen.org/content-license" target="_blank">Content License</a>.</p>
+</div>
+
+<script type="text/javascript">
+var _gaq = _gaq || [];
+_gaq.push(['_setAccount', 'UA-25976949-1']);
+_gaq.push(['_trackPageview']);
+(function() {
+var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+})();
+</script>
+
+</body>
+</html>
<ul>
<li><a href="badge_tutorial_w.htm">Badge: Displaying the Notification (Badge) Count on the Home Screen</a> <p>Demonstrates how you can manage home screen badges.</p></li>
<li><a href="noti_tutorial_w.htm">Notification: Notifying Users of Application Events</a> <p>Demonstrates how you can manage notifications created based on application events.</p></li>
+ <li><a href="inputdevice_tutorial_w.htm">Input Device: Managing input keys in application</a> <p>Demonstrates how you can manage input keys in application.</p></li>
</ul>
<script type="text/javascript" src="../../../scripts/jquery.zclip.min.js"></script>
<td>Mandatory</td>
<td>Yes</td>
+ </tr><tr><td><a href="tizen/inputdevice.html" data-origin="tizen" data-domain="ui" data-category="core" data-status="D" data-version="">
+ Input Device</a></td>
+ <td>This API provides interfaces and methods to manage input keys in application.</td>
+ <td>2.4</td>
+ <td>Optional</td>
+ <td>No</td>
+
</tr></tbody></table><div id="footer">
<div class="copyright" align="center">
Except as noted, this content - excluding the Code Examples - is licensed under <a href="http://creativecommons.org/licenses/by/3.0/legalcode" target="_blank">Creative Commons Attribution 3.0</a> and all of the Code Examples contained herein are licensed under <a href="https://www.tizen.org/bsd-3-clause-license" target="_blank">BSD-3-Clause</a>. <br>For details, see the <a href="https://www.tizen.org/content-license" target="_blank">Content License</a>.
--- /dev/null
+<!DOCTYPE html PUBLIC "html">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel="stylesheet" type="text/css" href="tizen.css" media="screen">
+<script type="text/javascript" src="snippet.js"></script><title>InputDevice API</title>
+</head>
+<body id="page-content" onload="prettyPrint()">
+<div class="api" id="::InputDevice">
+<div class="title"><h1>InputDevice API</h1></div>
+<div class="brief">
+ The Input Device API provides functions to subscribe key events of the input device.
+ </div>
+<div class="description">
+ <p>
+The Tizen Device may provide depending on a particular input device.
+An application can handle device dependent key events after registration.
+ </p>
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.4
+ </p>
+<h2>Table of Contents</h2>
+<ul class="toc">
+<li>1. <a href="#typedefs-section">Type Definitions</a><ul class="toc"><li>1.1. <a href="#InputDeviceKeyName">InputDeviceKeyName</a>
+</li></ul>
+</li>
+<li>2. <a href="#interfaces-section">Interfaces</a><ul class="toc">
+<li>2.1. <a href="#InputDeviceManagerObject">InputDeviceManagerObject</a>
+</li>
+<li>2.2. <a href="#InputDeviceKey">InputDeviceKey</a>
+</li>
+<li>2.3. <a href="#InputDeviceManager">InputDeviceManager</a>
+</li>
+</ul>
+</li>
+<li>3. <a href="#full-webidl">Full WebIDL</a>
+</li>
+</ul>
+<hr>
+<h2 id="method-summary">Summary of Interfaces and Methods</h2>
+<table class="informaltable">
+<thead><tr>
+<th>Interface</th>
+<th>Method</th>
+</tr></thead>
+<tbody>
+<tr>
+<td><a href="#InputDeviceManagerObject">InputDeviceManagerObject</a></td>
+<td></td>
+</tr>
+<tr>
+<td><a href="#InputDeviceKey">InputDeviceKey</a></td>
+<td></td>
+</tr>
+<tr>
+<td><a href="#InputDeviceManager">InputDeviceManager</a></td>
+<td>
+<a href="#InputDeviceKey">InputDeviceKey</a>[] <a href="#InputDeviceManager::getSupportedKeys">getSupportedKeys</a> ()<br>
+ <a href="#InputDeviceKey">InputDeviceKey</a>? <a href="#InputDeviceManager::getKey">getKey</a> (<a href="#InputDeviceKeyName">InputDeviceKeyName</a> keyName)<br>
+ void <a href="#InputDeviceManager::registerKey">registerKey</a> (<a href="#InputDeviceKeyName">InputDeviceKeyName</a> keyName)<br>
+ void <a href="#InputDeviceManager::unregisterKey">unregisterKey</a> (<a href="#InputDeviceKeyName">InputDeviceKeyName</a> keyName)</td>
+</tr>
+</tbody>
+</table>
+<div class="typedefs" id="typedefs-section">
+<h2>1. Type Definitions</h2>
+<div class="typedef" id="InputDeviceKeyName">
+<a class="backward-compatibility-anchor" name="::InputDevice::InputDeviceKeyName"></a><h3>1.1. InputDeviceKeyName</h3>
+<div class="brief">
+ Name which identifies the key
+ </div>
+<pre class="webidl prettyprint"> typedef DOMString InputDeviceKeyName;</pre>
+<div class="description">
+ <p>
+Name of the key may be, for example:
+ </p>
+ <ul>
+ <li>
+VolumeUp </li>
+ <li>
+VolumeDown </li>
+ </ul>
+ <p>
+The actual list of supported keys depends on the platform.
+ </p>
+ </div>
+</div>
+</div>
+<div class="interfaces" id="interfaces-section">
+<h2>2. Interfaces</h2>
+<div class="interface" id="InputDeviceManagerObject">
+<a class="backward-compatibility-anchor" name="::InputDevice::InputDeviceManagerObject"></a><h3>2.1. InputDeviceManagerObject</h3>
+<div class="brief">
+ The InputDeviceManager interface defines what is instantiated in the tizen object.
+ </div>
+<pre class="webidl prettyprint"> [NoInterfaceObject] interface InputDeviceManagerObject {
+ readonly attribute <a href="#InputDeviceManager">InputDeviceManager</a> inputdevice;
+ };</pre>
+<pre class="webidl prettyprint"> <a href="tizen.html#Tizen">Tizen</a> implements <a href="#InputDeviceManagerObject">InputDeviceManagerObject</a>;</pre>
+<p><span class="version">
+ Since: </span>
+ 2.4
+ </p>
+<div class="description">
+ <p>
+There is a tizen.inputdevice object that allows accessing the functionality of the Input Device API.
+ </p>
+ </div>
+</div>
+<div class="interface" id="InputDeviceKey">
+<a class="backward-compatibility-anchor" name="::InputDevice::InputDeviceKey"></a><h3>2.2. InputDeviceKey</h3>
+<div class="brief">
+ The InputDeviceKey interface stores information about the key.
+ </div>
+<pre class="webidl prettyprint"> [NoInterfaceObject] interface InputDeviceKey {
+ readonly attribute <a href="#InputDeviceKeyName">InputDeviceKeyName</a> name;
+
+ readonly attribute long code;
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 2.4
+ </p>
+<div class="attributes">
+<h4>Attributes</h4>
+<ul>
+<li class="attribute" id="InputDeviceKey::name">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">InputDeviceKeyName </span><span class="name">name</span></span><div class="brief">
+ The name of the key, for example <var>"VolumeUp"</var> or <var>"VolumeDown"</var>.
+ </div>
+<div class="description">
+ <p>
+If the key is listed in the <a href="http://www.w3.org/TR/2014/WD-DOM-Level-3-Events-key-20140612">DOM Level 3 KeyboardEvent key Values</a> specification, the <em>name</em> attribute is equal to the <em>key value</em> specified there. (The <a href="http://www.w3.org/TR/2014/WD-DOM-Level-3-Events-key-20140612/#keys-media-controller">Media Controller Keys</a> section is the most relevant to the Input Device API)
+ </p>
+ <p>
+If the "DOM Level 3 KeyboardEvent key Value" does not contain appropriate entry for the key, then the Input Device provides a device specific <em>name</em>.
+ </p>
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.4
+ </p>
+</li>
+<li class="attribute" id="InputDeviceKey::code">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">long </span><span class="name">code</span></span><div class="brief">
+ The numeric code of the key, like <var>37</var> or <var>13</var>.
+ </div>
+<div class="description">
+ <p>
+This is the <em>keyCode</em> attribute value of the Key Event generated by the key.
+ </p>
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.4
+ </p>
+</li>
+</ul>
+</div>
+</div>
+<div class="interface" id="InputDeviceManager">
+<a class="backward-compatibility-anchor" name="::InputDevice::InputDeviceManager"></a><h3>2.3. InputDeviceManager</h3>
+<div class="brief">
+ The InputDeviceManager interface provides the features to check for availability and register for input device events.
+ </div>
+<pre class="webidl prettyprint"> [NoInterfaceObject] interface InputDeviceManager {
+ <a href="#InputDeviceKey">InputDeviceKey</a>[] getSupportedKeys() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ <a href="#InputDeviceKey">InputDeviceKey</a>? getKey(<a href="#InputDeviceKeyName">InputDeviceKeyName</a> keyName) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ void registerKey(<a href="#InputDeviceKeyName">InputDeviceKeyName</a> keyName) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ void unregisterKey(<a href="#InputDeviceKeyName">InputDeviceKeyName</a> keyName) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 2.4
+ </p>
+<div class="methods">
+<h4>Methods</h4>
+<dl>
+<dt class="method" id="InputDeviceManager::getSupportedKeys">
+<a class="backward-compatibility-anchor" name="::InputDevice::InputDeviceManager::getSupportedKeys"></a><code><b><span class="methodName">getSupportedKeys</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Retrieves the list of keys can be registered with the <em>registerKey()</em> method.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint"><a href="#InputDeviceKey">InputDeviceKey</a>[] getSupportedKeys();
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.4
+ </p>
+<div class="description">
+ <p>
+Mandatory keys will not be retrieved by this method.
+ </p>
+ </div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul><li class="list"><p>
+ with error type UnknownError in case of any error.
+ </p></li></ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var i, keyCode = {}, supportedKeys;
+ supportedKeys = tizen.inputdevice.getSupportedKeys();
+ for (i = 0; i < supportedKeys.length; i++) {
+ keyCode[supportedKeys[i].name] = supportedKeys[i].code;
+ }
+ if(keyCode.hasOwnProperty("VolumeUp")) {
+ tizen.inputdevice.registerKey("VolumeUp");
+ }
+ window.addEventListener("keydown", function(keyEvent) {
+ // identify the key by the numeric code from the keyEvent
+ if(keyEvent.keyCode === keyCode.VolumeUp) {
+ console.log("The VOLUME UP was pressed");
+ }
+ });
+
+ </pre>
+</div>
+</dd>
+<dt class="method" id="InputDeviceManager::getKey">
+<a class="backward-compatibility-anchor" name="::InputDevice::InputDeviceManager::getKey"></a><code><b><span class="methodName">getKey</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Returns information about the key which has the given name.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint"><a href="#InputDeviceKey">InputDeviceKey</a>? getKey(<a href="#InputDeviceKeyName">InputDeviceKeyName</a> keyName);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.4
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">keyName</span>:
+ The name of the key to retrieve
+ </li>
+ </ul>
+</div>
+<div class="returntype">
+<p><span class="return">Return value:</span></p>
+ InputDeviceKey InputDeviceKey object for the given key name, or null if the key is not supported
+ </div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type InvalidValuesError if the given keyName is invalid (e.g. name is empty string)
+ </p></li>
+<li class="list"><p>
+ with error type UnknownError in any other error case.
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+</dd>
+<dt class="method" id="InputDeviceManager::registerKey">
+<a class="backward-compatibility-anchor" name="::InputDevice::InputDeviceManager::registerKey"></a><code><b><span class="methodName">registerKey</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Registers an input device key to receive DOM keyboard event when it is pressed or released
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void registerKey(<a href="#InputDeviceKeyName">InputDeviceKeyName</a> keyName);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.4
+ </p>
+<div class="description">
+ <p>
+When an application wants to react to the Input Device keys being pressed, it should register this key.
+ </p>
+ <p>
+An application can not register the mandatory keys (ArrowLeft, ArrowRight, ArrowUp, ArrowDown, Enter, Back).
+ </p>
+ </div>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">keyName</span>:
+ The name of the key which should generate DOM key events when pressed
+ </li>
+ </ul>
+</div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type InvalidValuesError, if the given keyName is invalid or not supported (e.g. name is empty string).
+ </p></li>
+<li class="list"><p>
+ with error type UnknownError in any other error case.
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var keys = ["VolumeUp", "VolumeDown"], i;
+ for (i = 0; i < keys.length; i++) {
+ try {
+ tizen.inputdevice.registerKey(keys[i]);
+ } catch(error) {
+ console.log("failed to register " + keys[i] + ": " + error);
+ }
+ }
+ </pre>
+</div>
+</dd>
+<dt class="method" id="InputDeviceManager::unregisterKey">
+<a class="backward-compatibility-anchor" name="::InputDevice::InputDeviceManager::unregisterKey"></a><code><b><span class="methodName">unregisterKey</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Unregisters an input device key
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void unregisterKey(<a href="#InputDeviceKeyName">InputDeviceKeyName</a> keyName);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.4
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">keyName</span>:
+ The name of the key which should not be monitored any longer
+ </li>
+ </ul>
+</div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type InvalidValuesError, if the given keyName is invalid or not supported (e.g. name is empty string).
+ </p></li>
+<li class="list"><p>
+ with error type UnknownError in any error case.
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> tizen.inputdevice.unregisterKey("VolumeDown");
+ </pre>
+</div>
+</dd>
+</dl>
+</div>
+</div>
+</div>
+<h2 id="full-webidl">3. Full WebIDL</h2>
+<pre class="webidl prettyprint">module InputDevice {
+ typedef DOMString InputDeviceKeyName;
+
+ [NoInterfaceObject] interface InputDeviceManagerObject {
+ readonly attribute <a href="#InputDeviceManager">InputDeviceManager</a> inputdevice;
+ };
+ <a href="tizen.html#Tizen">Tizen</a> implements <a href="#InputDeviceManagerObject">InputDeviceManagerObject</a>;
+
+ [NoInterfaceObject] interface InputDeviceKey {
+ readonly attribute <a href="#InputDeviceKeyName">InputDeviceKeyName</a> name;
+
+ readonly attribute long code;
+ };
+
+ [NoInterfaceObject] interface InputDeviceManager {
+ <a href="#InputDeviceKey">InputDeviceKey</a>[] getSupportedKeys() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ <a href="#InputDeviceKey">InputDeviceKey</a>? getKey(<a href="#InputDeviceKeyName">InputDeviceKeyName</a> keyName) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ void registerKey(<a href="#InputDeviceKeyName">InputDeviceKeyName</a> keyName) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ void unregisterKey(<a href="#InputDeviceKeyName">InputDeviceKeyName</a> keyName) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ };
+
+};</pre>
+</div>
+<div id="page-footer">
+<div class="copyright" align="center">
+ Except as noted, this content - excluding the Code Examples - is licensed under <a href="http://creativecommons.org/licenses/by/3.0/legalcode" target="_blank">Creative Commons Attribution 3.0</a> and all of the Code Examples contained herein are licensed under <a href="https://www.tizen.org/bsd-3-clause-license" target="_blank">BSD-3-Clause</a>. <br>For details, see the <a href="https://www.tizen.org/content-license" target="_blank">Content License</a>.
+ </div>
+<script type="text/javascript">
+
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-25976949-1']);
+ _gaq.push(['_setDomainName', 'tizen.org']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+
+ </script>
+</div>
+</body>
+</html>
<td>Mandatory</td>
<td>Yes</td>
+
+ </tr><tr><td><a href="tizen/inputdevice.html" data-origin="tizen" data-domain="ui" data-category="core" data-status="D" data-version="">
+ Input Device</a></td>
+ <td>This API provides interfaces and methods to manage input keys in application.</td>
+ <td>2.4</td>
+ <td>Optional</td>
+ <td>No</td>
+
</tr></tbody></table><div id="footer">
<div class="copyright" align="center">
Except as noted, this content - excluding the Code Examples - is licensed under <a href="http://creativecommons.org/licenses/by/3.0/legalcode" target="_blank">Creative Commons Attribution 3.0</a> and all of the Code Examples contained herein are licensed under <a href="https://www.tizen.org/bsd-3-clause-license" target="_blank">BSD-3-Clause</a>. <br>For details, see the <a href="https://www.tizen.org/content-license" target="_blank">Content License</a>.
--- /dev/null
+<!DOCTYPE html PUBLIC "html">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel="stylesheet" type="text/css" href="tizen.css" media="screen">
+<script type="text/javascript" src="snippet.js"></script><title>InputDevice API</title>
+</head>
+<body id="page-content" onload="prettyPrint()">
+<div class="api" id="::InputDevice">
+<div class="title"><h1>InputDevice API</h1></div>
+<div class="brief">
+ The Input Device API provides functions to subscribe key events of the input device.
+ </div>
+<div class="description">
+ <p>
+The Tizen Device may provide depending on a particular input device.
+An application can handle device dependent key events after registration.
+ </p>
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.4
+ </p>
+<h2>Table of Contents</h2>
+<ul class="toc">
+<li>1. <a href="#typedefs-section">Type Definitions</a><ul class="toc"><li>1.1. <a href="#InputDeviceKeyName">InputDeviceKeyName</a>
+</li></ul>
+</li>
+<li>2. <a href="#interfaces-section">Interfaces</a><ul class="toc">
+<li>2.1. <a href="#InputDeviceManagerObject">InputDeviceManagerObject</a>
+</li>
+<li>2.2. <a href="#InputDeviceKey">InputDeviceKey</a>
+</li>
+<li>2.3. <a href="#InputDeviceManager">InputDeviceManager</a>
+</li>
+</ul>
+</li>
+<li>3. <a href="#full-webidl">Full WebIDL</a>
+</li>
+</ul>
+<hr>
+<h2 id="method-summary">Summary of Interfaces and Methods</h2>
+<table class="informaltable">
+<thead><tr>
+<th>Interface</th>
+<th>Method</th>
+</tr></thead>
+<tbody>
+<tr>
+<td><a href="#InputDeviceManagerObject">InputDeviceManagerObject</a></td>
+<td></td>
+</tr>
+<tr>
+<td><a href="#InputDeviceKey">InputDeviceKey</a></td>
+<td></td>
+</tr>
+<tr>
+<td><a href="#InputDeviceManager">InputDeviceManager</a></td>
+<td>
+<a href="#InputDeviceKey">InputDeviceKey</a>[] <a href="#InputDeviceManager::getSupportedKeys">getSupportedKeys</a> ()<br>
+ <a href="#InputDeviceKey">InputDeviceKey</a>? <a href="#InputDeviceManager::getKey">getKey</a> (<a href="#InputDeviceKeyName">InputDeviceKeyName</a> keyName)<br>
+ void <a href="#InputDeviceManager::registerKey">registerKey</a> (<a href="#InputDeviceKeyName">InputDeviceKeyName</a> keyName)<br>
+ void <a href="#InputDeviceManager::unregisterKey">unregisterKey</a> (<a href="#InputDeviceKeyName">InputDeviceKeyName</a> keyName)</td>
+</tr>
+</tbody>
+</table>
+<div class="typedefs" id="typedefs-section">
+<h2>1. Type Definitions</h2>
+<div class="typedef" id="InputDeviceKeyName">
+<a class="backward-compatibility-anchor" name="::InputDevice::InputDeviceKeyName"></a><h3>1.1. InputDeviceKeyName</h3>
+<div class="brief">
+ Name which identifies the key
+ </div>
+<pre class="webidl prettyprint"> typedef DOMString InputDeviceKeyName;</pre>
+<div class="description">
+ <p>
+Name of the key may be, for example:
+ </p>
+ <ul>
+ <li>
+VolumeUp </li>
+ <li>
+VolumeDown </li>
+ </ul>
+ <p>
+The actual list of supported keys depends on the platform.
+ </p>
+ </div>
+</div>
+</div>
+<div class="interfaces" id="interfaces-section">
+<h2>2. Interfaces</h2>
+<div class="interface" id="InputDeviceManagerObject">
+<a class="backward-compatibility-anchor" name="::InputDevice::InputDeviceManagerObject"></a><h3>2.1. InputDeviceManagerObject</h3>
+<div class="brief">
+ The InputDeviceManager interface defines what is instantiated in the tizen object.
+ </div>
+<pre class="webidl prettyprint"> [NoInterfaceObject] interface InputDeviceManagerObject {
+ readonly attribute <a href="#InputDeviceManager">InputDeviceManager</a> inputdevice;
+ };</pre>
+<pre class="webidl prettyprint"> <a href="tizen.html#Tizen">Tizen</a> implements <a href="#InputDeviceManagerObject">InputDeviceManagerObject</a>;</pre>
+<p><span class="version">
+ Since: </span>
+ 2.4
+ </p>
+<div class="description">
+ <p>
+There is a tizen.inputdevice object that allows accessing the functionality of the Input Device API.
+ </p>
+ </div>
+</div>
+<div class="interface" id="InputDeviceKey">
+<a class="backward-compatibility-anchor" name="::InputDevice::InputDeviceKey"></a><h3>2.2. InputDeviceKey</h3>
+<div class="brief">
+ The InputDeviceKey interface stores information about the key.
+ </div>
+<pre class="webidl prettyprint"> [NoInterfaceObject] interface InputDeviceKey {
+ readonly attribute <a href="#InputDeviceKeyName">InputDeviceKeyName</a> name;
+
+ readonly attribute long code;
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 2.4
+ </p>
+<div class="attributes">
+<h4>Attributes</h4>
+<ul>
+<li class="attribute" id="InputDeviceKey::name">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">InputDeviceKeyName </span><span class="name">name</span></span><div class="brief">
+ The name of the key, for example <var>"VolumeUp"</var> or <var>"VolumeDown"</var>.
+ </div>
+<div class="description">
+ <p>
+If the key is listed in the <a href="http://www.w3.org/TR/2014/WD-DOM-Level-3-Events-key-20140612">DOM Level 3 KeyboardEvent key Values</a> specification, the <em>name</em> attribute is equal to the <em>key value</em> specified there. (The <a href="http://www.w3.org/TR/2014/WD-DOM-Level-3-Events-key-20140612/#keys-media-controller">Media Controller Keys</a> section is the most relevant to the Input Device API)
+ </p>
+ <p>
+If the "DOM Level 3 KeyboardEvent key Value" does not contain appropriate entry for the key, then the Input Device provides a device specific <em>name</em>.
+ </p>
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.4
+ </p>
+</li>
+<li class="attribute" id="InputDeviceKey::code">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">long </span><span class="name">code</span></span><div class="brief">
+ The numeric code of the key, like <var>37</var> or <var>13</var>.
+ </div>
+<div class="description">
+ <p>
+This is the <em>keyCode</em> attribute value of the Key Event generated by the key.
+ </p>
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.4
+ </p>
+</li>
+</ul>
+</div>
+</div>
+<div class="interface" id="InputDeviceManager">
+<a class="backward-compatibility-anchor" name="::InputDevice::InputDeviceManager"></a><h3>2.3. InputDeviceManager</h3>
+<div class="brief">
+ The InputDeviceManager interface provides the features to check for availability and register for input device events.
+ </div>
+<pre class="webidl prettyprint"> [NoInterfaceObject] interface InputDeviceManager {
+ <a href="#InputDeviceKey">InputDeviceKey</a>[] getSupportedKeys() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ <a href="#InputDeviceKey">InputDeviceKey</a>? getKey(<a href="#InputDeviceKeyName">InputDeviceKeyName</a> keyName) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ void registerKey(<a href="#InputDeviceKeyName">InputDeviceKeyName</a> keyName) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ void unregisterKey(<a href="#InputDeviceKeyName">InputDeviceKeyName</a> keyName) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 2.4
+ </p>
+<div class="methods">
+<h4>Methods</h4>
+<dl>
+<dt class="method" id="InputDeviceManager::getSupportedKeys">
+<a class="backward-compatibility-anchor" name="::InputDevice::InputDeviceManager::getSupportedKeys"></a><code><b><span class="methodName">getSupportedKeys</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Retrieves the list of keys can be registered with the <em>registerKey()</em> method.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint"><a href="#InputDeviceKey">InputDeviceKey</a>[] getSupportedKeys();
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.4
+ </p>
+<div class="description">
+ <p>
+Mandatory keys will not be retrieved by this method.
+ </p>
+ </div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul><li class="list"><p>
+ with error type UnknownError in case of any error.
+ </p></li></ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var i, keyCode = {}, supportedKeys;
+ supportedKeys = tizen.inputdevice.getSupportedKeys();
+ for (i = 0; i < supportedKeys.length; i++) {
+ keyCode[supportedKeys[i].name] = supportedKeys[i].code;
+ }
+ if(keyCode.hasOwnProperty("VolumeUp")) {
+ tizen.inputdevice.registerKey("VolumeUp");
+ }
+ window.addEventListener("keydown", function(keyEvent) {
+ // identify the key by the numeric code from the keyEvent
+ if(keyEvent.keyCode === keyCode.VolumeUp) {
+ console.log("The VOLUME UP was pressed");
+ }
+ });
+
+ </pre>
+</div>
+</dd>
+<dt class="method" id="InputDeviceManager::getKey">
+<a class="backward-compatibility-anchor" name="::InputDevice::InputDeviceManager::getKey"></a><code><b><span class="methodName">getKey</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Returns information about the key which has the given name.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint"><a href="#InputDeviceKey">InputDeviceKey</a>? getKey(<a href="#InputDeviceKeyName">InputDeviceKeyName</a> keyName);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.4
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">keyName</span>:
+ The name of the key to retrieve
+ </li>
+ </ul>
+</div>
+<div class="returntype">
+<p><span class="return">Return value:</span></p>
+ InputDeviceKey InputDeviceKey object for the given key name, or null if the key is not supported
+ </div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type InvalidValuesError if the given keyName is invalid (e.g. name is empty string)
+ </p></li>
+<li class="list"><p>
+ with error type UnknownError in any other error case.
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+</dd>
+<dt class="method" id="InputDeviceManager::registerKey">
+<a class="backward-compatibility-anchor" name="::InputDevice::InputDeviceManager::registerKey"></a><code><b><span class="methodName">registerKey</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Registers an input device key to receive DOM keyboard event when it is pressed or released
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void registerKey(<a href="#InputDeviceKeyName">InputDeviceKeyName</a> keyName);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.4
+ </p>
+<div class="description">
+ <p>
+When an application wants to react to the Input Device keys being pressed, it should register this key.
+ </p>
+ <p>
+An application can not register the mandatory keys (ArrowLeft, ArrowRight, ArrowUp, ArrowDown, Enter, Back).
+ </p>
+ </div>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">keyName</span>:
+ The name of the key which should generate DOM key events when pressed
+ </li>
+ </ul>
+</div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type InvalidValuesError, if the given keyName is invalid or not supported (e.g. name is empty string).
+ </p></li>
+<li class="list"><p>
+ with error type UnknownError in any other error case.
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var keys = ["VolumeUp", "VolumeDown"], i;
+ for (i = 0; i < keys.length; i++) {
+ try {
+ tizen.inputdevice.registerKey(keys[i]);
+ } catch(error) {
+ console.log("failed to register " + keys[i] + ": " + error);
+ }
+ }
+ </pre>
+</div>
+</dd>
+<dt class="method" id="InputDeviceManager::unregisterKey">
+<a class="backward-compatibility-anchor" name="::InputDevice::InputDeviceManager::unregisterKey"></a><code><b><span class="methodName">unregisterKey</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Unregisters an input device key
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void unregisterKey(<a href="#InputDeviceKeyName">InputDeviceKeyName</a> keyName);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.4
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">keyName</span>:
+ The name of the key which should not be monitored any longer
+ </li>
+ </ul>
+</div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type InvalidValuesError, if the given keyName is invalid or not supported (e.g. name is empty string).
+ </p></li>
+<li class="list"><p>
+ with error type UnknownError in any error case.
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> tizen.inputdevice.unregisterKey("VolumeDown");
+ </pre>
+</div>
+</dd>
+</dl>
+</div>
+</div>
+</div>
+<h2 id="full-webidl">3. Full WebIDL</h2>
+<pre class="webidl prettyprint">module InputDevice {
+ typedef DOMString InputDeviceKeyName;
+
+ [NoInterfaceObject] interface InputDeviceManagerObject {
+ readonly attribute <a href="#InputDeviceManager">InputDeviceManager</a> inputdevice;
+ };
+ <a href="tizen.html#Tizen">Tizen</a> implements <a href="#InputDeviceManagerObject">InputDeviceManagerObject</a>;
+
+ [NoInterfaceObject] interface InputDeviceKey {
+ readonly attribute <a href="#InputDeviceKeyName">InputDeviceKeyName</a> name;
+
+ readonly attribute long code;
+ };
+
+ [NoInterfaceObject] interface InputDeviceManager {
+ <a href="#InputDeviceKey">InputDeviceKey</a>[] getSupportedKeys() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ <a href="#InputDeviceKey">InputDeviceKey</a>? getKey(<a href="#InputDeviceKeyName">InputDeviceKeyName</a> keyName) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ void registerKey(<a href="#InputDeviceKeyName">InputDeviceKeyName</a> keyName) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ void unregisterKey(<a href="#InputDeviceKeyName">InputDeviceKeyName</a> keyName) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ };
+
+};</pre>
+</div>
+<div id="page-footer">
+<div class="copyright" align="center">
+ Except as noted, this content - excluding the Code Examples - is licensed under <a href="http://creativecommons.org/licenses/by/3.0/legalcode" target="_blank">Creative Commons Attribution 3.0</a> and all of the Code Examples contained herein are licensed under <a href="https://www.tizen.org/bsd-3-clause-license" target="_blank">BSD-3-Clause</a>. <br>For details, see the <a href="https://www.tizen.org/content-license" target="_blank">Content License</a>.
+ </div>
+<script type="text/javascript">
+
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-25976949-1']);
+ _gaq.push(['_setDomainName', 'tizen.org']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+
+ </script>
+</div>
+</body>
+</html>