Reference for the Mosaic class Core::CursorGrabEvent

Core::CursorGrabEvent
AutoDeflected
Down
Finger
GlobalCurrentPos
StrikeCount
Target
InitializeDown()
InitializeUp()
Core::Event
IsTimeExact
Time
GetCurrentTime()

The class Core::CursorGrabEvent provides a specialized event object able to deliver touch screen events associated with the beginning and the end of a cursor grab cycle.

Each time the user clicks with the mouse cursor on the screen, hits it with a pen or touches it with his finger, the Mosaic searches for the view, which is lying at the touched screen position and willing to handle the user interaction. This found view will become the target for all subsequent cursor events related to this interaction. This relation is called the 'grab cycle'.

The event Core::CursorGrabEvent is used to notify all other views about the beginning and the end of the grab cycle. With the event the views receive the information where the user has touched the screen and which view has been selected as the target.

In this manner, although not being the target of the cursor event, the view can perform operations like to stop a running slide animation etc.

var bool AutoDeflected;

The variable 'AutoDeflected' is 'true', if the event has been sent from the method Core::Root.DeflectCursor() or Core::Root.RetargetCursor(). These methods make possible to hand over the cursor from the current target view to another view. In this manner new target view is determined. The variables allows you to detect the reason of the event.

var bool Down;

The variable 'Down' determines whether the user is still touching the screen. If this variable == 'false' the user has released it.

var int32 Finger;

The variable 'Finger' identifies the finger as an event source within a multi-touch environment. The fingers are numbered with values lying in the range 0 .. 9.

var point GlobalCurrentPos;

The variable 'GlobalCurrentPos' stores the current cursor position expressed in the global (screen) coordinate space.

method Core::CursorGrabEvent InitializeDown
(
arg int32 aFinger,
arg int32 aStrikeCount,
arg bool aAutoDeflected,
arg Core::View aTarget,
arg point aGlobalCurrentPos
);

The method InitializeDown() simplifies the initialization of this Core::CursorGrabEvent object. This method stores the given parameters in the variables of this event object, sets its variable Down 'true' and returns this event object to the caller.

method Core::CursorGrabEvent InitializeUp
(
arg int32 aFinger,
arg int32 aStrikeCount,
arg bool aAutoDeflected,
arg Core::View aTarget,
arg point aGlobalCurrentPos
);

The method InitializeUp() simplifies the initialization of this Core::CursorGrabEvent object. This method stores the given parameters in the variables of this event object, sets its variable Down 'false' and returns this event object to the caller.

var int32 StrikeCount;

The variable 'StrikeCount' stores how often the user has tapped the screen in succession. It is one, if the user has single tapped it. It is two if a double tap took place, and so far.

Such series of taps are recognized only when the taps are performed very quickly and the user doesn't move the finger very much. The appropriate time delay and the valid range for the movement are determined by the properties CursorDragLimit and CursorSequelDelay of the class Core::Root.

var Core::View Target;

The variable 'Target' refers to the view, which acts as the target in the grab cycle.