Platform APIs

sevt_post_key_event

Defined in <sparklet_api.h>

Version

int sevt_post_key_event (SCOORD key)

Since 1.1

This function is used to send a key event into the Sparklet library. The ASCII code of the key has to be passed.

PARAMETERS:

key

ASCII Value of the key pressed

RETURN VALUE:

0 - Success

-1 - Transition in progress

1 - No space in buffer

Example:

The below code queues the key event ‘q’ for further processing.

sevt_post_key_event(‘q’);

sevt_post_mouse_event

Defined in <sevents.h>

Version

int sevt_post_mouse_event (INT8U ub_sub_type, SCOORD x, SCOORD y);

Since 1.1

This function is used to send a mouse event into the Sparklet library. The given sub-type and co-ordinate values are queued.

PARAMETERS:

ub_sub_type

Type of the mouse event - SEVT_MOUSE_LB_DOWN, SEVT_MOUSE_LB_STILL_DOWN or SEVT_MOUSE_LB_UP

x

X Coordinate

y

Y Coordinate

RETURN VALUE:

0 - Success

-1 - Transition in progress

1 - No space in buffer

Example:

The code below queues the mouse event for sub-type SEVT_MOUSE_LB_UP and coordinates (xPos, yPos) for processing.

sevt_post_mouse_event (SEVT_MOUSE_LB_UP, (SCOORD)xPos, (SCOORD)yPos);