Tactile feedback

There are two types of cases where vibration or audio of the device is used as an output method when the user is interacting with the device touch screen:

  • When the user has touched an active area of the screen, and that an action will be triggered on touch release

  • Interaction with given components has been successful

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 included in those common UI components, where seen as beneficial. When new components are designed, tactile feedback is to be included in those if seen beneficial usability-wise. For example, in any button type of UI component the tactile feedback is natural. Application can disable tactile feedback from the common UI components it uses, if seen necessary. This is acceptable only in cases, where tactile feedback would cause interference, like during a phone call or when giving audio commands to the system.

The user can choose whether tactile feedback is on or off.

Using tactile feedback in C++ applications

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

The S60 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 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.

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.

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

ETouchFeedbackNone

Use for disabling feedback for some areas of the application window when using the area registry.

ETouchFeedbackBasic

Use as default feedback for stylus down events, for example, when the mobile device user taps a button or tab.

ETouchFeedbackSensitive

Sensitive feedback for situations where the triggering action is not very important (e.g. change of focus in a list), or when there can be a large number of feedback instances within a short time (e.g. text selection which gives feedback on every new selected character). Also used for scrolling and dragging.

To use vibration or audio feedback in your application:

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

  2. Include touchfeedback.h.

  3. To enable tactile feedback for your application, add the following code.

    iTouchFeedBack = TouchFeedback::Instance();
    iTouchFeedBack->SetFeedbackEnabledForThisApp(ETrue);

    Do not delete the pointer in the controller destructor.

  4. 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)
            {
            iTouchFeedBack->InstantFeedback(ETouchFeedbackBasic);
            }
        
        // Your other pointer event handling code here
    
  5. To enable automatic feedback triggering in a specific area of a UI component, add

    iTouchFeedBack->SetFeedbackArea(this, 
                                  1,
                                  TRect(0,0,20,20), 
                                  ETouchFeedbackBasic, 
                                  ETouchEventStylusDown);
    

Note: Using tactile feedback does not require additional platform security capabilities for your application.