diff options
author | Chris Michael <cp.michael@samsung.com> | 2016-12-14 08:48:37 -0500 |
---|---|---|
committer | Chris Michael <cp.michael@samsung.com> | 2016-12-14 09:18:14 -0500 |
commit | 68e1c9e0a008497fe42d43c8908b84810bf06a78 (patch) | |
tree | 6d958c66e77a46bc6e507187a07307a9be34ff07 | |
parent | 6eb34e2199e45a3f8c0784206d82746ae5face07 (diff) | |
download | efl-68e1c9e0a008497fe42d43c8908b84810bf06a78.tar.gz |
elput: Add API functions to enable/disable dwt support on touchpads
This patch adds API functions to get/set if dwt (disable-while-typing) is
enabled on a touchpad.
@feature
Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r-- | src/lib/elput/Elput.h | 30 | ||||
-rw-r--r-- | src/lib/elput/elput_touch.c | 37 |
2 files changed, 65 insertions, 2 deletions
diff --git a/src/lib/elput/Elput.h b/src/lib/elput/Elput.h index edbd496d9f..c69e0b4703 100644 --- a/src/lib/elput/Elput.h +++ b/src/lib/elput/Elput.h @@ -429,7 +429,7 @@ EAPI void elput_input_pointer_accel_profile_set(Elput_Manager *manager, const ch /** * @defgroup Elput_Touch_Group Configuration of touch devices * - * Functions related to configuration of touch devic + * Functions related to configuration of touch devices */ /** @@ -467,7 +467,7 @@ EAPI Eina_Bool elput_touch_drag_enabled_get(Elput_Device *device); * tap-and-drag will immediately stop the drag. * * @param device - * @param enable + * @param enabled * * @return EINA_TRUE on sucess, EINA_FALSE otherwise * @@ -488,6 +488,32 @@ EAPI Eina_Bool elput_touch_drag_lock_enabled_set(Elput_Device *device, Eina_Bool */ EAPI Eina_Bool elput_touch_drag_lock_enabled_get(Elput_Device *device); +/** + * Enable or disable touchpad dwt (disable-while-typing) feature. When enabled, the + * device will be disabled while typing and for a short period after. + * + * @param device + * @param enabled + * + * @return EINA_TRUE on success, EINA_FALSE otherwise + * + * @ingroup Elput_Touch_Group + * @since 1.19 + */ +EAPI Eina_Bool elput_touch_dwt_enabled_set(Elput_Device *device, Eina_Bool enabled); + +/** + * Get if touchpad dwt (disable-while-typing) is enabled. + * + * @param device + * + * @return EINA_TRUE if enabled, EINA_FALSE otherwise + * + * @ingroup Elput_Touch_Group + * @since 1.19 + */ +EAPI Eina_Bool elput_touch_dwt_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 46b134ed88..f26318d3c9 100644 --- a/src/lib/elput/elput_touch.c +++ b/src/lib/elput/elput_touch.c @@ -61,3 +61,40 @@ elput_touch_drag_lock_enabled_get(Elput_Device *device) return libinput_device_config_tap_get_drag_lock_enabled(device->device); } + +EAPI Eina_Bool +elput_touch_dwt_enabled_set(Elput_Device *device, Eina_Bool enabled) +{ + Eina_Bool ret = EINA_FALSE; + + EINA_SAFETY_ON_NULL_RETURN_VAL(device, EINA_FALSE); + + if (!libinput_device_config_dwt_is_available(device->device)) + return EINA_FALSE; + + if (enabled) + { + ret = + libinput_device_config_dwt_set_enabled(device->device, + LIBINPUT_CONFIG_DWT_ENABLED); + } + else + { + ret = + libinput_device_config_dwt_set_enabled(device->device, + LIBINPUT_CONFIG_DWT_DISABLED); + } + + return ret; +} + +EAPI Eina_Bool +elput_touch_dwt_enabled_get(Elput_Device *device) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(device, EINA_FALSE); + + if (!libinput_device_config_dwt_is_available(device->device)) + return EINA_FALSE; + + return libinput_device_config_dwt_get_enabled(device->device); +} |