Tizen Native API
|
Functions | |
void | evas_pointer_canvas_xy_get (const Evas_Canvas *obj, Evas_Coord *x, Evas_Coord *y) |
This function returns the current known pointer co-ordinates. | |
void | evas_pointer_output_xy_get (const Evas_Canvas *obj, int *x, int *y) |
This function returns the current known pointer co-ordinates. | |
Eina_Bool | evas_pointer_inside_get (const Evas_Canvas *obj) |
Returns whether the mouse pointer is logically inside the canvas. | |
int | evas_pointer_button_down_mask_get (const Evas_Canvas *obj) |
Returns a bitmask with the mouse buttons currently pressed, set to 1. |
This group provides functions that deal with the status of the pointer (mouse cursor).
Function Documentation
int evas_pointer_button_down_mask_get | ( | const Evas_Canvas * | obj | ) |
Returns a bitmask with the mouse buttons currently pressed, set to 1.
- Since :
- 2.3
- Returns:
- A bitmask of the currently depressed buttons on the canvas
- Remarks:
- Calling this function will return a 32-bit integer with the appropriate bits set to 1 that correspond to a mouse button being depressed. This limits Evas to a mouse devices with a maximum of 32 buttons, but that is generally in excess of any host system's pointing device abilities.
- The least significant bit corresponds to the first mouse button (button 1) and the most significant bit corresponds to the last mouse button (button 32).
-
If
e
is not a valid canvas, the return value is undefined. -
Example:
extern Evas *evas; int button_mask, i; button_mask = evas_pointer_button_down_mask_get(evas); printf("Buttons currently pressed:\n"); for (i = 0; i < 32; i++) { if ((button_mask & (1 << i)) != 0) printf("Button %i\n", i + 1); }
- Parameters:
-
[in] obj The canvas object
void evas_pointer_canvas_xy_get | ( | const Evas_Canvas * | obj, |
Evas_Coord * | x, | ||
Evas_Coord * | y | ||
) |
This function returns the current known pointer co-ordinates.
- Since :
- 2.3
- Remarks:
- This function returns the current known canvas unit co-ordinates of the mouse pointer and sets the contents of the Evas_Coords pointed to by
x
andy
to contain these co-ordinates. Ife
is not a valid canvas the results of this function are undefined. -
Example:
extern Evas *evas; Evas_Coord mouse_x, mouse_y; evas_pointer_output_xy_get(evas, &mouse_x, &mouse_y); printf("Mouse is at canvas position %d, %d\n", mouse_x, mouse_y);
- Parameters:
-
[in] obj The canvas object [out] x The pointer to a Evas_Coord to be filled in [out] y The pointer to a Evas_Coord to be filled in
Eina_Bool evas_pointer_inside_get | ( | const Evas_Canvas * | obj | ) |
Returns whether the mouse pointer is logically inside the canvas.
- Since :
- 2.3
- Returns:
- An integer that is 1 if the mouse is inside the canvas, 0 otherwise
- Remarks:
- A return value of 1 indicates the mouse is logically inside the canvas, and 0 implies it is logically outside the canvas.
- A canvas begins with the mouse being assumed outside (0).
-
If
e
is not a valid canvas, the return value is undefined. -
Example:
extern Evas *evas; if (evas_pointer_inside_get(evas)) printf("Mouse is in!\n"); else printf("Mouse is out!\n");
- Parameters:
-
[in] obj The canvas object
void evas_pointer_output_xy_get | ( | const Evas_Canvas * | obj, |
int * | x, | ||
int * | y | ||
) |
This function returns the current known pointer co-ordinates.
- Since :
- 2.3
- Remarks:
- This function returns the current known screen/output co-ordinates of the mouse pointer and sets the contents of the integers pointed to by
x
andy
to contain these co-ordinates. Ife
is not a valid canvas the results of this function are undefined. -
Example:
extern Evas *evas; int mouse_x, mouse_y; evas_pointer_output_xy_get(evas, &mouse_x, &mouse_y); printf("Mouse is at screen position %i, %i\n", mouse_x, mouse_y);
- Parameters:
-
[in] obj The canvas object [out] x The pointer to an integer to be filled in [out] y The pointer to an integer to be filled in