diff -r 4d198a32ac7d -r d4809db37847 plugins/org.symbian.tools.wrttools.doc.WebDeveloper/html/GUID-04ABC9FC-26FE-4854-9F88-63A2C4911886.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/org.symbian.tools.wrttools.doc.WebDeveloper/html/GUID-04ABC9FC-26FE-4854-9F88-63A2C4911886.html Thu Aug 19 17:48:04 2010 -0700 @@ -0,0 +1,37 @@ + + +Providing tactile feedback for user actions

Providing tactile feedback for user actions

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.

+

For general principles on providing tactile feedback, see Tactile feedback.

+

You use JavaScript SystemInfo Service API methods to provide tactile feedback. For more information, see Vibration information and control services.

+

To provide tactile feedback for user actions

    +
  1. Check that vibration is enabled on a mobile device.

    if (sysinfo.vibrasettings==1)
    +	startVibration();
    +
  2. +
  3. Specify settings for the intensity and duration of vibration. The following example specifies maximum intensity for maximum duration when users touch a UI component.

    function startVibration()
    +{
    +   // get the system defined maximum duration
    +   var duration = sysinfo.vibramaxduration;
    +   // get the system defined minimum intensity
    +   var intensity = sysinfo.vibraminintensity
    +   // start vibration
    +   sysinfo.startvibra(duration, intensity);
    +}

    You can also use the startvibra() method of the JavaScript SystemInfo Service API setting to specify the duration and intensity of vibration. For example:

    getSysInfo: function() {
    +	if ( !WrtHelper._sysinfo ) {
    +		WrtHelper._sysinfo = document.getElementById("sysinfo");
    +	
    +	}
    +	
    +	return WrtHelper._sysinfo;
    +},
    +
    +tactileFeedback: function() {
    +	var sysinfo = WrtHelper.getSysInfo();
    +	if (sysinfo.startvibra) 
    +		sysinfo.startvibra(10, 10);
    +},
    +
  4. +
+
\ No newline at end of file