forked from enlightenment/efl
elput: Add API functions to get/set touchpad click method
This patch adds API functions to get or set the click method used on touch devices. The click method defines when to generate software emulated buttons @feature Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
0f81e32433
commit
73a074498a
|
@ -540,6 +540,31 @@ EAPI Eina_Bool elput_touch_scroll_method_set(Elput_Device *device, int method);
|
|||
*/
|
||||
EAPI int elput_touch_scroll_method_get(Elput_Device *device);
|
||||
|
||||
/**
|
||||
* Set the button click method for a device. The button click method defines
|
||||
* when to generate software emulated buttons
|
||||
*
|
||||
* @param device
|
||||
* @param method
|
||||
*
|
||||
* @return EINA_TRUE on success, EINA_FALSE otherwise
|
||||
*
|
||||
* @ingroup Elput_Touch_Group
|
||||
* @since 1.19
|
||||
*/
|
||||
EAPI Eina_Bool elput_touch_click_method_set(Elput_Device *device, int method);
|
||||
|
||||
/**
|
||||
* Get the current button click method for a device
|
||||
*
|
||||
* @param device
|
||||
*
|
||||
* @return The current button click method
|
||||
*
|
||||
* @ingroup Elput_Touch_Group
|
||||
* @since 1.19
|
||||
*/
|
||||
EAPI int elput_touch_click_method_get(Elput_Device *device);
|
||||
|
||||
# endif
|
||||
|
||||
|
|
|
@ -118,3 +118,23 @@ elput_touch_scroll_method_get(Elput_Device *device)
|
|||
|
||||
return libinput_device_config_scroll_get_method(device->device);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elput_touch_click_method_set(Elput_Device *device, int method)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(device, EINA_FALSE);
|
||||
|
||||
if (libinput_device_config_click_set_method(device->device, method) ==
|
||||
LIBINPUT_CONFIG_STATUS_SUCCESS)
|
||||
return EINA_TRUE;
|
||||
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
elput_touch_click_method_get(Elput_Device *device)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(device, -1);
|
||||
|
||||
return libinput_device_config_click_get_method(device->device);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue