elput: Add API functions to get/set if tap-to-click is enabled

This patch adds API functions to get or set if tap-to-click is enabled
on a touchpad device

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2016-12-14 09:11:50 -05:00
parent 73a074498a
commit b27ebc6294
2 changed files with 56 additions and 0 deletions

View File

@ -566,6 +566,31 @@ EAPI Eina_Bool elput_touch_click_method_set(Elput_Device *device, int method);
*/
EAPI int elput_touch_click_method_get(Elput_Device *device);
/**
* Enable or disable tap-to-click on a given device
*
* @param device
* @param enabled
*
* @return EINA_TRUE on success, EINA_FALSE otherwise
*
* @ingroup Elput_Touch_Group
* @since 1.19
*/
EAPI Eina_Bool elput_touch_tap_enabled_set(Elput_Device *device, Eina_Bool enabled);
/**
* Get if tap-to-click is enabled on a given device
*
* @param device
*
* @return EINA_TRUE if enabled, EINA_FALSE otherwise
*
* @ingroup Elput_Touch_Group
* @since 1.19
*/
EAPI Eina_Bool elput_touch_tap_enabled_get(Elput_Device *device);
# endif
# undef EAPI

View File

@ -138,3 +138,34 @@ elput_touch_click_method_get(Elput_Device *device)
return libinput_device_config_click_get_method(device->device);
}
EAPI Eina_Bool
elput_touch_tap_enabled_set(Elput_Device *device, Eina_Bool enabled)
{
Eina_Bool ret = EINA_FALSE;
EINA_SAFETY_ON_NULL_RETURN_VAL(device, EINA_FALSE);
if (enabled)
{
ret =
libinput_device_config_tap_set_enabled(device->device,
LIBINPUT_CONFIG_TAP_ENABLED);
}
else
{
ret =
libinput_device_config_tap_set_enabled(device->device,
LIBINPUT_CONFIG_TAP_DISABLED);
}
return ret;
}
EAPI Eina_Bool
elput_touch_tap_enabled_get(Elput_Device *device)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(device, EINA_FALSE);
return libinput_device_config_tap_get_enabled(device->device);
}