diff -r 43e37759235e -r 51a74ef9ed63 Symbian3/SDK/Source/GUID-581A8E4B-12BE-41C0-A20E-3087A80FEECF.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-581A8E4B-12BE-41C0-A20E-3087A80FEECF.dita Wed Mar 31 11:11:55 2010 +0100 @@ -0,0 +1,298 @@ + + + + + +Tactile +feedback +

There are two methods where vibration or audio of the device is used as +an output method (when mobile device users interact with the device touch +screen):

+ +

As with sounds, tactile feedback must be used carefully so as not to desensitize +the user to the vibration; the attention grabbing quality remains and functions +so long as the feedback is not too frequent.

+

Tactile feedback is enabled for all the Symbian platform UI components. +Tactile feedback can be disabled for the common UI components in an application. +However, this is acceptable only if tactile feedback causes interference with +other device functions.

+

The user can choose the level of tactile feedback and turn tacticons ON +and OFF.

+

The following table lists the tactile feedback effects:

+

Tactile feedback +effects + + + +

Effects

+

Description

+
+ + + +

Sensitive button

+

It provides single pulse effect on repeated key presses with buttons. +It is also possible with other similar components.

+
+ +

Basic button

+

It provides stronger single pulse effect to buttons. It is also +possible with other similar components.

+
+ +

Sensitive list

+

It provides single pulse effect to lists and grids. Effect is used +with move (drag and flick) when new item appears on the screen.

+
+ +

Basic list

+

It provides stronger single pulse effect to lists and grids. Effect +is used with touch down and release when tap makes an action.

In hierarchical +list, collapsing/expanding item provides basic list effect with touch down +and release.

+
+ +

Bounce effect

+

It provides pulse effect when list returns to its normal state after +boundary effect.

+
+ +

Sensitive slider

+

It provides pulse effect with scrollbar and slider thumbs. Effect +is provided with touch down and release in thumb area.

+
+ +

Smooth slider

+

It provides continuous smooth feedback when dragging scrollbar or +slider thumb. This can also be increasing or decreasing depending of the slider +type.

+
+ +

Hold slider

+

It provides sensitive pulse effect when touch down and hold on the +slider or scrollbar area. Slider thumb starts moving step by step towards +the touch point. Every step gives one sensitive pulse. If slider thumb moves +directly to the touch point, then basic slider effect is provided.

+
+ +

Pop-up

+

It provides sensitive pulse effect when pop-up is opened or closed. +If the theme animations are ON, then pop-up effect is used with opening event +after increasing long touch effect. In this scenario, there is no pop-up effect +while closing. All pop-ups does not have theme animation.

+
+ +

Pop-up close

+

It provides decreasing smooth feedback while closing pop-up and +when theme animations are ON.

+
+ +

Increasing long touch

+

It provides increasing smooth feedback. This can be used with either +long tap animation or pop-up opening theme effects. If the theme effects are +ON and long tap opens a pop-up, then feedback is provided only with long tap. +This is followed by pop-up.

+
+ +

Basic tab

+

It provides strong pulse effect with touch down event in tab area.

+
+ +

Smooth flick

+

It provides smooth feedback with drag when horizontal movement is +possible.

+
+ +

Sensitive flick

+

It provides sensitive pulse effect with touch release when horizontal +movement is possible.

+
+ +

Sensitive edit

+

It provides sensitive pulse effect in editors with touch down and +release.

+
+ +

Text edit

+

It provides pulse effect when painting the text. Effect is provided +with every character while painting the text.

+
+ +

Blank edit

+

It provides pulse effect when painting blank character. By default, +it is none.

+
+ +

Line edit

+

It provides pulse effect when painting a line.

+
+ +

Empty line

+

It provides pulse effect when painting an empty line. By default, +it is none.

+
+ +

Check box

+

It provides pulse effect when marking/unmarking a check box.

+
+ +

Multi-touch recognition

+

It provides double pulse (sensitive + sensitive) effect when multi-touch +is recognized (generally, when second finger is touched down).

+
+ +

Smooth pinch

+

It provides smooth continuous feedback while moving fingers in multi-touch +pinch situation.

+
+ +

Smooth rotate

+

It provides smooth continuous feedback while moving fingers in +multi-touch rotate situation.

+
+ + +

+
Characteristics +of haptics related APIs

You can use the following APIs to create +haptic effects:

    +
  • Tactile Feedback +Client API

      +
    • It is available from S60 5th Edition onwards

    • +
    • It can be used on all S60 5th Edition or later mobile devices. However, +the feedback is played only on touch enabled layouts.

    • +
    • It provides simple functions for triggering various predefined tactile +feedback (vibration or audio) effects.

    • +
    • It enables a consistent user experience in all applications of the +mobile device (an application gives a logical feedback type as an input and +the actual physical effect depends on the mobile device configuration and +end user settings).

    • +
    • When the area feedback is used, latency is low for the feedback triggering +(a tactile feedback can already be triggered at the window server level prior +to the corresponding pointer event being delivered to the visible application).

    • +
    • Direct feedback can be easily integrated into CCoeControl::HandlePointerEventL() .

    • +
    • An application can select the logical tactile feedback from certain +types. The produced effect may be different on various mobile devices.

    • +
  • +
  • Haptics +API

      +
    • It is available from S60 5.2 Edition onwards.

    • +
    • It can be used in touch and hybrid mobile devices.

    • +
    • It provides an interface for accessing Haptics player that can control +different actuator types.

    • +
    • It enables producing of complex vibrator effects, such as an explosion +or machine gun effect in a game, bass boost for a music player, advanced ringing +tone vibration, and so on.

    • +
    • It enables simultaneous playing of different kinds of basis effects +and modifying them when played.

    • +
    • It allows for designing complex effects (using a separate PC application) +that can be loaded on Haptics player for playing.

    • +
    • It may require a special license key for third-party applications +(to be set at runtime) to enable the Haptics player functionality.

    • +
  • +
  • Vibra API

      +
    • It available from S60 3.0 onwards

    • +
    • It can be used for running device vibrator with given intensity for +a given period of time

    • +
    • It can be used by a privileged client application to play pulse effects, +which have a very short duration (as the ones used for tactile feedback)

    • +
  • +
+
When to use +Tactile Feedback Client API, Haptics API, and Vibra API

You must +use

    +
  • Tactile Feedback Client API for providing tactile feedback in custom +controls (grids, lists, and so on) which will comply with the style of Core +UI components to ensure a uniform user experience among applications

  • +
  • Haptics API on touch and hybrid mobile devices for producing complex +vibration feedback which cannot be achieved with Tactile Framework (games, +simulations, demos, and so on.)

  • +
  • Vibra API for producing haptic effects such as ringing tone vibration +in those mobile devices where Haptics API is not available or functional

  • +

+
Using +tactile feedback in C++ applications

The API to use for tactile +feedback is the Tactile +feedback client API.

The Symbian platform includes a tactile +feedback interface to add, modify and remove feedback areas in the registry. +There is also an option to trigger direct feedback and bypass the registry. + MTouchFeedback::Instance() is used for acquiring a pointer +to a touch feedback instance. When touch feedback is activated, the mobile +device users get a slight vibration when the control with the feedback interface +is touched.

Tactile feedback can be set and disabled in a client +application or a mobile device in some scenarios, for example, during phone +calls.

Client applications cannot determine the actual physical +feedback that is generated. It depends on device configuration and current +settings. In current devices, the user changeable settings include vibration +and audio feedback intensity level.

In your application, you can use +the following feedback types, defined in TTouchLogicalFeedback:

+ + + +

ETouchFeedbackNone

+

It is used for disabling feedback in some areas of the application +window while using the area registry.

+
+ +

ETouchFeedbackBasic

+

It is used as a default feedback for stylus touch down events. For +example, when the mobile device user taps a button or tab.

+
+ +

ETouchFeedbackSensitive

+

It provides sensitive feedback in situations when:

    +
  • the triggering action is not very important (for example, change of +focus in a list)

  • +
  • 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).

  • +
It is also used for scrolling and dragging.

+
+ + +

To use vibration or audio feedback in your application:

    +
  1. Include touchfeedback.lib in +your .mmp file.

  2. +
  3. Include touchfeedback.h.

  4. +
  5. To enable +tactile feedback for your application, add the following code.

    MTouchFeedback* feedback = MTouchFeedback::Instance(); +feedback->SetFeedbackEnabledForThisApp(ETrue); // enabling feedback is optional

    Do +not delete the pointer in the controller destructor.

  6. +
  7. To use tactile +feedback when a mobile device user points at a control, add the following +code.

    void CMyContainerControl::HandlePointerEventL(const TPointerEvent& aPointerEvent) + { + // Feedback is always played at pointer down event + if(aPointerEvent.iType == TPointerEvent::EButton1Down) + { + MTouchFeedback* feedback = MTouchFeedback::Instance(); + if (feedback) + { + feedback->InstantFeedback(ETouchFeedbackBasic); + } + } + + // Your other pointer event handling code here +
  8. +
  9. To enable +automatic feedback triggering in a specific area of a UI component, add

    feedback->SetFeedbackArea( this, + 1, // area Id + TRect( 0,0,20,20 ), + ETouchFeedbackBasic, + ETouchEventStylusDown ); +
  10. +

To use tactile feedback in an application, additional platform +security capabilities are not required.

+
\ No newline at end of file