Tizen Native API  7.0
EFL UTIL INPUT

Generate touch and key events.

Required Header

#include <efl_util.h>

Overview

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_set_touch_count (int max_count)
 Requests to set the maximum touch count.
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 Documentation

typedef struct _efl_util_inputgen_h* efl_util_inputgen_h

Definition for the input generator handle.

Warning:
This is not for use by third-party applications.
Since :
2.4

Enumeration Type Documentation

Enumeration of device type generated events.

Warning:
This is not for use by third-party applications.
Since :
2.4
Enumerator:
EFL_UTIL_INPUT_DEVTYPE_NONE 

(Deprecated since 3.0.)

EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN 

Touch Screen device

EFL_UTIL_INPUT_DEVTYPE_KEYBOARD 

Keyboard device

EFL_UTIL_INPUT_DEVTYPE_POINTER 

Mouse device (Since 3.0)

EFL_UTIL_INPUT_DEVTYPE_ALL 

Both of touch screen and keyboard device (Deprecated since 3.0. Check all enumerations using OR operand instead)

EFL_UTIL_INPUT_DEVTYPE_MAX 

(Deprecated since 3.0.)

Enumeration of pointer event types.

Warning:
This is not for use by third-party applications.
Since :
3.0
Enumerator:
EFL_UTIL_INPUT_POINTER_BUTTON_DOWN 

Mouse button press.

EFL_UTIL_INPUT_POINTER_BUTTON_UP 

Mouse move.

EFL_UTIL_INPUT_POINTER_MOVE 

Mouse button release.

Enumeration of pointer wheel event types.

Warning:
This is not for use by third-party applications.
Since :
5.5
Enumerator:
EFL_UTIL_INPUT_POINTER_WHEEL_VERT 

Vertical wheel.

EFL_UTIL_INPUT_POINTER_WHEEL_HORZ 

Horizontal wheel.

Enumeration of touch event types.

Warning:
This is not for use by third-party applications.
Since :
2.4
Enumerator:
EFL_UTIL_INPUT_TOUCH_NONE 

(Deprecated since 3.0.)

EFL_UTIL_INPUT_TOUCH_BEGIN 

Finger press. It is same a behavior put your finger on touch screen

EFL_UTIL_INPUT_TOUCH_UPDATE 

Finger move. It is same a behavior move your finger on touch screen

EFL_UTIL_INPUT_TOUCH_END 

Finger release. It is same a behavior release your finger on touch screen

EFL_UTIL_INPUT_TOUCH_MAX 

(Deprecated since 3.0.)


Function Documentation

Deinitializes system and close opened devices.

Warning:
This is not for use by third-party applications.
Since :
2.4
Privilege Level:
platform
Privilege:
http://tizen.org/privilege/inputgenerator
Parameters:
[in]inputgen_hThe efl_util_inputgen_h handle
Returns:
0 on success, otherwise a negative error value
Return values:
EFL_UTIL_ERROR_NONESuccessful
EFL_UTIL_ERROR_INVALID_PARAMETERInvalid parameter
EFL_UTIL_ERROR_PERMISSION_DENIEDHas no permission to deinitialize input generator
See also:
efl_util_input_initialize_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.

Warning:
This is not for use by third-party applications.
Since :
2.4
Privilege Level:
platform
Privilege:
http://tizen.org/privilege/inputgenerator
Parameters:
[in]inputgen_hThe efl_util_inputgen_h handle
[in]key_nameThe key name want to generate
[in]pressedThe value that select key press or release (0: release, 1: press)
Returns:
0 on success, otherwise a negative error value
Return values:
EFL_UTIL_ERROR_NONESuccessful
EFL_UTIL_ERROR_INVALID_PARAMETERInvalid parameter
EFL_UTIL_ERROR_PERMISSION_DENIEDHas 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.

Warning:
This is not for use by third-party applications.
Since :
3.0
Privilege Level:
platform
Privilege:
http://tizen.org/privilege/inputgenerator
Parameters:
[in]inputgen_hThe efl_util_inputgen_h handle
[in]buttonsThe number of button
[in]pointer_typeThe pointer type (ex> #EFL_UTIL_INPUT_POINTER_BUTTON_PRESS, EFL_UTIL_INPUT_POINTER_BUTTON_UP, EFL_UTIL_INPUT_POINTER_MOVE)
[in]xx coordination to move
[in]yy coordination to move
Returns:
0 on success, otherwise a negative error value
Return values:
EFL_UTIL_ERROR_NONESuccessful
EFL_UTIL_ERROR_INVALID_PARAMETERInvalid parameter
EFL_UTIL_ERROR_PERMISSION_DENIEDHas no permission to generate pointer
EFL_UTIL_ERROR_NO_SUCH_DEVICENo such device or address
EFL_UTIL_ERROR_OUT_OF_MEMORYMemory 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.

Warning:
This is not for use by third-party applications.
Since :
2.4
Privilege Level:
platform
Privilege:
http://tizen.org/privilege/inputgenerator
Parameters:
[in]inputgen_hThe efl_util_inputgen_h handle
[in]idxThe index of touched finger
[in]touch_typeThe touch type (ex> EFL_UTIL_INPUT_TOUCH_BEGIN, EFL_UTIL_INPUT_TOUCH_UPDATE, EFL_UTIL_INPUT_TOUCH_END)
[in]xThe x axis of touch point
[in]yThe y axis of touch point
Returns:
0 on success, otherwise a negative error value
Return values:
EFL_UTIL_ERROR_NONESuccessful
EFL_UTIL_ERROR_INVALID_PARAMETERInvalid parameter
EFL_UTIL_ERROR_PERMISSION_DENIEDHas 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.

Warning:
This is not for use by third-party applications.

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.

Since :
5.5
Privilege Level:
platform
Privilege:
http://tizen.org/privilege/inputgenerator
Parameters:
[in]inputgen_hThe efl_util_inputgen_h handle
[in]idxThe index of the touching finger, used in multi-touch
[in]touch_typeThe touch type (ex> EFL_UTIL_INPUT_TOUCH_BEGIN, EFL_UTIL_INPUT_TOUCH_UPDATE, EFL_UTIL_INPUT_TOUCH_END)
[in]xThe x coordinate of the touch point
[in]yThe y coordinate of the touch point
[in]radius_xThe x-axis radius of the touching ellipse before rotation
[in]radius_yThe y-axis radius of the touching ellipse before rotation
[in]pressureThe pressure on the contact touch area
[in]angleThe rotation angle of the touching ellipse, in degrees
[in]palmThe palm area of the contact touch area
Returns:
0 on success, otherwise a negative error value
Return values:
EFL_UTIL_ERROR_NONESuccessful
EFL_UTIL_ERROR_INVALID_PARAMETERInvalid parameter
EFL_UTIL_ERROR_PERMISSION_DENIEDNo permission to generate a touch event
EFL_UTIL_ERROR_NO_SUCH_DEVICENo such device or address
EFL_UTIL_ERROR_OUT_OF_MEMORYMemory allocation failure
EFL_UTIL_ERROR_NOT_SUPPORTEDNot supported

Generates a wheel event using an opened device.

Warning:
This is not for use by third-party applications.

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.

Since :
5.5
Privilege Level:
platform
Privilege:
http://tizen.org/privilege/inputgenerator
Parameters:
[in]inputgen_hThe efl_util_inputgen_h handle
[in]wheel_typeThe wheel type (ex> EFL_UTIL_INPUT_POINTER_WHEEL_VERT, EFL_UTIL_INPUT_POINTER_WHEEL_HORZ)
[in]valueThe wheel value
Returns:
0 on success, otherwise a negative error value
Return values:
EFL_UTIL_ERROR_NONESuccessful
EFL_UTIL_ERROR_INVALID_PARAMETERInvalid parameter
EFL_UTIL_ERROR_PERMISSION_DENIEDNo permission to generate a wheel event
EFL_UTIL_ERROR_NO_SUCH_DEVICENo such device or address
EFL_UTIL_ERROR_OUT_OF_MEMORYMemory allocation failure
EFL_UTIL_ERROR_NOT_SUPPORTEDNot supported

Initializes system and check input generate functions are supported, open devices generated events.

Warning:
This is not for use by third-party applications.
Since :
2.4
Privilege Level:
platform
Privilege:
http://tizen.org/privilege/inputgenerator
Remarks:
The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
The dev_type is changed into the unsigned int to perform bitwise operations. (Since 3.0)
Parameters:
[in]dev_typeThe device type want to generate events (ex> EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN | EFL_UTIL_INPUT_DEVTYPE_KEYBOARD)
Returns:
efl_util_inputgen_h on success, otherwise NULL
Return values:
efl_util_inputgen_hThe input generator handle
Exceptions:
EFL_UTIL_ERROR_NONESuccessful
EFL_UTIL_ERROR_INVALID_PARAMETERInvalid parameter
EFL_UTIL_ERROR_NO_SUCH_DEVICENo such device or address
EFL_UTIL_ERROR_INVALID_OPERATIONFunction not implemented
EFL_UTIL_ERROR_OUT_OF_MEMORYMemory allocation failure
EFL_UTIL_ERROR_PERMISSION_DENIEDHas no permission to initialize input generator
See also:
efl_util_input_deinitialize_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.

Warning:
This is not for use by third-party applications.
Since :
4.0
Privilege Level:
platform
Privilege:
http://tizen.org/privilege/inputgenerator
Remarks:
The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
The dev_type is changed into the unsigned int to perform bitwise operations.
Parameters:
[in]dev_typeThe device type want to generate events (ex> EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN | EFL_UTIL_INPUT_DEVTYPE_KEYBOARD)
[in]nameThe device name (maximum 31 characters)
Returns:
efl_util_inputgen_h on success, otherwise NULL
Return values:
efl_util_inputgen_hThe input generator handle
Exceptions:
EFL_UTIL_ERROR_NONESuccessful
EFL_UTIL_ERROR_INVALID_PARAMETERInvalid parameter
EFL_UTIL_ERROR_NO_SUCH_DEVICENo such device or address
EFL_UTIL_ERROR_INVALID_OPERATIONFunction not implemented
EFL_UTIL_ERROR_OUT_OF_MEMORYMemory allocation failure
EFL_UTIL_ERROR_PERMISSION_DENIEDHas no permission to initialize input generator
See also:
efl_util_input_deinitialize_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.

Warning:
This is not for use by third-party applications.
Since :
5.0
Privilege Level:
platform
Privilege:
http://tizen.org/privilege/inputgenerator
Remarks:
The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
dev_type is changed into the unsigned int to perform bitwise operations.
If the name is NULL, it will be set to "Input Generator"
The returned object should be released with efl_util_input_deinitialize_generator().
Parameters:
[in]dev_typeThe 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]nameThe device name (maximum 31 characters, can be NULL)
Returns:
efl_util_inputgen_h on success, otherwise NULL
Return values:
efl_util_inputgen_hThe input generator handle
Exceptions:
EFL_UTIL_ERROR_NONESuccessful
EFL_UTIL_ERROR_INVALID_PARAMETERInvalid parameter
EFL_UTIL_ERROR_NO_SUCH_DEVICENo such device or address
EFL_UTIL_ERROR_INVALID_OPERATIONFunction not implemented
EFL_UTIL_ERROR_OUT_OF_MEMORYMemory allocation failure
EFL_UTIL_ERROR_PERMISSION_DENIEDHas no permission to initialize input generator
See also:
efl_util_input_deinitialize_generator()
int efl_util_input_set_touch_count ( int  max_count)

Requests to set the maximum touch count.

Warning:
This is not for use by third-party applications.
Since :
6.5
Privilege Level:
platform
Privilege:
http://tizen.org/privilege/inputgenerator
Remarks:
If you would like to generate more touch count supported than the display server supports, you can use this API to increase the maximum touch count. Note that this API returns success only when there is no configuration enabled about maximum touch count in the display server.
Parameters:
[in]max_countThe maximum number of touches want to generate.
Returns:
0 on success, otherwise a negative error value
Return values:
EFL_UTIL_ERROR_NONESuccessful
EFL_UTIL_ERROR_INVALID_PARAMETERInvalid parameter
EFL_UTIL_ERROR_PERMISSION_DENIEDHas no permission to deinitialize input generator
EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLEResource is not available