diff options
author | Chris Michael <cp.michael@samsung.com> | 2016-12-14 09:11:50 -0500 |
---|---|---|
committer | Chris Michael <cp.michael@samsung.com> | 2016-12-14 09:18:14 -0500 |
commit | b27ebc6294af07c6a95eefdc8a910973a14fcdc1 (patch) | |
tree | d76171a32131148557ca70ba0be0b8e276d2d30b | |
parent | 73a074498a18dfe5217c3eedec8be9cf1388a1dd (diff) | |
download | efl-b27ebc6294af07c6a95eefdc8a910973a14fcdc1.tar.gz |
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>
-rw-r--r-- | src/lib/elput/Elput.h | 25 | ||||
-rw-r--r-- | src/lib/elput/elput_touch.c | 31 |
2 files changed, 56 insertions, 0 deletions
diff --git a/src/lib/elput/Elput.h b/src/lib/elput/Elput.h index 9429bdb2f9..b48caa12a3 100644 --- a/src/lib/elput/Elput.h +++ b/src/lib/elput/Elput.h @@ -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 diff --git a/src/lib/elput/elput_touch.c b/src/lib/elput/elput_touch.c index 58576a2991..f761ca56bf 100644 --- a/src/lib/elput/elput_touch.c +++ b/src/lib/elput/elput_touch.c @@ -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); +} |