Namespaces
Variants
Actions

Gestures with Symbian

Jump to: navigation, search
Article Metadata

Code Example
Article
Created: symbianyucca (21 Dec 2010)
Last edited: hamishwillee (23 Jul 2012)

Symbian^3 introduced a new API called CAknTouchGestureFw that can be used for detecting single touch as well as with multitouch gestures.

This API is not part of the public SDK, but the API is included in Symbian open source packages. The API usage is straightforward and only required following two lines of code:

iGestureHelper = AknTouchGestureFw::CAknTouchGestureFw::NewL(*this, *this);
iGestureHelper->SetGestureInterestL(EAknTouchGestureFwAll);

The CAknTouchGestureFw::NewL() takes two arguments, where the first one is the MAknTouchGestureFwObserver interface for the gesture events, and the second one is the CCoeControl derived class that gets the pointer events from which the gestures are determined from.

The SetGestureInterestL() then is used for telling the API on which gestures we are interested, by using the EAknTouchGestureFwAll, all gestures should be forwarded to the specified interface.

The MAknTouchGestureFwObserver callback interface only defines one function named HandleTouchGestureL() that has one argument typed MAknTouchGestureFwEvent. This argument implements two functions for retrieving the gesture:

  • Group(): Identified the gesture group type
  • Type(): identifies the actual gesture inside the group

Currently supported groups and types are as follows:

1. EAknTouchGestureFwGroupTap

  • EAknTouchGestureFwTap
  • EAknTouchGestureFwDoubleTap
  • EAknTouchGestureFwLongTap

2. EAknTouchGestureFwGroupFlick

  • EAknTouchGestureFwFlickLeft
  • EAknTouchGestureFwFlickRight
  • EAknTouchGestureFwFlickUp
  • EAknTouchGestureFwFlickDown

3. EAknTouchGestureFwGroupDrag

  • EAknTouchGestureFwDrag

4. EAknTouchGestureFwGroupPinch

  • EAknTouchGestureFwPinch

The API only identifies the gesture, and the actual value changes for gestures should be determined by checking the actual advanced pointer event values.

And example utilizing the API can be found from Advanced Pointer.zip

This page was last modified on 23 July 2012, at 08:44.
97 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved