Tizen Native API
5.5
|
Generate touch and key events.
#include <efl_util.h>
The EFL UTIL API provides functions to initialize/deinitialize input devices and to generation touch / key events.
Functions | |
efl_util_inputgen_h | efl_util_input_initialize_generator (unsigned int dev_type) |
Initializes system and check input generate functions are supported, open devices generated events. | |
efl_util_inputgen_h | efl_util_input_initialize_generator_with_name (unsigned int dev_type, const char *name) |
Initializes system, check input generate functions are supported and then open events generator devices with given name. | |
efl_util_inputgen_h | efl_util_input_initialize_generator_with_sync (unsigned int dev_type, const char *name) |
Initializes the system, checks if input generated functions are supported and then open events generator devices synchronously. | |
int | efl_util_input_deinitialize_generator (efl_util_inputgen_h inputgen_h) |
Deinitializes system and close opened devices. | |
int | efl_util_input_generate_key (efl_util_inputgen_h inputgen_h, const char *key_name, int pressed) |
Generates all of key events using a opened device. | |
int | efl_util_input_generate_touch (efl_util_inputgen_h inputgen_h, int idx, efl_util_input_touch_type_e touch_type, int x, int y) |
Generates a touch event using a opened device. | |
int | efl_util_input_generate_pointer (efl_util_inputgen_h inputgen_h, int buttons, efl_util_input_pointer_type_e pointer_type, int x, int y) |
Generates a pointer event using a opened device. | |
int | efl_util_input_generate_wheel (efl_util_inputgen_h inputgen_h, efl_util_input_pointer_wheel_type_e wheel_type, int value) |
Generates a wheel event using an opened device. | |
int | efl_util_input_generate_touch_axis (efl_util_inputgen_h inputgen_h, int idx, efl_util_input_touch_type_e touch_type, int x, int y, double radius_x, double radius_y, double pressure, double angle, double palm) |
Generates a touch event using an opened device. | |
Typedefs | |
typedef struct _efl_util_inputgen_h * | efl_util_inputgen_h |
Definition for the input generator handle. |
typedef struct _efl_util_inputgen_h* efl_util_inputgen_h |
Definition for the input generator handle.
Enumeration of device type generated events.
Enumeration of touch event types.
int efl_util_input_deinitialize_generator | ( | efl_util_inputgen_h | inputgen_h | ) |
Deinitializes system and close opened devices.
[in] | inputgen_h | The efl_util_inputgen_h handle |
0
on success, otherwise a negative error value EFL_UTIL_ERROR_NONE | Successful |
EFL_UTIL_ERROR_INVALID_PARAMETER | Invalid parameter |
EFL_UTIL_ERROR_PERMISSION_DENIED | Has no permission to deinitialize input generator |
int efl_util_input_generate_key | ( | efl_util_inputgen_h | inputgen_h, |
const char * | key_name, | ||
int | pressed | ||
) |
Generates all of key events using a opened device.
[in] | inputgen_h | The efl_util_inputgen_h handle |
[in] | key_name | The key name want to generate |
[in] | pressed | The value that select key press or release (0: release, 1: press) |
0
on success, otherwise a negative error value EFL_UTIL_ERROR_NONE | Successful |
EFL_UTIL_ERROR_INVALID_PARAMETER | Invalid parameter |
EFL_UTIL_ERROR_PERMISSION_DENIED | Has no permission to generate key |
int efl_util_input_generate_pointer | ( | efl_util_inputgen_h | inputgen_h, |
int | buttons, | ||
efl_util_input_pointer_type_e | pointer_type, | ||
int | x, | ||
int | y | ||
) |
Generates a pointer event using a opened device.
[in] | inputgen_h | The efl_util_inputgen_h handle |
[in] | buttons | The number of button |
[in] | pointer_type | The pointer type (ex> #EFL_UTIL_INPUT_POINTER_BUTTON_PRESS, EFL_UTIL_INPUT_POINTER_BUTTON_UP, EFL_UTIL_INPUT_POINTER_MOVE) |
[in] | x | x coordination to move |
[in] | y | y coordination to move |
0
on success, otherwise a negative error value EFL_UTIL_ERROR_NONE | Successful |
EFL_UTIL_ERROR_INVALID_PARAMETER | Invalid parameter |
EFL_UTIL_ERROR_PERMISSION_DENIED | Has no permission to generate pointer |
EFL_UTIL_ERROR_NO_SUCH_DEVICE | No such device or address |
EFL_UTIL_ERROR_OUT_OF_MEMORY | Memory allocation failure |
int efl_util_input_generate_touch | ( | efl_util_inputgen_h | inputgen_h, |
int | idx, | ||
efl_util_input_touch_type_e | touch_type, | ||
int | x, | ||
int | y | ||
) |
Generates a touch event using a opened device.
[in] | inputgen_h | The efl_util_inputgen_h handle |
[in] | idx | The index of touched finger |
[in] | touch_type | The touch type (ex> EFL_UTIL_INPUT_TOUCH_BEGIN, EFL_UTIL_INPUT_TOUCH_UPDATE, EFL_UTIL_INPUT_TOUCH_END) |
[in] | x | The x axis of touch point |
[in] | y | The y axis of touch point |
0
on success, otherwise a negative error value EFL_UTIL_ERROR_NONE | Successful |
EFL_UTIL_ERROR_INVALID_PARAMETER | Invalid parameter |
EFL_UTIL_ERROR_PERMISSION_DENIED | Has no permission to generate touch |
int efl_util_input_generate_touch_axis | ( | efl_util_inputgen_h | inputgen_h, |
int | idx, | ||
efl_util_input_touch_type_e | touch_type, | ||
int | x, | ||
int | y, | ||
double | radius_x, | ||
double | radius_y, | ||
double | pressure, | ||
double | angle, | ||
double | palm | ||
) |
Generates a touch event using an opened device.
Normally touch events are represented by a specific point (x, y). But there are many contact points between touchscreen and fingers. The coordinates (x, y) are the center of the contact area, and the area where the finger and the touchscreen come into contact is represented with an ellipse. To give information about the size of the touching cllipse, use radius_x and radius_y. The value of idx is touch index used in multi-touch. 0 means first touch, 1 means second touch and the index increases further. General devices support 10 touch indices(0 ~ 9), but this may differ depending on the device. Some devices may not support the palm value, and this value is closely dependent on device. The value of x, y, radius_x, radius_y, pressure and palm must be greater than 0. The angle is the angle between the vertical edge of the device and the y-axis of the ellipse. If the angle is 0, then the ellipse's y-axis is parallel to the device's vertical edge.
[in] | inputgen_h | The efl_util_inputgen_h handle |
[in] | idx | The index of the touching finger, used in multi-touch |
[in] | touch_type | The touch type (ex> EFL_UTIL_INPUT_TOUCH_BEGIN, EFL_UTIL_INPUT_TOUCH_UPDATE, EFL_UTIL_INPUT_TOUCH_END) |
[in] | x | The x coordinate of the touch point |
[in] | y | The y coordinate of the touch point |
[in] | radius_x | The x-axis radius of the touching ellipse before rotation |
[in] | radius_y | The y-axis radius of the touching ellipse before rotation |
[in] | pressure | The pressure on the contact touch area |
[in] | angle | The rotation angle of the touching ellipse, in degrees |
[in] | palm | The palm area of the contact touch area |
0
on success, otherwise a negative error value EFL_UTIL_ERROR_NONE | Successful |
EFL_UTIL_ERROR_INVALID_PARAMETER | Invalid parameter |
EFL_UTIL_ERROR_PERMISSION_DENIED | No permission to generate a touch event |
EFL_UTIL_ERROR_NO_SUCH_DEVICE | No such device or address |
EFL_UTIL_ERROR_OUT_OF_MEMORY | Memory allocation failure |
EFL_UTIL_ERROR_NOT_SUPPORTED | Not supported |
int efl_util_input_generate_wheel | ( | efl_util_inputgen_h | inputgen_h, |
efl_util_input_pointer_wheel_type_e | wheel_type, | ||
int | value | ||
) |
Generates a wheel event using an opened device.
Commonly wheel events are generated with one of two orientations, vertical and horizontal. efl_util_input_pointer_wheel_type_e has enums for orientations. For each orientation there is a value which represents both size and direction. For EFL_UTIL_INPUT_POINTER_WHEEL_VERT, if the value is positive, the direction is "up", if it's negative, the direction is "down" For EFL_UTIL_INPUT_POINTER_WHEEL_HORZ, if the value is positive, the direction is "right", if it's negative, the direction is "left" General mouse devices generate wheel events with value 1 or -1, but some mouse devices have a smooth wheel which generates wheel events with value bigger than absolute 1.
[in] | inputgen_h | The efl_util_inputgen_h handle |
[in] | wheel_type | The wheel type (ex> EFL_UTIL_INPUT_POINTER_WHEEL_VERT, EFL_UTIL_INPUT_POINTER_WHEEL_HORZ) |
[in] | value | The wheel value |
0
on success, otherwise a negative error value EFL_UTIL_ERROR_NONE | Successful |
EFL_UTIL_ERROR_INVALID_PARAMETER | Invalid parameter |
EFL_UTIL_ERROR_PERMISSION_DENIED | No permission to generate a wheel event |
EFL_UTIL_ERROR_NO_SUCH_DEVICE | No such device or address |
EFL_UTIL_ERROR_OUT_OF_MEMORY | Memory allocation failure |
EFL_UTIL_ERROR_NOT_SUPPORTED | Not supported |
efl_util_inputgen_h efl_util_input_initialize_generator | ( | unsigned int | dev_type | ) |
Initializes system and check input generate functions are supported, open devices generated events.
[in] | dev_type | The device type want to generate events (ex> EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN | EFL_UTIL_INPUT_DEVTYPE_KEYBOARD) |
NULL
efl_util_inputgen_h | The input generator handle |
EFL_UTIL_ERROR_NONE | Successful |
EFL_UTIL_ERROR_INVALID_PARAMETER | Invalid parameter |
EFL_UTIL_ERROR_NO_SUCH_DEVICE | No such device or address |
EFL_UTIL_ERROR_INVALID_OPERATION | Function not implemented |
EFL_UTIL_ERROR_OUT_OF_MEMORY | Memory allocation failure |
EFL_UTIL_ERROR_PERMISSION_DENIED | Has no permission to initialize input generator |
efl_util_inputgen_h efl_util_input_initialize_generator_with_name | ( | unsigned int | dev_type, |
const char * | name | ||
) |
Initializes system, check input generate functions are supported and then open events generator devices with given name.
[in] | dev_type | The device type want to generate events (ex> EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN | EFL_UTIL_INPUT_DEVTYPE_KEYBOARD) |
[in] | name | The device name (maximum 31 characters) |
NULL
efl_util_inputgen_h | The input generator handle |
EFL_UTIL_ERROR_NONE | Successful |
EFL_UTIL_ERROR_INVALID_PARAMETER | Invalid parameter |
EFL_UTIL_ERROR_NO_SUCH_DEVICE | No such device or address |
EFL_UTIL_ERROR_INVALID_OPERATION | Function not implemented |
EFL_UTIL_ERROR_OUT_OF_MEMORY | Memory allocation failure |
EFL_UTIL_ERROR_PERMISSION_DENIED | Has no permission to initialize input generator |
efl_util_inputgen_h efl_util_input_initialize_generator_with_sync | ( | unsigned int | dev_type, |
const char * | name | ||
) |
Initializes the system, checks if input generated functions are supported and then open events generator devices synchronously.
[in] | dev_type | The device type to generate events, values of efl_util_input_device_type_e combined with bitwise 'or' Example: EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN | EFL_UTIL_INPUT_DEVTYPE_KEYBOARD |
[in] | name | The device name (maximum 31 characters, can be NULL) |
NULL
efl_util_inputgen_h | The input generator handle |
EFL_UTIL_ERROR_NONE | Successful |
EFL_UTIL_ERROR_INVALID_PARAMETER | Invalid parameter |
EFL_UTIL_ERROR_NO_SUCH_DEVICE | No such device or address |
EFL_UTIL_ERROR_INVALID_OPERATION | Function not implemented |
EFL_UTIL_ERROR_OUT_OF_MEMORY | Memory allocation failure |
EFL_UTIL_ERROR_PERMISSION_DENIED | Has no permission to initialize input generator |