Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Giving tactile feedback in touch UI apps using Symbian C++

From Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

The article is believed to be still valid for the original topic scope.

Article Metadata
Tested with
Devices(s): Nokia 5800 XpressMusic
Compatibility
Platform(s): S60 5th Edition
S60 5th Edition
Article
Keywords: MTouchFeedback
Created: tepaa (14 Oct 2008)
Last edited: lpvalente (23 Aug 2014)


Contents

Overview

Tactile feedback provides the user a physical pulse (vibration) when touch screen interaction has been successful.

Tactile feedback provides an interface to add, modify, and remove feedback areas in the registry. There is also an option to trigger direct feedback by bypassing the registry.

MTouchFeedback is used for acquiring a pointer to the touch feedback instance.

This snippet can be self-signed.


MMP file

The following capabilities and libraries are required:

CAPABILITY None       
 
LIBRARY touchfeedback.lib


Header file

Include two headers

#include <touchfeedback.h>
#include <touchlogicalfeedback.h>
 
class CImageConverterContainer : public CCoeControl
{
...
private:
MTouchFeedback* iTouchFeedBack;
...
}


Source file

// Create an instance of touch feedback
void CImageConverterContainer::ConstructL(const TRect& /*aRect*/)
{
...
iTouchFeedBack = MTouchFeedback::Instance();
iTouchFeedBack->SetFeedbackEnabledForThisApp(ETrue);
...
}
 
// Give some vibra to the user when a pointer down event occurs
void CImageConverterContainer::HandlePointerEventL(const TPointerEvent& aPointerEvent)
{
...
if (aPointerEvent.iType == TPointerEvent::EButton1Down)
{
// Give feedback to user (vibration)
iTouchFeedBack->InstantFeedback(ETouchFeedbackBasic);
}
...
}

Parameters into MTouchFeedback::InstantFeedback().

 *  ETouchFeedbackNone      - Use for disabling feedback for some areas of the
* window when using area registry.
*
* ETouchFeedbackBasic - Use as default feedback for pen down events.
* For example, pressing a button or tab.
*
* ETouchFeedbackSensitive - Sensitive feedback situations
* where the triggering action is not very
* important (e.g. change focus in list), or when
* there can be a large amount of feedback in
* a short time (e.g. text selection which gives
* feedback on every new selected character).
* Also used for scrolling and dragging.

Postconditions

The user gets vibration feedback when using the stylus / finger down (tapping on the screen).

See also

S60 Platform: Image Converter Example

This page was last modified on 23 August 2014, at 02:53.
100 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×