map_contact_id()

Remap the contact id from the touch evemt.

Synopsis:

#include <sys/queue.h>
#include "input/event_types.h"
#include "gestures/bucket.h"
 
int map_contact_id(struct contact_id_map *map, unsigned contact_id)

Arguments:

map
A pointer to the gesture map. The gesture passes the map to the process_event() callback function.
contact_id
A touch event contact id.

Library:

libgestures

Description:

This function remaps contact identifiers from touch events to contact identifiers to be used by gestures. The touch event data structure contains a contact_id element that is assigned a value from a 0-based index that corresponds to the individual fingers that touch the screen. The ID assigned to a finger will not change until that finger is released. The contact ID from the touch event should not be used directly by the gesture recognizer. Instead, user gestures should call map_contact_id() to get a 0-indexed contact ID remapped from the gesture set's perspective. This is necessary because, for example, the event contact ID 1 could actually correspond to the gesture set's contact ID 0 if there are multiple gesture sets in play, or if the user's finger is resting on the touch-sensitive bezel. You will likely need this function only if you are defining your own gestures.

Returns:

The remapped contact ID.