devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=68e1c9e0a008497fe42d43c8908b84810bf06a78
commit 68e1c9e0a008497fe42d43c8908b84810bf06a78 Author: Chris Michael <[email protected]> Date: Wed Dec 14 08:48:37 2016 -0500 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 <[email protected]> --- src/lib/elput/Elput.h | 30 ++++++++++++++++++++++++++++-- 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 edbd496..c69e0b4 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 46b134e..f26318d 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); +} --
