diff options
author | Chris Michael <cp.michael@samsung.com> | 2016-12-14 09:04:52 -0500 |
---|---|---|
committer | Chris Michael <cp.michael@samsung.com> | 2016-12-14 09:18:14 -0500 |
commit | 73a074498a18dfe5217c3eedec8be9cf1388a1dd (patch) | |
tree | 6eb6be180dd0add08f73c2a9d024b297b0dee90c /src/lib/elput | |
parent | 0f81e32433d1dedf5daf128ece3423f2b2a56098 (diff) |
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>
Diffstat (limited to 'src/lib/elput')
-rw-r--r-- | src/lib/elput/Elput.h | 25 | ||||
-rw-r--r-- | src/lib/elput/elput_touch.c | 20 |
2 files changed, 45 insertions, 0 deletions
diff --git a/src/lib/elput/Elput.h b/src/lib/elput/Elput.h index 40bc2d920b..9429bdb2f9 100644 --- a/src/lib/elput/Elput.h +++ b/src/lib/elput/Elput.h | |||
@@ -540,6 +540,31 @@ EAPI Eina_Bool elput_touch_scroll_method_set(Elput_Device *device, int method); | |||
540 | */ | 540 | */ |
541 | EAPI int elput_touch_scroll_method_get(Elput_Device *device); | 541 | EAPI int elput_touch_scroll_method_get(Elput_Device *device); |
542 | 542 | ||
543 | /** | ||
544 | * Set the button click method for a device. The button click method defines | ||
545 | * when to generate software emulated buttons | ||
546 | * | ||
547 | * @param device | ||
548 | * @param method | ||
549 | * | ||
550 | * @return EINA_TRUE on success, EINA_FALSE otherwise | ||
551 | * | ||
552 | * @ingroup Elput_Touch_Group | ||
553 | * @since 1.19 | ||
554 | */ | ||
555 | EAPI Eina_Bool elput_touch_click_method_set(Elput_Device *device, int method); | ||
556 | |||
557 | /** | ||
558 | * Get the current button click method for a device | ||
559 | * | ||
560 | * @param device | ||
561 | * | ||
562 | * @return The current button click method | ||
563 | * | ||
564 | * @ingroup Elput_Touch_Group | ||
565 | * @since 1.19 | ||
566 | */ | ||
567 | EAPI int elput_touch_click_method_get(Elput_Device *device); | ||
543 | 568 | ||
544 | # endif | 569 | # endif |
545 | 570 | ||
diff --git a/src/lib/elput/elput_touch.c b/src/lib/elput/elput_touch.c index 821d33df6f..58576a2991 100644 --- a/src/lib/elput/elput_touch.c +++ b/src/lib/elput/elput_touch.c | |||
@@ -118,3 +118,23 @@ elput_touch_scroll_method_get(Elput_Device *device) | |||
118 | 118 | ||
119 | return libinput_device_config_scroll_get_method(device->device); | 119 | return libinput_device_config_scroll_get_method(device->device); |
120 | } | 120 | } |
121 | |||
122 | EAPI Eina_Bool | ||
123 | elput_touch_click_method_set(Elput_Device *device, int method) | ||
124 | { | ||
125 | EINA_SAFETY_ON_NULL_RETURN_VAL(device, EINA_FALSE); | ||
126 | |||
127 | if (libinput_device_config_click_set_method(device->device, method) == | ||
128 | LIBINPUT_CONFIG_STATUS_SUCCESS) | ||
129 | return EINA_TRUE; | ||
130 | |||
131 | return EINA_FALSE; | ||
132 | } | ||
133 | |||
134 | EAPI int | ||
135 | elput_touch_click_method_get(Elput_Device *device) | ||
136 | { | ||
137 | EINA_SAFETY_ON_NULL_RETURN_VAL(device, -1); | ||
138 | |||
139 | return libinput_device_config_click_get_method(device->device); | ||
140 | } | ||