org.symbian.tools.wrttools.doc.WebDeveloper/html/GUID-04ABC9FC-26FE-4854-9F88-63A2C4911886.html
author Eugene Ostroukhov <eugeneo@symbian.org>
Fri, 11 Jun 2010 13:33:03 -0700
changeset 372 1e408ee32d8a
parent 229 716254ccbcc0
permissions -rw-r--r--
Added templates for WRT 1.1 platform services
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
229
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
     1
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
     2
<!DOCTYPE html
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
     3
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
     4
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><meta name="copyright" content="(C) Copyright 2009"/><meta name="DC.rights.owner" content="(C) Copyright 2009"/><meta name="DC.Type" content="concept"/><meta name="DC.Title" content="Providing tactile feedback for user actions"/><meta name="abstract" content="Tactile feedback provides users with immediate confirmation that the touch event has been registered. It is especially useful in noisy environments. You can use vibration as tactile feedback on user actions. Tactile feedback is implemented for those common S60 UI components where it has been seen as beneficial. If you create custom components for widgets, consider providing tactile feedback for buttons, sliders, strokes, gestures, and notifications."/><meta name="description" content="Tactile feedback provides users with immediate confirmation that the touch event has been registered. It is especially useful in noisy environments. You can use vibration as tactile feedback on user actions. Tactile feedback is implemented for those common S60 UI components where it has been seen as beneficial. If you create custom components for widgets, consider providing tactile feedback for buttons, sliders, strokes, gestures, and notifications."/><meta name="DC.Relation" scheme="URI" content="GUID-AE9BB3E0-C243-476B-A236-40958A1DAED9"/><meta name="DC.Relation" scheme="URI" content="GUID-D54DEFE7-E878-4530-B707-A5388DFE1D9D"/><meta name="DC.Relation" scheme="URI" content="GUID-6DD2B3D2-BA3B-4936-BBC9-F61B6757B6F8"/><meta name="DC.Format" content="XHTML"/><meta name="DC.Identifier" content="GUID-04ABC9FC-26FE-4854-9F88-63A2C4911886"/><meta name="DC.Language" content="en"/><title>Providing tactile feedback for user actions </title><script type="text/javascript">
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
     5
      function initPage() {}
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
     6
    </script><link href="../PRODUCT_PLUGIN/book.css" rel="stylesheet" type="text/css"/><link href="css/s60/style.css" rel="stylesheet" type="text/css" media="all"/></head><body onload="initPage();"><div class="body"><div class="contentLeft prTxt"><h1 class="pageHeading" id="GUID-04ABC9FC-26FE-4854-9F88-63A2C4911886">Providing tactile feedback for user actions</h1><div><p>Tactile feedback provides users with immediate confirmation that the touch event has been registered. It is especially useful in noisy environments. You can use vibration as tactile feedback on user actions. Tactile feedback is implemented for those common S60 UI components where it has been seen as beneficial. If you create custom components for widgets, consider providing tactile feedback for buttons, sliders, strokes, gestures, and notifications.</p>
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
     7
<p>For general principles on providing tactile feedback, see <a href="http://library.forum.nokia.com/topic/Design_and_User_Experience_Library/GUID-88336D00-EDE2-416B-BFD0-362ECA115191.html" target="_blank">Tactile feedback</a>.</p>
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
     8
<p>You use JavaScript SystemInfo Service API methods to provide tactile feedback. For more information, see <a href="GUID-6B348161-2ED2-498E-A166-C3B28C58BC68.html#GUID-6B348161-2ED2-498E-A166-C3B28C58BC68">Vibration information and control services</a>.</p>
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
     9
<div><h3>To provide tactile feedback for user actions</h3><ol>
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
    10
<li id="GUID-A7BFD508-233A-4290-9288-9D7E57A3BDD5"><a name="GUID-A7BFD508-233A-4290-9288-9D7E57A3BDD5"><!----></a><p>Check that vibration is enabled on a mobile device.</p><pre class="codeblock">if (sysinfo.vibrasettings==1)
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
    11
	startVibration();
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
    12
</pre></li>
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
    13
<li id="GUID-A5821AF9-F8E7-425B-B9C5-6BDBE536F07B"><a name="GUID-A5821AF9-F8E7-425B-B9C5-6BDBE536F07B"><!----></a><p>Specify settings for the intensity and duration of vibration. The following example specifies maximum intensity for maximum duration when users touch a UI component.</p><pre class="codeblock">function startVibration()
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
    14
{
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
    15
   // get the system defined maximum duration
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
    16
   var duration = sysinfo.vibramaxduration;
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
    17
   // get the system defined minimum intensity
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
    18
   var intensity = sysinfo.vibraminintensity
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
    19
   // start vibration
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
    20
   sysinfo.startvibra(duration, intensity);
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
    21
}</pre><p>You can also use the <a href="GUID-08AA357E-7499-4A8E-B756-4FCDFBEDB9FC.html#GUID-08AA357E-7499-4A8E-B756-4FCDFBEDB9FC">startvibra()</a> method of the JavaScript SystemInfo Service API setting to specify the duration and intensity of vibration. For example:</p><pre class="codeblock">getSysInfo: function() {
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
    22
	if ( !WrtHelper._sysinfo ) {
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
    23
		WrtHelper._sysinfo = document.getElementById("sysinfo");
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
    24
	
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
    25
	}
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
    26
	
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
    27
	return WrtHelper._sysinfo;
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
    28
},
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
    29
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
    30
tactileFeedback: function() {
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
    31
	var sysinfo = WrtHelper.getSysInfo();
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
    32
	if (sysinfo.startvibra) 
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
    33
		sysinfo.startvibra(10, 10);
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
    34
},
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
    35
</pre></li>
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
    36
</ol></div>
716254ccbcc0 Fixed 2046: WRTKit help topics. Fixed 2170: Added support for Web Developer Library. Fixed 1952: Event Trigger icons unreadable
tasneems@symbian.org
parents:
diff changeset
    37
</div></div></div><div class="footer"><hr/><div class="copy">© Nokia 2009.</div></div></body></html>