Symbian3/SDK/Source/GUID-21DAC50D-7737-42B6-BBDA-E12E8779741B.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Fri, 11 Jun 2010 12:39:03 +0100
changeset 8 ae94777fff8f
parent 7 51a74ef9ed63
permissions -rw-r--r--
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="GUID-21DAC50D-7737-42B6-BBDA-E12E8779741B" xml:lang="en"><title>Feedback</title><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>Visual feedback is the most important sensory feedback when entering characters
on screen. Visual feedback can be, for example, button effects, color changes,
status indicators, touch/release state changes, or clearing the screen when
transitioning to next screen.</p>
<p>With audio feedback, lower clicks and tones are preferred over loud beeps,
though most people turn audio feedback off anyway.</p>
<p>Vibration is used as tactile feedback for touch screen interaction or input.
Tactile feedback gives the user an immediate response that the touch event
has been registered.</p>
<p>With the Symbian touch UI, tactile feedback is used in the following situations:</p>
<ul>
<li><p><b>Sensors: </b>a tap on the device by hand provides tactile feedback
to the user in case of a successful interaction.</p></li>
<li><p><b>Touch interaction (touch screen):</b> to indicate to the user that
an interaction event has been successful. For example, when the user presses
a button on the touch screen</p></li>
</ul>
<p><note>Tactile feedback is included in those common UI components where
it has been seen as beneficial. When creating new applications and designing
custom components, tactile feedback is to be included where found useful.
For example, in any button type of UI component, the tactile feedback is naturally
beneficial.</note></p>
<p>In your application, you can use the following feedback types, defined
in <codeph>TTouchLogicalFeedback</codeph>:</p>
<table id="GUID-6FF24F72-C352-4027-AA5D-2D34EBFA00F4">
<tgroup cols="2"><colspec colname="col1"/><colspec colname="col2"/>
<tbody>
<row>
<entry><p><codeph>ETouchFeedbackNone</codeph></p></entry>
<entry><p>Used for disabling feedback in some areas of the application window
while using the area registry.</p></entry>
</row>
<row>
<entry><p><codeph>ETouchFeedbackBasic</codeph></p></entry>
<entry><p>Used as a default feedback for stylus touch down events. For example,
when the mobile device user taps a button or tab.</p></entry>
</row>
<row>
<entry><p><codeph>ETouchFeedbackSensitive</codeph></p></entry>
<entry><p>Provides sensitive feedback in situations when:<ul>
<li><p>the triggering action is not very important (for example, change of
focus in a list).</p></li>
<li><p>there can be a large number of feedback instances within a short time
(for example, text selection which gives feedback on every new selected character).</p></li>
</ul> It is also used for scrolling and dragging.</p></entry>
</row>
</tbody>
</tgroup>
</table>
<p>To use vibration or audio feedback in your application:</p>
<ol>
<li id="GUID-791E80D6-6935-4202-81E0-BA7392A9E1B3"><p>Include <codeph>touchfeedback.lib</codeph> in
your <codeph>.mmp</codeph> file.</p></li>
<li id="GUID-A185188F-F37B-440B-8213-214D77CF3B8B"><p>Include <parmname>touchfeedback.h</parmname>.</p></li>
<li id="GUID-6455F4C1-AEA6-4C30-8E9B-DF9950558E17"><itemgroup><p>To enable
tactile feedback for your application, add the following code.</p><codeblock xml:space="preserve">MTouchFeedback* feedback = MTouchFeedback::Instance();
feedback-&gt;SetFeedbackEnabledForThisApp(ETrue); // enabling feedback is optional  </codeblock><p>Do
not delete the pointer in the controller destructor.</p></itemgroup></li>
<li id="GUID-FC1B810B-99F4-44E5-82DC-46686D6D4198"><itemgroup><p>To use tactile
feedback when a mobile device user points at a control, add the following
code.</p><codeblock xml:space="preserve">void CMyContainerControl::HandlePointerEventL(const TPointerEvent&amp; aPointerEvent)
    {
    // Feedback is always played at pointer down event
    if(aPointerEvent.iType == TPointerEvent::EButton1Down)
        {
        MTouchFeedback* feedback = MTouchFeedback::Instance();  
        if (feedback) 
             { 
             feedback-&gt;InstantFeedback(ETouchFeedbackBasic);  
             }  
        }
   
    // Your other pointer event handling code here
</codeblock></itemgroup></li>
<li id="GUID-A26D8717-1839-4132-98C4-5C09086BB361"><itemgroup><p>To enable
automatic feedback triggering in a specific area of a UI component, add</p><codeblock xml:space="preserve">feedback-&gt;SetFeedbackArea( this, 
                           1, // area Id
                           TRect( 0,0,20,20 ), 
                           ETouchFeedbackBasic, 
                           ETouchEventStylusDown );
</codeblock></itemgroup></li>
</ol>
<note><ul>
<li><p>To use tactile feedback in an application, additional platform security
capabilities are not required.</p></li>
<li><p>Applications themselves do not need to generate feedback effects, unless
they are using custom components. The feedback is generated by components
that the applications use.</p></li>
</ul></note>
<p>For more information, see <xref href="GUID-581A8E4B-12BE-41C0-A20E-3087A80FEECF.dita">Tactile
feedback</xref>.</p>
</conbody></concept>