| 1 |
/* |
| 2 |
* Copyright © 2014 Red Hat, Inc. |
| 3 |
* |
| 4 |
* Permission is hereby granted, free of charge, to any person obtaining a |
| 5 |
* copy of this software and associated documentation files (the "Software"), |
| 6 |
* to deal in the Software without restriction, including without limitation |
| 7 |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 8 |
* and/or sell copies of the Software, and to permit persons to whom the |
| 9 |
* Software is furnished to do so, subject to the following conditions: |
| 10 |
* |
| 11 |
* The above copyright notice and this permission notice (including the next |
| 12 |
* paragraph) shall be included in all copies or substantial portions of the |
| 13 |
* Software. |
| 14 |
* |
| 15 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 16 |
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 17 |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 18 |
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 19 |
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 20 |
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 21 |
* DEALINGS IN THE SOFTWARE. |
| 22 |
*/ |
| 23 |
|
| 24 |
#include <config.h> |
| 25 |
|
| 26 |
#include <errno.h> |
| 27 |
#include <fcntl.h> |
| 28 |
#include <libinput.h> |
| 29 |
#include <unistd.h> |
| 30 |
|
| 31 |
#include "libinput-util.h" |
| 32 |
#include "litest.h" |
| 33 |
|
| 34 |
START_TEST(touchpad_button) |
| 35 |
{ |
| 36 |
struct litest_device *dev = litest_current_device(); |
| 37 |
struct libinput *li = dev->libinput; |
| 38 |
|
| 39 |
if (!libevdev_has_event_code(dev->evdev, EV_KEY, BTN_LEFT)) |
| 40 |
return LITEST_NOT_APPLICABLE; |
| 41 |
|
| 42 |
litest_drain_events(li); |
| 43 |
|
| 44 |
litest_button_click(dev, BTN_LEFT, true); |
| 45 |
litest_dispatch(li); |
| 46 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 47 |
litest_button_click(dev, BTN_LEFT, false); |
| 48 |
litest_dispatch(li); |
| 49 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 50 |
} |
| 51 |
END_TEST |
| 52 |
|
| 53 |
START_TEST(touchpad_click_defaults_clickfinger) |
| 54 |
{ |
| 55 |
struct litest_device *dev = litest_current_device(); |
| 56 |
struct libinput_device *device = dev->libinput_device; |
| 57 |
uint32_t methods, method; |
| 58 |
enum libinput_config_status status; |
| 59 |
|
| 60 |
/* call this test for apple touchpads */ |
| 61 |
|
| 62 |
methods = libinput_device_config_click_get_methods(device); |
| 63 |
litest_assert(methods & LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS); |
| 64 |
litest_assert(methods & LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER); |
| 65 |
|
| 66 |
method = libinput_device_config_click_get_method(device); |
| 67 |
litest_assert_enum_eq(method, LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER); |
| 68 |
method = libinput_device_config_click_get_default_method(device); |
| 69 |
litest_assert_enum_eq(method, LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER); |
| 70 |
|
| 71 |
status = libinput_device_config_click_set_method( |
| 72 |
device, |
| 73 |
LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS); |
| 74 |
litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); |
| 75 |
status = libinput_device_config_click_set_method( |
| 76 |
device, |
| 77 |
LIBINPUT_CONFIG_CLICK_METHOD_NONE); |
| 78 |
litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); |
| 79 |
} |
| 80 |
END_TEST |
| 81 |
|
| 82 |
START_TEST(touchpad_click_default_clickfinger_map) |
| 83 |
{ |
| 84 |
struct litest_device *dev = litest_current_device(); |
| 85 |
struct libinput_device *device = dev->libinput_device; |
| 86 |
enum libinput_config_clickfinger_button_map map; |
| 87 |
|
| 88 |
map = libinput_device_config_click_get_clickfinger_button_map(device); |
| 89 |
litest_assert_enum_eq(map, LIBINPUT_CONFIG_CLICKFINGER_MAP_LRM); |
| 90 |
map = libinput_device_config_click_get_default_clickfinger_button_map(device); |
| 91 |
litest_assert_enum_eq(map, LIBINPUT_CONFIG_CLICKFINGER_MAP_LRM); |
| 92 |
} |
| 93 |
END_TEST |
| 94 |
|
| 95 |
START_TEST(touchpad_click_set_clickfinger_map) |
| 96 |
{ |
| 97 |
struct litest_device *dev = litest_current_device(); |
| 98 |
struct libinput_device *device = dev->libinput_device; |
| 99 |
enum libinput_config_clickfinger_button_map map; |
| 100 |
enum libinput_config_status status; |
| 101 |
|
| 102 |
map = LIBINPUT_CONFIG_CLICKFINGER_MAP_LRM; |
| 103 |
status = libinput_device_config_click_set_clickfinger_button_map(device, map); |
| 104 |
litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); |
| 105 |
map = libinput_device_config_click_get_clickfinger_button_map( |
| 106 |
dev->libinput_device); |
| 107 |
litest_assert_enum_eq(map, LIBINPUT_CONFIG_CLICKFINGER_MAP_LRM); |
| 108 |
|
| 109 |
map = LIBINPUT_CONFIG_CLICKFINGER_MAP_LMR; |
| 110 |
status = libinput_device_config_click_set_clickfinger_button_map(device, map); |
| 111 |
litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); |
| 112 |
map = libinput_device_config_click_get_clickfinger_button_map( |
| 113 |
dev->libinput_device); |
| 114 |
litest_assert_enum_eq(map, LIBINPUT_CONFIG_CLICKFINGER_MAP_LMR); |
| 115 |
|
| 116 |
map = LIBINPUT_CONFIG_CLICKFINGER_MAP_LRM - 1; |
| 117 |
status = libinput_device_config_click_set_clickfinger_button_map(device, map); |
| 118 |
litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); |
| 119 |
|
| 120 |
map = LIBINPUT_CONFIG_CLICKFINGER_MAP_LMR + 1; |
| 121 |
status = libinput_device_config_click_set_clickfinger_button_map(device, map); |
| 122 |
litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); |
| 123 |
} |
| 124 |
END_TEST |
| 125 |
|
| 126 |
START_TEST(touchpad_click_defaults_btnarea) |
| 127 |
{ |
| 128 |
struct litest_device *dev = litest_current_device(); |
| 129 |
struct libinput_device *device = dev->libinput_device; |
| 130 |
uint32_t methods, method; |
| 131 |
enum libinput_config_status status; |
| 132 |
|
| 133 |
/* call this test for non-apple clickpads */ |
| 134 |
|
| 135 |
methods = libinput_device_config_click_get_methods(device); |
| 136 |
litest_assert(methods & LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER); |
| 137 |
litest_assert(methods & LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS); |
| 138 |
|
| 139 |
method = libinput_device_config_click_get_method(device); |
| 140 |
litest_assert_enum_eq(method, LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS); |
| 141 |
method = libinput_device_config_click_get_default_method(device); |
| 142 |
litest_assert_enum_eq(method, LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS); |
| 143 |
|
| 144 |
status = libinput_device_config_click_set_method( |
| 145 |
device, |
| 146 |
LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER); |
| 147 |
litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); |
| 148 |
status = libinput_device_config_click_set_method( |
| 149 |
device, |
| 150 |
LIBINPUT_CONFIG_CLICK_METHOD_NONE); |
| 151 |
litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); |
| 152 |
} |
| 153 |
END_TEST |
| 154 |
|
| 155 |
START_TEST(touchpad_click_defaults_none) |
| 156 |
{ |
| 157 |
struct litest_device *dev = litest_current_device(); |
| 158 |
struct libinput_device *device = dev->libinput_device; |
| 159 |
uint32_t methods, method; |
| 160 |
enum libinput_config_status status; |
| 161 |
|
| 162 |
if (libevdev_get_id_vendor(dev->evdev) == VENDOR_ID_APPLE && |
| 163 |
libevdev_get_id_product(dev->evdev) == PRODUCT_ID_APPLE_APPLETOUCH) |
| 164 |
return LITEST_NOT_APPLICABLE; |
| 165 |
|
| 166 |
/* call this test for non-clickpads and non-touchpads */ |
| 167 |
|
| 168 |
methods = libinput_device_config_click_get_methods(device); |
| 169 |
litest_assert_int_eq(methods, 0U); |
| 170 |
|
| 171 |
method = libinput_device_config_click_get_method(device); |
| 172 |
litest_assert_enum_eq(method, LIBINPUT_CONFIG_CLICK_METHOD_NONE); |
| 173 |
method = libinput_device_config_click_get_default_method(device); |
| 174 |
litest_assert_enum_eq(method, LIBINPUT_CONFIG_CLICK_METHOD_NONE); |
| 175 |
|
| 176 |
status = libinput_device_config_click_set_method( |
| 177 |
device, |
| 178 |
LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER); |
| 179 |
litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); |
| 180 |
status = libinput_device_config_click_set_method( |
| 181 |
device, |
| 182 |
LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS); |
| 183 |
litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); |
| 184 |
} |
| 185 |
END_TEST |
| 186 |
|
| 187 |
START_TEST(touchpad_1fg_clickfinger) |
| 188 |
{ |
| 189 |
struct litest_device *dev = litest_current_device(); |
| 190 |
struct libinput *li = dev->libinput; |
| 191 |
|
| 192 |
litest_enable_clickfinger(dev); |
| 193 |
|
| 194 |
litest_drain_events(li); |
| 195 |
|
| 196 |
litest_touch_down(dev, 0, 50, 50); |
| 197 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 198 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 199 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 200 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 201 |
litest_touch_up(dev, 0); |
| 202 |
|
| 203 |
litest_dispatch(li); |
| 204 |
|
| 205 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 206 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 207 |
} |
| 208 |
END_TEST |
| 209 |
|
| 210 |
START_TEST(touchpad_1fg_clickfinger_no_touch) |
| 211 |
{ |
| 212 |
struct litest_device *dev = litest_current_device(); |
| 213 |
struct libinput *li = dev->libinput; |
| 214 |
|
| 215 |
if (dev->which == LITEST_SYNAPTICS_PHANTOMCLICKS) { |
| 216 |
/* The XPS 15 9500 touchpad has the ModelTouchpadPhantomClicks |
| 217 |
* quirk enabled and doesn't generate events without touches. */ |
| 218 |
return LITEST_NOT_APPLICABLE; |
| 219 |
} |
| 220 |
|
| 221 |
litest_enable_clickfinger(dev); |
| 222 |
|
| 223 |
litest_drain_events(li); |
| 224 |
|
| 225 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 226 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 227 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 228 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 229 |
|
| 230 |
litest_dispatch(li); |
| 231 |
|
| 232 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 233 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 234 |
} |
| 235 |
END_TEST |
| 236 |
|
| 237 |
START_TEST(touchpad_1fg_clickfinger_no_touch_phantomclicks) |
| 238 |
{ |
| 239 |
struct litest_device *dev = litest_current_device(); |
| 240 |
struct libinput *li = dev->libinput; |
| 241 |
|
| 242 |
litest_enable_clickfinger(dev); |
| 243 |
|
| 244 |
litest_drain_events(li); |
| 245 |
|
| 246 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 247 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 248 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 249 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 250 |
|
| 251 |
litest_dispatch(li); |
| 252 |
|
| 253 |
litest_assert_empty_queue(li); |
| 254 |
} |
| 255 |
END_TEST |
| 256 |
|
| 257 |
START_TEST(touchpad_2fg_clickfinger) |
| 258 |
{ |
| 259 |
struct litest_device *dev = litest_current_device(); |
| 260 |
struct libinput *li = dev->libinput; |
| 261 |
unsigned int button = 0; |
| 262 |
enum libinput_config_clickfinger_button_map map = |
| 263 |
litest_test_param_get_i32(test_env->params, "map"); |
| 264 |
|
| 265 |
litest_enable_clickfinger(dev); |
| 266 |
litest_set_clickfinger_map(dev, map); |
| 267 |
|
| 268 |
switch (map) { |
| 269 |
case LIBINPUT_CONFIG_CLICKFINGER_MAP_LRM: |
| 270 |
button = BTN_RIGHT; |
| 271 |
break; |
| 272 |
case LIBINPUT_CONFIG_CLICKFINGER_MAP_LMR: |
| 273 |
button = BTN_MIDDLE; |
| 274 |
break; |
| 275 |
default: |
| 276 |
litest_abort_msg("Invalid map range %d", map); |
| 277 |
} |
| 278 |
|
| 279 |
litest_drain_events(li); |
| 280 |
|
| 281 |
litest_touch_down(dev, 0, 50, 50); |
| 282 |
litest_touch_down(dev, 1, 70, 70); |
| 283 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 284 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 285 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 286 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 287 |
litest_touch_up(dev, 0); |
| 288 |
litest_touch_up(dev, 1); |
| 289 |
|
| 290 |
litest_dispatch(li); |
| 291 |
|
| 292 |
litest_assert_button_event(li, button, LIBINPUT_BUTTON_STATE_PRESSED); |
| 293 |
litest_assert_button_event(li, button, LIBINPUT_BUTTON_STATE_RELEASED); |
| 294 |
} |
| 295 |
END_TEST |
| 296 |
|
| 297 |
START_TEST(touchpad_3fg_clickfinger) |
| 298 |
{ |
| 299 |
struct litest_device *dev = litest_current_device(); |
| 300 |
struct libinput *li = dev->libinput; |
| 301 |
unsigned int button = 0; |
| 302 |
|
| 303 |
enum libinput_config_clickfinger_button_map map = |
| 304 |
litest_test_param_get_i32(test_env->params, "map"); |
| 305 |
|
| 306 |
if (litest_slot_count(dev) < 3) |
| 307 |
return LITEST_NOT_APPLICABLE; |
| 308 |
|
| 309 |
litest_enable_clickfinger(dev); |
| 310 |
litest_set_clickfinger_map(dev, map); |
| 311 |
|
| 312 |
switch (map) { |
| 313 |
case LIBINPUT_CONFIG_CLICKFINGER_MAP_LRM: |
| 314 |
button = BTN_MIDDLE; |
| 315 |
break; |
| 316 |
case LIBINPUT_CONFIG_CLICKFINGER_MAP_LMR: |
| 317 |
button = BTN_RIGHT; |
| 318 |
break; |
| 319 |
default: |
| 320 |
litest_abort_msg("Invalid map range %d", map); |
| 321 |
} |
| 322 |
|
| 323 |
litest_drain_events(li); |
| 324 |
|
| 325 |
litest_touch_down(dev, 0, 50, 50); |
| 326 |
litest_touch_down(dev, 1, 60, 70); |
| 327 |
litest_touch_down(dev, 2, 70, 70); |
| 328 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 329 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 330 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 331 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 332 |
litest_touch_up(dev, 0); |
| 333 |
litest_touch_up(dev, 1); |
| 334 |
litest_touch_up(dev, 2); |
| 335 |
|
| 336 |
litest_dispatch(li); |
| 337 |
|
| 338 |
litest_assert_button_event(li, button, LIBINPUT_BUTTON_STATE_PRESSED); |
| 339 |
litest_assert_button_event(li, button, LIBINPUT_BUTTON_STATE_RELEASED); |
| 340 |
} |
| 341 |
END_TEST |
| 342 |
|
| 343 |
START_TEST(touchpad_3fg_clickfinger_btntool) |
| 344 |
{ |
| 345 |
struct litest_device *dev = litest_current_device(); |
| 346 |
struct libinput *li = dev->libinput; |
| 347 |
unsigned int button = 0; |
| 348 |
enum libinput_config_clickfinger_button_map map = |
| 349 |
litest_test_param_get_i32(test_env->params, "map"); |
| 350 |
|
| 351 |
if (litest_slot_count(dev) >= 3 || |
| 352 |
!libevdev_has_event_code(dev->evdev, EV_KEY, BTN_TOOL_TRIPLETAP)) |
| 353 |
return LITEST_NOT_APPLICABLE; |
| 354 |
|
| 355 |
litest_enable_clickfinger(dev); |
| 356 |
litest_set_clickfinger_map(dev, map); |
| 357 |
|
| 358 |
switch (map) { |
| 359 |
case LIBINPUT_CONFIG_CLICKFINGER_MAP_LRM: |
| 360 |
button = BTN_MIDDLE; |
| 361 |
break; |
| 362 |
case LIBINPUT_CONFIG_CLICKFINGER_MAP_LMR: |
| 363 |
button = BTN_RIGHT; |
| 364 |
break; |
| 365 |
default: |
| 366 |
litest_abort_msg("Invalid map range %d", map); |
| 367 |
} |
| 368 |
|
| 369 |
litest_drain_events(li); |
| 370 |
|
| 371 |
litest_touch_down(dev, 0, 50, 50); |
| 372 |
litest_touch_down(dev, 1, 60, 70); |
| 373 |
litest_event(dev, EV_KEY, BTN_TOOL_DOUBLETAP, 0); |
| 374 |
litest_event(dev, EV_KEY, BTN_TOOL_TRIPLETAP, 1); |
| 375 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 376 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 377 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 378 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 379 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 380 |
litest_event(dev, EV_KEY, BTN_TOOL_DOUBLETAP, 1); |
| 381 |
litest_event(dev, EV_KEY, BTN_TOOL_TRIPLETAP, 0); |
| 382 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 383 |
litest_touch_up(dev, 0); |
| 384 |
litest_touch_up(dev, 1); |
| 385 |
|
| 386 |
litest_dispatch(li); |
| 387 |
|
| 388 |
litest_assert_button_event(li, button, LIBINPUT_BUTTON_STATE_PRESSED); |
| 389 |
litest_assert_button_event(li, button, LIBINPUT_BUTTON_STATE_RELEASED); |
| 390 |
} |
| 391 |
END_TEST |
| 392 |
|
| 393 |
START_TEST(touchpad_4fg_clickfinger) |
| 394 |
{ |
| 395 |
struct litest_device *dev = litest_current_device(); |
| 396 |
struct libinput *li = dev->libinput; |
| 397 |
|
| 398 |
if (litest_slot_count(dev) < 4) |
| 399 |
return LITEST_NOT_APPLICABLE; |
| 400 |
|
| 401 |
litest_enable_clickfinger(dev); |
| 402 |
|
| 403 |
litest_drain_events(li); |
| 404 |
|
| 405 |
litest_touch_down(dev, 0, 50, 50); |
| 406 |
litest_touch_down(dev, 1, 60, 70); |
| 407 |
litest_touch_down(dev, 2, 70, 70); |
| 408 |
litest_touch_down(dev, 3, 80, 70); |
| 409 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 410 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 411 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 412 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 413 |
litest_touch_up(dev, 0); |
| 414 |
litest_touch_up(dev, 1); |
| 415 |
litest_touch_up(dev, 2); |
| 416 |
litest_touch_up(dev, 3); |
| 417 |
|
| 418 |
litest_dispatch(li); |
| 419 |
|
| 420 |
litest_assert_empty_queue(li); |
| 421 |
} |
| 422 |
END_TEST |
| 423 |
|
| 424 |
START_TEST(touchpad_4fg_clickfinger_btntool_2slots) |
| 425 |
{ |
| 426 |
struct litest_device *dev = litest_current_device(); |
| 427 |
struct libinput *li = dev->libinput; |
| 428 |
|
| 429 |
if (litest_slot_count(dev) >= 3 || |
| 430 |
!libevdev_has_event_code(dev->evdev, EV_KEY, BTN_TOOL_QUADTAP)) |
| 431 |
return LITEST_NOT_APPLICABLE; |
| 432 |
|
| 433 |
litest_enable_clickfinger(dev); |
| 434 |
|
| 435 |
litest_drain_events(li); |
| 436 |
|
| 437 |
litest_touch_down(dev, 0, 50, 50); |
| 438 |
litest_touch_down(dev, 1, 60, 70); |
| 439 |
litest_event(dev, EV_KEY, BTN_TOOL_DOUBLETAP, 0); |
| 440 |
litest_event(dev, EV_KEY, BTN_TOOL_QUADTAP, 1); |
| 441 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 442 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 443 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 444 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 445 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 446 |
litest_event(dev, EV_KEY, BTN_TOOL_DOUBLETAP, 1); |
| 447 |
litest_event(dev, EV_KEY, BTN_TOOL_QUADTAP, 0); |
| 448 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 449 |
litest_touch_up(dev, 0); |
| 450 |
litest_touch_up(dev, 1); |
| 451 |
|
| 452 |
litest_assert_empty_queue(li); |
| 453 |
} |
| 454 |
END_TEST |
| 455 |
|
| 456 |
START_TEST(touchpad_4fg_clickfinger_btntool_3slots) |
| 457 |
{ |
| 458 |
struct litest_device *dev = litest_current_device(); |
| 459 |
struct libinput *li = dev->libinput; |
| 460 |
|
| 461 |
if (litest_slot_count(dev) != 3 || |
| 462 |
!libevdev_has_event_code(dev->evdev, EV_KEY, BTN_TOOL_TRIPLETAP)) |
| 463 |
return LITEST_NOT_APPLICABLE; |
| 464 |
|
| 465 |
litest_enable_clickfinger(dev); |
| 466 |
|
| 467 |
litest_drain_events(li); |
| 468 |
|
| 469 |
litest_touch_down(dev, 0, 50, 50); |
| 470 |
litest_touch_down(dev, 1, 60, 70); |
| 471 |
litest_touch_down(dev, 2, 70, 70); |
| 472 |
litest_event(dev, EV_KEY, BTN_TOOL_TRIPLETAP, 0); |
| 473 |
litest_event(dev, EV_KEY, BTN_TOOL_QUADTAP, 1); |
| 474 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 475 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 476 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 477 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 478 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 479 |
litest_event(dev, EV_KEY, BTN_TOOL_TRIPLETAP, 1); |
| 480 |
litest_event(dev, EV_KEY, BTN_TOOL_QUADTAP, 0); |
| 481 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 482 |
litest_touch_up(dev, 0); |
| 483 |
litest_touch_up(dev, 1); |
| 484 |
litest_touch_up(dev, 2); |
| 485 |
|
| 486 |
litest_dispatch(li); |
| 487 |
|
| 488 |
litest_assert_empty_queue(li); |
| 489 |
} |
| 490 |
END_TEST |
| 491 |
|
| 492 |
START_TEST(touchpad_2fg_clickfinger_distance) |
| 493 |
{ |
| 494 |
struct litest_device *dev = litest_current_device(); |
| 495 |
struct libinput *li = dev->libinput; |
| 496 |
double w, h; |
| 497 |
bool small_touchpad = false; |
| 498 |
unsigned int expected_button = 0; |
| 499 |
enum libinput_config_clickfinger_button_map map = |
| 500 |
litest_test_param_get_i32(test_env->params, "map"); |
| 501 |
|
| 502 |
if (libinput_device_get_size(dev->libinput_device, &w, &h) == 0 && h < 50.0) |
| 503 |
small_touchpad = true; |
| 504 |
|
| 505 |
litest_enable_clickfinger(dev); |
| 506 |
litest_set_clickfinger_map(dev, map); |
| 507 |
|
| 508 |
litest_drain_events(li); |
| 509 |
|
| 510 |
litest_touch_down(dev, 0, 90, 50); |
| 511 |
litest_touch_down(dev, 1, 10, 50); |
| 512 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 513 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 514 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 515 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 516 |
litest_touch_up(dev, 0); |
| 517 |
litest_touch_up(dev, 1); |
| 518 |
|
| 519 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 520 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 521 |
|
| 522 |
litest_assert_empty_queue(li); |
| 523 |
|
| 524 |
litest_touch_down(dev, 0, 50, 5); |
| 525 |
litest_touch_down(dev, 1, 50, 95); |
| 526 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 527 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 528 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 529 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 530 |
litest_touch_up(dev, 0); |
| 531 |
litest_touch_up(dev, 1); |
| 532 |
|
| 533 |
/* if the touchpad is small enough, we expect all fingers to count |
| 534 |
* for clickfinger */ |
| 535 |
if (small_touchpad) |
| 536 |
switch (map) { |
| 537 |
case LIBINPUT_CONFIG_CLICKFINGER_MAP_LRM: |
| 538 |
expected_button = BTN_RIGHT; |
| 539 |
break; |
| 540 |
case LIBINPUT_CONFIG_CLICKFINGER_MAP_LMR: |
| 541 |
expected_button = BTN_MIDDLE; |
| 542 |
break; |
| 543 |
} |
| 544 |
else |
| 545 |
expected_button = BTN_LEFT; |
| 546 |
|
| 547 |
litest_assert_button_event(li, expected_button, LIBINPUT_BUTTON_STATE_PRESSED); |
| 548 |
litest_assert_button_event(li, expected_button, LIBINPUT_BUTTON_STATE_RELEASED); |
| 549 |
} |
| 550 |
END_TEST |
| 551 |
|
| 552 |
START_TEST(touchpad_3fg_clickfinger_distance) |
| 553 |
{ |
| 554 |
struct litest_device *dev = litest_current_device(); |
| 555 |
struct libinput *li = dev->libinput; |
| 556 |
unsigned int button = 0; |
| 557 |
enum libinput_config_clickfinger_button_map map = |
| 558 |
litest_test_param_get_i32(test_env->params, "map"); |
| 559 |
|
| 560 |
if (litest_slot_count(dev) < 3) |
| 561 |
return LITEST_NOT_APPLICABLE; |
| 562 |
|
| 563 |
litest_enable_clickfinger(dev); |
| 564 |
litest_set_clickfinger_map(dev, map); |
| 565 |
|
| 566 |
switch (map) { |
| 567 |
case LIBINPUT_CONFIG_CLICKFINGER_MAP_LRM: |
| 568 |
button = BTN_MIDDLE; |
| 569 |
break; |
| 570 |
case LIBINPUT_CONFIG_CLICKFINGER_MAP_LMR: |
| 571 |
button = BTN_RIGHT; |
| 572 |
break; |
| 573 |
default: |
| 574 |
litest_abort_msg("Invalid map range %d", map); |
| 575 |
} |
| 576 |
|
| 577 |
litest_drain_events(li); |
| 578 |
|
| 579 |
litest_touch_down(dev, 0, 90, 20); |
| 580 |
litest_touch_down(dev, 1, 10, 15); |
| 581 |
litest_touch_down(dev, 2, 10, 15); |
| 582 |
|
| 583 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 584 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 585 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 586 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 587 |
litest_touch_up(dev, 0); |
| 588 |
litest_touch_up(dev, 1); |
| 589 |
litest_touch_up(dev, 2); |
| 590 |
|
| 591 |
litest_assert_button_event(li, button, LIBINPUT_BUTTON_STATE_PRESSED); |
| 592 |
litest_assert_button_event(li, button, LIBINPUT_BUTTON_STATE_RELEASED); |
| 593 |
} |
| 594 |
END_TEST |
| 595 |
|
| 596 |
START_TEST(touchpad_3fg_clickfinger_distance_btntool) |
| 597 |
{ |
| 598 |
struct litest_device *dev = litest_current_device(); |
| 599 |
struct libinput *li = dev->libinput; |
| 600 |
unsigned int button = 0; |
| 601 |
enum libinput_config_clickfinger_button_map map = |
| 602 |
litest_test_param_get_i32(test_env->params, "map"); |
| 603 |
|
| 604 |
if (litest_slot_count(dev) > 2) |
| 605 |
return LITEST_NOT_APPLICABLE; |
| 606 |
|
| 607 |
litest_enable_clickfinger(dev); |
| 608 |
litest_set_clickfinger_map(dev, map); |
| 609 |
|
| 610 |
switch (map) { |
| 611 |
case LIBINPUT_CONFIG_CLICKFINGER_MAP_LRM: |
| 612 |
button = BTN_MIDDLE; |
| 613 |
break; |
| 614 |
case LIBINPUT_CONFIG_CLICKFINGER_MAP_LMR: |
| 615 |
button = BTN_RIGHT; |
| 616 |
break; |
| 617 |
default: |
| 618 |
litest_abort_msg("Invalid map range %d", map); |
| 619 |
} |
| 620 |
|
| 621 |
litest_drain_events(li); |
| 622 |
|
| 623 |
litest_touch_down(dev, 0, 90, 15); |
| 624 |
litest_touch_down(dev, 1, 10, 15); |
| 625 |
litest_dispatch(li); |
| 626 |
litest_event(dev, EV_KEY, BTN_TOOL_DOUBLETAP, 0); |
| 627 |
litest_event(dev, EV_KEY, BTN_TOOL_TRIPLETAP, 1); |
| 628 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 629 |
litest_dispatch(li); |
| 630 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 631 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 632 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 633 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 634 |
litest_event(dev, EV_KEY, BTN_TOOL_DOUBLETAP, 1); |
| 635 |
litest_event(dev, EV_KEY, BTN_TOOL_TRIPLETAP, 0); |
| 636 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 637 |
litest_touch_up(dev, 0); |
| 638 |
litest_touch_up(dev, 1); |
| 639 |
|
| 640 |
litest_assert_button_event(li, button, LIBINPUT_BUTTON_STATE_PRESSED); |
| 641 |
litest_assert_button_event(li, button, LIBINPUT_BUTTON_STATE_RELEASED); |
| 642 |
} |
| 643 |
END_TEST |
| 644 |
|
| 645 |
START_TEST(touchpad_2fg_clickfinger_bottom) |
| 646 |
{ |
| 647 |
struct litest_device *dev = litest_current_device(); |
| 648 |
struct libinput *li = dev->libinput; |
| 649 |
|
| 650 |
/* this test is run for the T440s touchpad only, makes getting the |
| 651 |
* mm correct easier */ |
| 652 |
|
| 653 |
libinput_device_config_click_set_method( |
| 654 |
dev->libinput_device, |
| 655 |
LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER); |
| 656 |
litest_drain_events(li); |
| 657 |
|
| 658 |
/* one above, one below the magic line, vert spread ca 27mm */ |
| 659 |
litest_touch_down(dev, 0, 40, 60); |
| 660 |
litest_touch_down(dev, 1, 60, 100); |
| 661 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 662 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 663 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 664 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 665 |
litest_touch_up(dev, 0); |
| 666 |
litest_touch_up(dev, 1); |
| 667 |
|
| 668 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 669 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 670 |
|
| 671 |
litest_assert_empty_queue(li); |
| 672 |
|
| 673 |
/* both below the magic line */ |
| 674 |
litest_touch_down(dev, 0, 40, 100); |
| 675 |
litest_touch_down(dev, 1, 60, 95); |
| 676 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 677 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 678 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 679 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 680 |
litest_touch_up(dev, 0); |
| 681 |
litest_touch_up(dev, 1); |
| 682 |
|
| 683 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 684 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 685 |
|
| 686 |
/* one above, one below the magic line, vert spread 17mm */ |
| 687 |
litest_touch_down(dev, 0, 50, 75); |
| 688 |
litest_touch_down(dev, 1, 55, 100); |
| 689 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 690 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 691 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 692 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 693 |
litest_touch_up(dev, 0); |
| 694 |
litest_touch_up(dev, 1); |
| 695 |
|
| 696 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 697 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 698 |
} |
| 699 |
END_TEST |
| 700 |
|
| 701 |
START_TEST(touchpad_clickfinger_to_area_method) |
| 702 |
{ |
| 703 |
struct litest_device *dev = litest_current_device(); |
| 704 |
struct libinput *li = dev->libinput; |
| 705 |
|
| 706 |
litest_drain_events(li); |
| 707 |
|
| 708 |
litest_enable_buttonareas(dev); |
| 709 |
|
| 710 |
litest_touch_down(dev, 0, 95, 95); |
| 711 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 712 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 713 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 714 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 715 |
litest_touch_up(dev, 0); |
| 716 |
litest_dispatch(li); |
| 717 |
|
| 718 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 719 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 720 |
|
| 721 |
litest_enable_clickfinger(dev); |
| 722 |
|
| 723 |
litest_drain_events(li); |
| 724 |
|
| 725 |
/* use bottom right corner to catch accidental softbutton right */ |
| 726 |
litest_touch_down(dev, 0, 95, 95); |
| 727 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 728 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 729 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 730 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 731 |
litest_touch_up(dev, 0); |
| 732 |
litest_dispatch(li); |
| 733 |
|
| 734 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 735 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 736 |
} |
| 737 |
END_TEST |
| 738 |
|
| 739 |
START_TEST(touchpad_clickfinger_to_area_method_while_down) |
| 740 |
{ |
| 741 |
struct litest_device *dev = litest_current_device(); |
| 742 |
struct libinput *li = dev->libinput; |
| 743 |
|
| 744 |
litest_drain_events(li); |
| 745 |
|
| 746 |
litest_enable_buttonareas(dev); |
| 747 |
|
| 748 |
litest_touch_down(dev, 0, 95, 95); |
| 749 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 750 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 751 |
litest_dispatch(li); |
| 752 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 753 |
|
| 754 |
litest_enable_clickfinger(dev); |
| 755 |
|
| 756 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 757 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 758 |
litest_touch_up(dev, 0); |
| 759 |
litest_dispatch(li); |
| 760 |
|
| 761 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 762 |
|
| 763 |
litest_drain_events(li); |
| 764 |
|
| 765 |
/* use bottom right corner to catch accidental softbutton right */ |
| 766 |
litest_touch_down(dev, 0, 95, 95); |
| 767 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 768 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 769 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 770 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 771 |
litest_touch_up(dev, 0); |
| 772 |
litest_dispatch(li); |
| 773 |
|
| 774 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 775 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 776 |
} |
| 777 |
END_TEST |
| 778 |
|
| 779 |
START_TEST(touchpad_area_to_clickfinger_method) |
| 780 |
{ |
| 781 |
struct litest_device *dev = litest_current_device(); |
| 782 |
struct libinput *li = dev->libinput; |
| 783 |
|
| 784 |
litest_enable_clickfinger(dev); |
| 785 |
|
| 786 |
litest_drain_events(li); |
| 787 |
|
| 788 |
/* use bottom right corner to catch accidental softbutton right */ |
| 789 |
litest_touch_down(dev, 0, 95, 95); |
| 790 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 791 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 792 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 793 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 794 |
litest_touch_up(dev, 0); |
| 795 |
litest_dispatch(li); |
| 796 |
|
| 797 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 798 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 799 |
|
| 800 |
litest_enable_buttonareas(dev); |
| 801 |
|
| 802 |
litest_touch_down(dev, 0, 95, 95); |
| 803 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 804 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 805 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 806 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 807 |
litest_touch_up(dev, 0); |
| 808 |
litest_dispatch(li); |
| 809 |
|
| 810 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 811 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 812 |
} |
| 813 |
END_TEST |
| 814 |
|
| 815 |
START_TEST(touchpad_area_to_clickfinger_method_while_down) |
| 816 |
{ |
| 817 |
struct litest_device *dev = litest_current_device(); |
| 818 |
struct libinput *li = dev->libinput; |
| 819 |
|
| 820 |
litest_enable_clickfinger(dev); |
| 821 |
|
| 822 |
litest_drain_events(li); |
| 823 |
|
| 824 |
/* use bottom right corner to catch accidental softbutton right */ |
| 825 |
litest_touch_down(dev, 0, 95, 95); |
| 826 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 827 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 828 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 829 |
|
| 830 |
litest_enable_buttonareas(dev); |
| 831 |
|
| 832 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 833 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 834 |
litest_touch_up(dev, 0); |
| 835 |
litest_dispatch(li); |
| 836 |
|
| 837 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 838 |
|
| 839 |
litest_touch_down(dev, 0, 95, 95); |
| 840 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 841 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 842 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 843 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 844 |
litest_touch_up(dev, 0); |
| 845 |
litest_dispatch(li); |
| 846 |
|
| 847 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 848 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 849 |
} |
| 850 |
END_TEST |
| 851 |
|
| 852 |
START_TEST(touchpad_clickfinger_3fg_tool_position) |
| 853 |
{ |
| 854 |
struct litest_device *dev = litest_current_device(); |
| 855 |
struct libinput *li = dev->libinput; |
| 856 |
|
| 857 |
litest_enable_clickfinger(dev); |
| 858 |
litest_drain_events(li); |
| 859 |
|
| 860 |
/* one in thumb area, one in normal area + TRIPLETAP. spread is wide |
| 861 |
* but any non-palm 3fg touch+click counts as middle */ |
| 862 |
litest_touch_down(dev, 0, 20, 99); |
| 863 |
litest_touch_down(dev, 1, 90, 15); |
| 864 |
litest_event(dev, EV_KEY, BTN_TOOL_DOUBLETAP, 0); |
| 865 |
litest_event(dev, EV_KEY, BTN_TOOL_TRIPLETAP, 1); |
| 866 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 867 |
litest_dispatch(li); |
| 868 |
|
| 869 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 870 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 871 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 872 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 873 |
litest_dispatch(li); |
| 874 |
|
| 875 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 876 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 877 |
} |
| 878 |
END_TEST |
| 879 |
|
| 880 |
START_TEST(touchpad_clickfinger_4fg_tool_position) |
| 881 |
{ |
| 882 |
struct litest_device *dev = litest_current_device(); |
| 883 |
struct libinput *li = dev->libinput; |
| 884 |
|
| 885 |
litest_enable_clickfinger(dev); |
| 886 |
litest_drain_events(li); |
| 887 |
|
| 888 |
litest_touch_down(dev, 0, 5, 99); |
| 889 |
litest_touch_down(dev, 1, 90, 15); |
| 890 |
litest_event(dev, EV_KEY, BTN_TOOL_DOUBLETAP, 0); |
| 891 |
litest_event(dev, EV_KEY, BTN_TOOL_QUADTAP, 1); |
| 892 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 893 |
litest_dispatch(li); |
| 894 |
|
| 895 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 896 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 897 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 898 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 899 |
litest_dispatch(li); |
| 900 |
|
| 901 |
litest_assert_button_event(li, BTN_MIDDLE, LIBINPUT_BUTTON_STATE_PRESSED); |
| 902 |
litest_assert_button_event(li, BTN_MIDDLE, LIBINPUT_BUTTON_STATE_RELEASED); |
| 903 |
} |
| 904 |
END_TEST |
| 905 |
|
| 906 |
START_TEST(touchpad_clickfinger_appletouch_config) |
| 907 |
{ |
| 908 |
struct litest_device *dev = litest_current_device(); |
| 909 |
struct libinput_device *device = dev->libinput_device; |
| 910 |
uint32_t methods, method; |
| 911 |
enum libinput_config_status status; |
| 912 |
|
| 913 |
methods = libinput_device_config_click_get_methods(device); |
| 914 |
litest_assert(!(methods & LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS)); |
| 915 |
litest_assert(methods & LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER); |
| 916 |
|
| 917 |
method = libinput_device_config_click_get_method(device); |
| 918 |
litest_assert_enum_eq(method, LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER); |
| 919 |
|
| 920 |
status = libinput_device_config_click_set_method( |
| 921 |
device, |
| 922 |
LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS); |
| 923 |
litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); |
| 924 |
status = libinput_device_config_click_set_method( |
| 925 |
device, |
| 926 |
LIBINPUT_CONFIG_CLICK_METHOD_NONE); |
| 927 |
litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); |
| 928 |
} |
| 929 |
END_TEST |
| 930 |
|
| 931 |
START_TEST(touchpad_clickfinger_appletouch_1fg) |
| 932 |
{ |
| 933 |
struct litest_device *dev = litest_current_device(); |
| 934 |
struct libinput *li = dev->libinput; |
| 935 |
|
| 936 |
litest_enable_clickfinger(dev); |
| 937 |
|
| 938 |
litest_drain_events(li); |
| 939 |
|
| 940 |
litest_touch_down(dev, 0, 50, 50); |
| 941 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 942 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 943 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 944 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 945 |
litest_touch_up(dev, 0); |
| 946 |
|
| 947 |
litest_dispatch(li); |
| 948 |
|
| 949 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 950 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 951 |
} |
| 952 |
END_TEST |
| 953 |
|
| 954 |
START_TEST(touchpad_clickfinger_appletouch_2fg) |
| 955 |
{ |
| 956 |
struct litest_device *dev = litest_current_device(); |
| 957 |
struct libinput *li = dev->libinput; |
| 958 |
|
| 959 |
litest_enable_clickfinger(dev); |
| 960 |
|
| 961 |
litest_drain_events(li); |
| 962 |
|
| 963 |
litest_touch_down(dev, 0, 50, 50); |
| 964 |
litest_touch_down(dev, 1, 50, 50); |
| 965 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 966 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 967 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 968 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 969 |
litest_touch_up(dev, 0); |
| 970 |
litest_touch_up(dev, 1); |
| 971 |
|
| 972 |
litest_dispatch(li); |
| 973 |
|
| 974 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 975 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 976 |
} |
| 977 |
END_TEST |
| 978 |
|
| 979 |
START_TEST(touchpad_clickfinger_appletouch_3fg) |
| 980 |
{ |
| 981 |
struct litest_device *dev = litest_current_device(); |
| 982 |
struct libinput *li = dev->libinput; |
| 983 |
|
| 984 |
litest_enable_clickfinger(dev); |
| 985 |
|
| 986 |
litest_drain_events(li); |
| 987 |
|
| 988 |
litest_touch_down(dev, 0, 50, 50); |
| 989 |
litest_touch_down(dev, 1, 50, 50); |
| 990 |
litest_touch_down(dev, 2, 50, 50); |
| 991 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 992 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 993 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 994 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 995 |
litest_touch_up(dev, 0); |
| 996 |
litest_touch_up(dev, 1); |
| 997 |
litest_touch_up(dev, 2); |
| 998 |
|
| 999 |
litest_dispatch(li); |
| 1000 |
|
| 1001 |
litest_assert_button_event(li, BTN_MIDDLE, LIBINPUT_BUTTON_STATE_PRESSED); |
| 1002 |
litest_assert_button_event(li, BTN_MIDDLE, LIBINPUT_BUTTON_STATE_RELEASED); |
| 1003 |
} |
| 1004 |
END_TEST |
| 1005 |
|
| 1006 |
START_TEST(touchpad_clickfinger_click_drag) |
| 1007 |
{ |
| 1008 |
struct litest_device *dev = litest_current_device(); |
| 1009 |
struct libinput *li = dev->libinput; |
| 1010 |
int nfingers = litest_test_param_get_i32(test_env->params, "fingers"); |
| 1011 |
unsigned int button; |
| 1012 |
int nslots = litest_slot_count(dev); |
| 1013 |
|
| 1014 |
litest_enable_clickfinger(dev); |
| 1015 |
litest_drain_events(li); |
| 1016 |
|
| 1017 |
litest_touch_down(dev, 0, 40, 50); |
| 1018 |
button = BTN_LEFT; |
| 1019 |
|
| 1020 |
if (nfingers > 1) { |
| 1021 |
if (nslots > 1) { |
| 1022 |
litest_touch_down(dev, 1, 50, 50); |
| 1023 |
} else { |
| 1024 |
litest_event(dev, EV_KEY, BTN_TOOL_DOUBLETAP, 1); |
| 1025 |
} |
| 1026 |
button = BTN_RIGHT; |
| 1027 |
} |
| 1028 |
|
| 1029 |
if (nfingers > 2) { |
| 1030 |
if (nslots > 2) { |
| 1031 |
litest_touch_down(dev, 2, 60, 50); |
| 1032 |
} else { |
| 1033 |
litest_event(dev, EV_KEY, BTN_TOOL_DOUBLETAP, 0); |
| 1034 |
litest_event(dev, EV_KEY, BTN_TOOL_TRIPLETAP, 1); |
| 1035 |
} |
| 1036 |
button = BTN_MIDDLE; |
| 1037 |
} |
| 1038 |
|
| 1039 |
litest_button_click(dev, BTN_LEFT, true); |
| 1040 |
|
| 1041 |
litest_dispatch(li); |
| 1042 |
litest_assert_button_event(li, button, LIBINPUT_BUTTON_STATE_PRESSED); |
| 1043 |
|
| 1044 |
for (int i = 0; i < 20; i++) { |
| 1045 |
litest_push_event_frame(dev); |
| 1046 |
switch (nfingers) { |
| 1047 |
case 3: |
| 1048 |
if (nslots >= nfingers) |
| 1049 |
litest_touch_move(dev, 2, 60, 50 + i); |
| 1050 |
_fallthrough_; |
| 1051 |
case 2: |
| 1052 |
if (nslots >= nfingers) |
| 1053 |
litest_touch_move(dev, 1, 50, 50 + i); |
| 1054 |
_fallthrough_; |
| 1055 |
case 1: |
| 1056 |
litest_touch_move(dev, 0, 40, 50 + i); |
| 1057 |
break; |
| 1058 |
} |
| 1059 |
litest_pop_event_frame(dev); |
| 1060 |
litest_dispatch(li); |
| 1061 |
} |
| 1062 |
|
| 1063 |
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION); |
| 1064 |
|
| 1065 |
litest_button_click(dev, BTN_LEFT, false); |
| 1066 |
litest_assert_button_event(li, button, LIBINPUT_BUTTON_STATE_RELEASED); |
| 1067 |
|
| 1068 |
if (nfingers > 3) { |
| 1069 |
if (nslots > 3) { |
| 1070 |
litest_touch_up(dev, 2); |
| 1071 |
} else { |
| 1072 |
litest_event(dev, EV_KEY, BTN_TOOL_DOUBLETAP, 1); |
| 1073 |
litest_event(dev, EV_KEY, BTN_TOOL_TRIPLETAP, 0); |
| 1074 |
} |
| 1075 |
} |
| 1076 |
|
| 1077 |
if (nfingers > 2) { |
| 1078 |
if (nslots > 2) { |
| 1079 |
litest_touch_up(dev, 1); |
| 1080 |
} else { |
| 1081 |
litest_event(dev, EV_KEY, BTN_TOOL_DOUBLETAP, 0); |
| 1082 |
} |
| 1083 |
} |
| 1084 |
|
| 1085 |
litest_touch_up(dev, 0); |
| 1086 |
|
| 1087 |
litest_dispatch(li); |
| 1088 |
litest_assert_empty_queue(li); |
| 1089 |
} |
| 1090 |
END_TEST |
| 1091 |
|
| 1092 |
START_TEST(touchpad_btn_left) |
| 1093 |
{ |
| 1094 |
struct litest_device *dev = litest_current_device(); |
| 1095 |
struct libinput *li = dev->libinput; |
| 1096 |
|
| 1097 |
litest_drain_events(li); |
| 1098 |
|
| 1099 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 1100 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1101 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 1102 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1103 |
|
| 1104 |
litest_dispatch(li); |
| 1105 |
|
| 1106 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 1107 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 1108 |
} |
| 1109 |
END_TEST |
| 1110 |
|
| 1111 |
START_TEST(clickpad_btn_left) |
| 1112 |
{ |
| 1113 |
struct litest_device *dev = litest_current_device(); |
| 1114 |
struct libinput *li = dev->libinput; |
| 1115 |
|
| 1116 |
litest_enable_buttonareas(dev); |
| 1117 |
|
| 1118 |
litest_drain_events(li); |
| 1119 |
|
| 1120 |
/* A clickpad always needs a finger down to tell where the |
| 1121 |
click happens */ |
| 1122 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 1123 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1124 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 1125 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1126 |
|
| 1127 |
litest_assert_empty_queue(li); |
| 1128 |
} |
| 1129 |
END_TEST |
| 1130 |
|
| 1131 |
START_TEST(clickpad_click_n_drag) |
| 1132 |
{ |
| 1133 |
struct litest_device *dev = litest_current_device(); |
| 1134 |
struct libinput *li = dev->libinput; |
| 1135 |
|
| 1136 |
litest_drain_events(li); |
| 1137 |
|
| 1138 |
litest_touch_down(dev, 0, 50, 50); |
| 1139 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 1140 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1141 |
|
| 1142 |
litest_dispatch(li); |
| 1143 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 1144 |
|
| 1145 |
litest_assert_empty_queue(li); |
| 1146 |
|
| 1147 |
/* now put a second finger down */ |
| 1148 |
litest_touch_down(dev, 1, 70, 70); |
| 1149 |
litest_touch_move_to(dev, 1, 70, 70, 80, 50, 5); |
| 1150 |
litest_touch_up(dev, 1); |
| 1151 |
|
| 1152 |
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION); |
| 1153 |
|
| 1154 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 1155 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1156 |
litest_touch_up(dev, 0); |
| 1157 |
|
| 1158 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 1159 |
} |
| 1160 |
END_TEST |
| 1161 |
|
| 1162 |
START_TEST(clickpad_finger_pin) |
| 1163 |
{ |
| 1164 |
struct litest_device *dev = litest_current_device(); |
| 1165 |
struct libinput *li = dev->libinput; |
| 1166 |
struct libevdev *evdev = dev->evdev; |
| 1167 |
const struct input_absinfo *abs; |
| 1168 |
double w, h; |
| 1169 |
double dist; |
| 1170 |
|
| 1171 |
abs = libevdev_get_abs_info(evdev, ABS_MT_POSITION_X); |
| 1172 |
litest_assert_notnull(abs); |
| 1173 |
if (abs->resolution == 0) |
| 1174 |
return LITEST_NOT_APPLICABLE; |
| 1175 |
|
| 1176 |
if (libinput_device_get_size(dev->libinput_device, &w, &h) != 0) |
| 1177 |
return LITEST_NOT_APPLICABLE; |
| 1178 |
|
| 1179 |
dist = 100.0 / max(w, h); |
| 1180 |
|
| 1181 |
litest_drain_events(li); |
| 1182 |
|
| 1183 |
/* make sure the movement generates pointer events when |
| 1184 |
not pinned */ |
| 1185 |
litest_touch_down(dev, 0, 50, 50); |
| 1186 |
litest_touch_move_to(dev, 0, 50, 50, 54, 54, 10); |
| 1187 |
litest_touch_move_to(dev, 0, 54, 54, 46, 46, 10); |
| 1188 |
litest_touch_move_to(dev, 0, 46, 46, 50, 50, 10); |
| 1189 |
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION); |
| 1190 |
|
| 1191 |
litest_button_click(dev, BTN_LEFT, true); |
| 1192 |
litest_drain_events(li); |
| 1193 |
|
| 1194 |
litest_touch_move_to(dev, 0, 50, 50, 50 + dist, 50 + dist, 10); |
| 1195 |
litest_touch_move_to(dev, 0, 50 + dist, 50 + dist, 50, 50, 10); |
| 1196 |
litest_touch_move_to(dev, 0, 50, 50, 50 - dist, 50 - dist, 10); |
| 1197 |
|
| 1198 |
litest_assert_empty_queue(li); |
| 1199 |
|
| 1200 |
litest_button_click(dev, BTN_LEFT, false); |
| 1201 |
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_BUTTON); |
| 1202 |
|
| 1203 |
/* still pinned after release */ |
| 1204 |
litest_touch_move_to(dev, 0, 50, 50, 50 + dist, 50 + dist, 10); |
| 1205 |
litest_touch_move_to(dev, 0, 50 + dist, 50 + dist, 50, 50, 10); |
| 1206 |
litest_touch_move_to(dev, 0, 50, 50, 50 - dist, 50 - dist, 10); |
| 1207 |
|
| 1208 |
litest_assert_empty_queue(li); |
| 1209 |
|
| 1210 |
/* move to unpin */ |
| 1211 |
litest_touch_move_to(dev, 0, 50, 50, 70, 70, 10); |
| 1212 |
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION); |
| 1213 |
} |
| 1214 |
END_TEST |
| 1215 |
|
| 1216 |
START_TEST(clickpad_softbutton_left) |
| 1217 |
{ |
| 1218 |
struct litest_device *dev = litest_current_device(); |
| 1219 |
struct libinput *li = dev->libinput; |
| 1220 |
|
| 1221 |
litest_drain_events(li); |
| 1222 |
|
| 1223 |
litest_touch_down(dev, 0, 10, 90); |
| 1224 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 1225 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1226 |
|
| 1227 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 1228 |
|
| 1229 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 1230 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1231 |
litest_touch_up(dev, 0); |
| 1232 |
|
| 1233 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 1234 |
|
| 1235 |
litest_dispatch(li); |
| 1236 |
|
| 1237 |
litest_assert_empty_queue(li); |
| 1238 |
} |
| 1239 |
END_TEST |
| 1240 |
|
| 1241 |
START_TEST(clickpad_softbutton_middle) |
| 1242 |
{ |
| 1243 |
struct litest_device *dev = litest_current_device(); |
| 1244 |
struct libinput *li = dev->libinput; |
| 1245 |
|
| 1246 |
litest_drain_events(li); |
| 1247 |
|
| 1248 |
litest_touch_down(dev, 0, 50, 90); |
| 1249 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 1250 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1251 |
|
| 1252 |
litest_assert_button_event(li, BTN_MIDDLE, LIBINPUT_BUTTON_STATE_PRESSED); |
| 1253 |
|
| 1254 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 1255 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1256 |
litest_touch_up(dev, 0); |
| 1257 |
|
| 1258 |
litest_assert_button_event(li, BTN_MIDDLE, LIBINPUT_BUTTON_STATE_RELEASED); |
| 1259 |
|
| 1260 |
litest_dispatch(li); |
| 1261 |
|
| 1262 |
litest_assert_empty_queue(li); |
| 1263 |
} |
| 1264 |
END_TEST |
| 1265 |
|
| 1266 |
START_TEST(clickpad_softbutton_right) |
| 1267 |
{ |
| 1268 |
struct litest_device *dev = litest_current_device(); |
| 1269 |
struct libinput *li = dev->libinput; |
| 1270 |
|
| 1271 |
litest_drain_events(li); |
| 1272 |
|
| 1273 |
litest_touch_down(dev, 0, 90, 90); |
| 1274 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 1275 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1276 |
|
| 1277 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 1278 |
|
| 1279 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 1280 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1281 |
litest_touch_up(dev, 0); |
| 1282 |
|
| 1283 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 1284 |
|
| 1285 |
litest_dispatch(li); |
| 1286 |
|
| 1287 |
litest_assert_empty_queue(li); |
| 1288 |
} |
| 1289 |
END_TEST |
| 1290 |
|
| 1291 |
START_TEST(clickpad_softbutton_left_tap_n_drag) |
| 1292 |
{ |
| 1293 |
struct litest_device *dev = litest_current_device(); |
| 1294 |
struct libinput *li = dev->libinput; |
| 1295 |
|
| 1296 |
litest_enable_tap(dev->libinput_device); |
| 1297 |
|
| 1298 |
litest_drain_events(li); |
| 1299 |
|
| 1300 |
/* Tap in left button area, then finger down, button click |
| 1301 |
-> expect left button press/release and left button press |
| 1302 |
Release button, finger up |
| 1303 |
-> expect right button release |
| 1304 |
*/ |
| 1305 |
litest_touch_down(dev, 0, 20, 90); |
| 1306 |
litest_touch_up(dev, 0); |
| 1307 |
litest_touch_down(dev, 0, 20, 90); |
| 1308 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 1309 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1310 |
|
| 1311 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 1312 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 1313 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 1314 |
litest_assert_empty_queue(li); |
| 1315 |
|
| 1316 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 1317 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1318 |
litest_touch_up(dev, 0); |
| 1319 |
|
| 1320 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 1321 |
litest_assert_empty_queue(li); |
| 1322 |
} |
| 1323 |
END_TEST |
| 1324 |
|
| 1325 |
START_TEST(clickpad_softbutton_right_tap_n_drag) |
| 1326 |
{ |
| 1327 |
struct litest_device *dev = litest_current_device(); |
| 1328 |
struct libinput *li = dev->libinput; |
| 1329 |
|
| 1330 |
litest_enable_tap(dev->libinput_device); |
| 1331 |
|
| 1332 |
litest_drain_events(li); |
| 1333 |
|
| 1334 |
/* Tap in right button area, then finger down, button click |
| 1335 |
-> expect left button press/release and right button press |
| 1336 |
Release button, finger up |
| 1337 |
-> expect right button release |
| 1338 |
*/ |
| 1339 |
litest_touch_down(dev, 0, 90, 90); |
| 1340 |
litest_touch_up(dev, 0); |
| 1341 |
litest_touch_down(dev, 0, 90, 90); |
| 1342 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 1343 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1344 |
|
| 1345 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 1346 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 1347 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 1348 |
litest_assert_empty_queue(li); |
| 1349 |
|
| 1350 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 1351 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1352 |
litest_touch_up(dev, 0); |
| 1353 |
|
| 1354 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 1355 |
litest_assert_empty_queue(li); |
| 1356 |
} |
| 1357 |
END_TEST |
| 1358 |
|
| 1359 |
START_TEST(clickpad_softbutton_left_1st_fg_move) |
| 1360 |
{ |
| 1361 |
struct litest_device *dev = litest_current_device(); |
| 1362 |
struct libinput *li = dev->libinput; |
| 1363 |
struct libinput_event *event; |
| 1364 |
double x = 0, y = 0; |
| 1365 |
int nevents = 0; |
| 1366 |
|
| 1367 |
litest_drain_events(li); |
| 1368 |
|
| 1369 |
/* One finger down in the left button area, button press |
| 1370 |
-> expect a button event |
| 1371 |
Move finger up out of the area, wait for timeout |
| 1372 |
Move finger around diagonally down left |
| 1373 |
-> expect motion events down left |
| 1374 |
Release finger |
| 1375 |
-> expect a button event */ |
| 1376 |
|
| 1377 |
/* finger down, press in left button */ |
| 1378 |
litest_touch_down(dev, 0, 20, 90); |
| 1379 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 1380 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1381 |
|
| 1382 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 1383 |
litest_assert_empty_queue(li); |
| 1384 |
|
| 1385 |
/* move out of the area, then wait for softbutton timer */ |
| 1386 |
litest_touch_move_to(dev, 0, 20, 90, 50, 50, 20); |
| 1387 |
litest_timeout_softbuttons(li); |
| 1388 |
litest_drain_events(li); |
| 1389 |
|
| 1390 |
/* move down left, expect motion */ |
| 1391 |
litest_touch_move_to(dev, 0, 50, 50, 20, 90, 20); |
| 1392 |
|
| 1393 |
litest_dispatch(li); |
| 1394 |
event = libinput_get_event(li); |
| 1395 |
litest_assert_notnull(event); |
| 1396 |
while (event) { |
| 1397 |
struct libinput_event_pointer *p; |
| 1398 |
|
| 1399 |
litest_assert_event_type(event, LIBINPUT_EVENT_POINTER_MOTION); |
| 1400 |
p = libinput_event_get_pointer_event(event); |
| 1401 |
|
| 1402 |
/* we moved up/right, now down/left so the pointer accel |
| 1403 |
code may lag behind with the dx/dy vectors. Hence, add up |
| 1404 |
the x/y movements and expect that on average we moved |
| 1405 |
left and down */ |
| 1406 |
x += libinput_event_pointer_get_dx(p); |
| 1407 |
y += libinput_event_pointer_get_dy(p); |
| 1408 |
nevents++; |
| 1409 |
|
| 1410 |
libinput_event_destroy(event); |
| 1411 |
litest_dispatch(li); |
| 1412 |
event = libinput_get_event(li); |
| 1413 |
} |
| 1414 |
|
| 1415 |
litest_assert(x / nevents < 0); |
| 1416 |
litest_assert(y / nevents > 0); |
| 1417 |
|
| 1418 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 1419 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1420 |
litest_touch_up(dev, 0); |
| 1421 |
|
| 1422 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 1423 |
|
| 1424 |
litest_assert_empty_queue(li); |
| 1425 |
} |
| 1426 |
END_TEST |
| 1427 |
|
| 1428 |
START_TEST(clickpad_softbutton_left_2nd_fg_move) |
| 1429 |
{ |
| 1430 |
struct litest_device *dev = litest_current_device(); |
| 1431 |
struct libinput *li = dev->libinput; |
| 1432 |
struct libinput_event *event; |
| 1433 |
|
| 1434 |
litest_drain_events(li); |
| 1435 |
|
| 1436 |
/* One finger down in the left button area, button press |
| 1437 |
-> expect a button event |
| 1438 |
Put a second finger down in the area, move it right, release |
| 1439 |
-> expect motion events right |
| 1440 |
Put a second finger down in the area, move it down, release |
| 1441 |
-> expect motion events down |
| 1442 |
Release second finger, release first finger |
| 1443 |
-> expect a button event */ |
| 1444 |
litest_touch_down(dev, 0, 20, 90); |
| 1445 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 1446 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1447 |
|
| 1448 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 1449 |
litest_assert_empty_queue(li); |
| 1450 |
|
| 1451 |
litest_touch_down(dev, 1, 20, 20); |
| 1452 |
litest_touch_move_to(dev, 1, 20, 20, 80, 20, 25); |
| 1453 |
|
| 1454 |
litest_dispatch(li); |
| 1455 |
event = libinput_get_event(li); |
| 1456 |
litest_assert_notnull(event); |
| 1457 |
while (event) { |
| 1458 |
struct libinput_event_pointer *p; |
| 1459 |
double x, y; |
| 1460 |
|
| 1461 |
litest_assert_event_type(event, LIBINPUT_EVENT_POINTER_MOTION); |
| 1462 |
p = libinput_event_get_pointer_event(event); |
| 1463 |
|
| 1464 |
x = libinput_event_pointer_get_dx(p); |
| 1465 |
y = libinput_event_pointer_get_dy(p); |
| 1466 |
|
| 1467 |
/* Ignore events only containing an unaccelerated motion |
| 1468 |
* vector. */ |
| 1469 |
if (x != 0 || y != 0) { |
| 1470 |
litest_assert(x > 0); |
| 1471 |
litest_assert(y == 0); |
| 1472 |
} |
| 1473 |
|
| 1474 |
libinput_event_destroy(event); |
| 1475 |
litest_dispatch(li); |
| 1476 |
event = libinput_get_event(li); |
| 1477 |
} |
| 1478 |
litest_touch_up(dev, 1); |
| 1479 |
|
| 1480 |
/* second finger down */ |
| 1481 |
litest_touch_down(dev, 1, 20, 20); |
| 1482 |
litest_touch_move_to(dev, 1, 20, 20, 20, 80, 15); |
| 1483 |
|
| 1484 |
litest_dispatch(li); |
| 1485 |
event = libinput_get_event(li); |
| 1486 |
litest_assert_notnull(event); |
| 1487 |
while (event) { |
| 1488 |
struct libinput_event_pointer *p; |
| 1489 |
double x, y; |
| 1490 |
|
| 1491 |
litest_assert_event_type(event, LIBINPUT_EVENT_POINTER_MOTION); |
| 1492 |
p = libinput_event_get_pointer_event(event); |
| 1493 |
|
| 1494 |
x = libinput_event_pointer_get_dx(p); |
| 1495 |
y = libinput_event_pointer_get_dy(p); |
| 1496 |
|
| 1497 |
litest_assert(x == 0); |
| 1498 |
litest_assert(y > 0); |
| 1499 |
|
| 1500 |
libinput_event_destroy(event); |
| 1501 |
litest_dispatch(li); |
| 1502 |
event = libinput_get_event(li); |
| 1503 |
} |
| 1504 |
|
| 1505 |
litest_touch_up(dev, 1); |
| 1506 |
|
| 1507 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 1508 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1509 |
litest_touch_up(dev, 0); |
| 1510 |
|
| 1511 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 1512 |
|
| 1513 |
litest_assert_empty_queue(li); |
| 1514 |
} |
| 1515 |
END_TEST |
| 1516 |
|
| 1517 |
START_TEST(clickpad_softbutton_left_to_right) |
| 1518 |
{ |
| 1519 |
struct litest_device *dev = litest_current_device(); |
| 1520 |
struct libinput *li = dev->libinput; |
| 1521 |
|
| 1522 |
litest_drain_events(li); |
| 1523 |
|
| 1524 |
/* One finger down in left software button area, |
| 1525 |
move to right button area immediately, click |
| 1526 |
-> expect right button event |
| 1527 |
*/ |
| 1528 |
|
| 1529 |
litest_touch_down(dev, 0, 30, 90); |
| 1530 |
litest_touch_move_to(dev, 0, 30, 90, 90, 90, 25); |
| 1531 |
litest_drain_events(li); |
| 1532 |
|
| 1533 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 1534 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1535 |
|
| 1536 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 1537 |
litest_assert_empty_queue(li); |
| 1538 |
|
| 1539 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 1540 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1541 |
litest_touch_up(dev, 0); |
| 1542 |
|
| 1543 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 1544 |
|
| 1545 |
litest_assert_empty_queue(li); |
| 1546 |
} |
| 1547 |
END_TEST |
| 1548 |
|
| 1549 |
START_TEST(clickpad_softbutton_right_to_left) |
| 1550 |
{ |
| 1551 |
struct litest_device *dev = litest_current_device(); |
| 1552 |
struct libinput *li = dev->libinput; |
| 1553 |
|
| 1554 |
litest_drain_events(li); |
| 1555 |
|
| 1556 |
/* One finger down in right software button area, |
| 1557 |
move to left button area immediately, click |
| 1558 |
-> expect left button event |
| 1559 |
*/ |
| 1560 |
|
| 1561 |
litest_touch_down(dev, 0, 80, 90); |
| 1562 |
litest_touch_move_to(dev, 0, 80, 90, 30, 90, 25); |
| 1563 |
litest_drain_events(li); |
| 1564 |
|
| 1565 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 1566 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1567 |
|
| 1568 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 1569 |
litest_assert_empty_queue(li); |
| 1570 |
|
| 1571 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 1572 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1573 |
litest_touch_up(dev, 0); |
| 1574 |
|
| 1575 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 1576 |
|
| 1577 |
litest_assert_empty_queue(li); |
| 1578 |
} |
| 1579 |
END_TEST |
| 1580 |
|
| 1581 |
START_TEST(clickpad_softbutton_hover_into_buttons) |
| 1582 |
{ |
| 1583 |
struct litest_device *dev = litest_current_device(); |
| 1584 |
struct libinput *li = dev->libinput; |
| 1585 |
|
| 1586 |
litest_drain_events(li); |
| 1587 |
|
| 1588 |
litest_hover_start(dev, 0, 50, 50); |
| 1589 |
litest_dispatch(li); |
| 1590 |
litest_hover_move_to(dev, 0, 50, 50, 90, 90, 20); |
| 1591 |
litest_dispatch(li); |
| 1592 |
|
| 1593 |
litest_touch_move_to(dev, 0, 90, 90, 91, 91, 1); |
| 1594 |
|
| 1595 |
litest_button_click(dev, BTN_LEFT, true); |
| 1596 |
litest_dispatch(li); |
| 1597 |
|
| 1598 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 1599 |
litest_assert_empty_queue(li); |
| 1600 |
|
| 1601 |
litest_button_click(dev, BTN_LEFT, false); |
| 1602 |
litest_touch_up(dev, 0); |
| 1603 |
|
| 1604 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 1605 |
} |
| 1606 |
END_TEST |
| 1607 |
|
| 1608 |
START_TEST(clickpad_topsoftbuttons_left) |
| 1609 |
{ |
| 1610 |
struct litest_device *dev = litest_current_device(); |
| 1611 |
struct libinput *li = dev->libinput; |
| 1612 |
|
| 1613 |
litest_drain_events(li); |
| 1614 |
|
| 1615 |
litest_touch_down(dev, 0, 10, 5); |
| 1616 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 1617 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1618 |
|
| 1619 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 1620 |
litest_assert_empty_queue(li); |
| 1621 |
|
| 1622 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 1623 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1624 |
litest_touch_up(dev, 0); |
| 1625 |
|
| 1626 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 1627 |
|
| 1628 |
litest_assert_empty_queue(li); |
| 1629 |
} |
| 1630 |
END_TEST |
| 1631 |
|
| 1632 |
START_TEST(clickpad_topsoftbuttons_right) |
| 1633 |
{ |
| 1634 |
struct litest_device *dev = litest_current_device(); |
| 1635 |
struct libinput *li = dev->libinput; |
| 1636 |
|
| 1637 |
litest_drain_events(li); |
| 1638 |
|
| 1639 |
litest_touch_down(dev, 0, 90, 5); |
| 1640 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 1641 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1642 |
|
| 1643 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 1644 |
litest_assert_empty_queue(li); |
| 1645 |
|
| 1646 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 1647 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1648 |
litest_touch_up(dev, 0); |
| 1649 |
|
| 1650 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 1651 |
|
| 1652 |
litest_assert_empty_queue(li); |
| 1653 |
} |
| 1654 |
END_TEST |
| 1655 |
|
| 1656 |
START_TEST(clickpad_topsoftbuttons_middle) |
| 1657 |
{ |
| 1658 |
struct litest_device *dev = litest_current_device(); |
| 1659 |
struct libinput *li = dev->libinput; |
| 1660 |
|
| 1661 |
litest_drain_events(li); |
| 1662 |
|
| 1663 |
litest_touch_down(dev, 0, 50, 5); |
| 1664 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 1665 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1666 |
|
| 1667 |
litest_assert_button_event(li, BTN_MIDDLE, LIBINPUT_BUTTON_STATE_PRESSED); |
| 1668 |
litest_assert_empty_queue(li); |
| 1669 |
|
| 1670 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 1671 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1672 |
litest_touch_up(dev, 0); |
| 1673 |
|
| 1674 |
litest_assert_button_event(li, BTN_MIDDLE, LIBINPUT_BUTTON_STATE_RELEASED); |
| 1675 |
|
| 1676 |
litest_assert_empty_queue(li); |
| 1677 |
} |
| 1678 |
END_TEST |
| 1679 |
|
| 1680 |
START_TEST(clickpad_topsoftbuttons_move_out_leftclick_before_timeout) |
| 1681 |
{ |
| 1682 |
struct litest_device *dev = litest_current_device(); |
| 1683 |
struct libinput *li = dev->libinput; |
| 1684 |
|
| 1685 |
/* Finger down in top right button area, wait past enter timeout |
| 1686 |
Move into main area, wait past leave timeout |
| 1687 |
Click |
| 1688 |
-> expect left click |
| 1689 |
*/ |
| 1690 |
|
| 1691 |
litest_drain_events(li); |
| 1692 |
|
| 1693 |
litest_touch_down(dev, 0, 80, 5); |
| 1694 |
litest_timeout_softbuttons(li); |
| 1695 |
litest_assert_empty_queue(li); |
| 1696 |
|
| 1697 |
litest_touch_move_to(dev, 0, 80, 5, 80, 90, 20); |
| 1698 |
litest_dispatch(li); |
| 1699 |
|
| 1700 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 1701 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1702 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 1703 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1704 |
|
| 1705 |
litest_touch_up(dev, 0); |
| 1706 |
|
| 1707 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 1708 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 1709 |
} |
| 1710 |
END_TEST |
| 1711 |
|
| 1712 |
START_TEST(clickpad_topsoftbuttons_move_out_leftclick) |
| 1713 |
{ |
| 1714 |
struct litest_device *dev = litest_current_device(); |
| 1715 |
struct libinput *li = dev->libinput; |
| 1716 |
|
| 1717 |
/* Finger down in top right button area, wait past enter timeout |
| 1718 |
Move into main area, wait past leave timeout |
| 1719 |
Click |
| 1720 |
-> expect left click |
| 1721 |
*/ |
| 1722 |
|
| 1723 |
litest_drain_events(li); |
| 1724 |
|
| 1725 |
litest_touch_down(dev, 0, 80, 5); |
| 1726 |
litest_timeout_softbuttons(li); |
| 1727 |
litest_assert_empty_queue(li); |
| 1728 |
|
| 1729 |
litest_touch_move_to(dev, 0, 80, 5, 80, 90, 20); |
| 1730 |
litest_timeout_softbuttons(li); |
| 1731 |
|
| 1732 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 1733 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1734 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 1735 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1736 |
|
| 1737 |
litest_touch_up(dev, 0); |
| 1738 |
|
| 1739 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 1740 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 1741 |
} |
| 1742 |
END_TEST |
| 1743 |
|
| 1744 |
START_TEST(clickpad_topsoftbuttons_clickfinger) |
| 1745 |
{ |
| 1746 |
struct litest_device *dev = litest_current_device(); |
| 1747 |
struct libinput *li = dev->libinput; |
| 1748 |
|
| 1749 |
litest_enable_clickfinger(dev); |
| 1750 |
|
| 1751 |
litest_drain_events(li); |
| 1752 |
|
| 1753 |
litest_touch_down(dev, 0, 90, 5); |
| 1754 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 1755 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1756 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 1757 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1758 |
litest_touch_up(dev, 0); |
| 1759 |
|
| 1760 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 1761 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 1762 |
|
| 1763 |
litest_assert_empty_queue(li); |
| 1764 |
|
| 1765 |
litest_touch_down(dev, 0, 90, 5); |
| 1766 |
litest_touch_down(dev, 1, 80, 5); |
| 1767 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 1768 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1769 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 1770 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1771 |
litest_touch_up(dev, 0); |
| 1772 |
litest_touch_up(dev, 1); |
| 1773 |
|
| 1774 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 1775 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 1776 |
} |
| 1777 |
END_TEST |
| 1778 |
|
| 1779 |
START_TEST(clickpad_topsoftbuttons_clickfinger_dev_disabled) |
| 1780 |
{ |
| 1781 |
struct litest_device *dev = litest_current_device(); |
| 1782 |
struct libinput *li = dev->libinput; |
| 1783 |
struct litest_device *trackpoint = litest_add_device(li, LITEST_TRACKPOINT); |
| 1784 |
|
| 1785 |
libinput_device_config_send_events_set_mode( |
| 1786 |
dev->libinput_device, |
| 1787 |
LIBINPUT_CONFIG_SEND_EVENTS_DISABLED); |
| 1788 |
litest_enable_clickfinger(dev); |
| 1789 |
litest_drain_events(li); |
| 1790 |
|
| 1791 |
litest_touch_down(dev, 0, 90, 5); |
| 1792 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 1793 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1794 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 1795 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1796 |
litest_touch_up(dev, 0); |
| 1797 |
|
| 1798 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 1799 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 1800 |
|
| 1801 |
litest_assert_empty_queue(li); |
| 1802 |
|
| 1803 |
litest_touch_down(dev, 0, 90, 5); |
| 1804 |
litest_touch_down(dev, 1, 10, 5); |
| 1805 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 1806 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1807 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 1808 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1809 |
litest_touch_up(dev, 0); |
| 1810 |
litest_touch_up(dev, 1); |
| 1811 |
|
| 1812 |
litest_assert_button_event(li, BTN_MIDDLE, LIBINPUT_BUTTON_STATE_PRESSED); |
| 1813 |
litest_assert_button_event(li, BTN_MIDDLE, LIBINPUT_BUTTON_STATE_RELEASED); |
| 1814 |
|
| 1815 |
litest_device_destroy(trackpoint); |
| 1816 |
} |
| 1817 |
END_TEST |
| 1818 |
|
| 1819 |
START_TEST(clickpad_middleemulation_config_delayed) |
| 1820 |
{ |
| 1821 |
struct litest_device *dev = litest_current_device(); |
| 1822 |
struct libinput_device *device = dev->libinput_device; |
| 1823 |
struct libinput *li = dev->libinput; |
| 1824 |
enum libinput_config_status status; |
| 1825 |
int enabled; |
| 1826 |
|
| 1827 |
enabled = libinput_device_config_middle_emulation_get_enabled(device); |
| 1828 |
litest_assert(!enabled); |
| 1829 |
|
| 1830 |
litest_touch_down(dev, 0, 30, 95); |
| 1831 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 1832 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1833 |
litest_dispatch(li); |
| 1834 |
|
| 1835 |
/* actual config is delayed, but status is immediate */ |
| 1836 |
status = libinput_device_config_middle_emulation_set_enabled( |
| 1837 |
device, |
| 1838 |
LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED); |
| 1839 |
litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); |
| 1840 |
|
| 1841 |
enabled = libinput_device_config_middle_emulation_get_enabled(device); |
| 1842 |
litest_assert(enabled); |
| 1843 |
|
| 1844 |
status = libinput_device_config_middle_emulation_set_enabled( |
| 1845 |
device, |
| 1846 |
LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED); |
| 1847 |
litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); |
| 1848 |
enabled = libinput_device_config_middle_emulation_get_enabled(device); |
| 1849 |
litest_assert(!enabled); |
| 1850 |
} |
| 1851 |
END_TEST |
| 1852 |
|
| 1853 |
START_TEST(clickpad_middleemulation_click) |
| 1854 |
{ |
| 1855 |
struct litest_device *dev = litest_current_device(); |
| 1856 |
struct libinput *li = dev->libinput; |
| 1857 |
|
| 1858 |
litest_enable_buttonareas(dev); |
| 1859 |
litest_enable_middleemu(dev); |
| 1860 |
litest_drain_events(li); |
| 1861 |
|
| 1862 |
litest_touch_down(dev, 0, 30, 95); |
| 1863 |
litest_touch_down(dev, 1, 80, 95); |
| 1864 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 1865 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1866 |
|
| 1867 |
litest_assert_button_event(li, BTN_MIDDLE, LIBINPUT_BUTTON_STATE_PRESSED); |
| 1868 |
|
| 1869 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 1870 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1871 |
litest_touch_up(dev, 0); |
| 1872 |
litest_touch_up(dev, 1); |
| 1873 |
|
| 1874 |
litest_assert_button_event(li, BTN_MIDDLE, LIBINPUT_BUTTON_STATE_RELEASED); |
| 1875 |
|
| 1876 |
litest_dispatch(li); |
| 1877 |
|
| 1878 |
litest_assert_empty_queue(li); |
| 1879 |
} |
| 1880 |
END_TEST |
| 1881 |
|
| 1882 |
START_TEST(clickpad_middleemulation_click_middle_left) |
| 1883 |
{ |
| 1884 |
struct litest_device *dev = litest_current_device(); |
| 1885 |
struct libinput *li = dev->libinput; |
| 1886 |
|
| 1887 |
litest_enable_buttonareas(dev); |
| 1888 |
litest_enable_middleemu(dev); |
| 1889 |
litest_drain_events(li); |
| 1890 |
|
| 1891 |
litest_touch_down(dev, 0, 49, 95); |
| 1892 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 1893 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1894 |
|
| 1895 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 1896 |
|
| 1897 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 1898 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1899 |
litest_touch_up(dev, 0); |
| 1900 |
|
| 1901 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 1902 |
|
| 1903 |
litest_dispatch(li); |
| 1904 |
|
| 1905 |
litest_assert_empty_queue(li); |
| 1906 |
} |
| 1907 |
END_TEST |
| 1908 |
|
| 1909 |
START_TEST(clickpad_middleemulation_click_middle_right) |
| 1910 |
{ |
| 1911 |
struct litest_device *dev = litest_current_device(); |
| 1912 |
struct libinput *li = dev->libinput; |
| 1913 |
|
| 1914 |
litest_enable_buttonareas(dev); |
| 1915 |
litest_enable_middleemu(dev); |
| 1916 |
litest_drain_events(li); |
| 1917 |
|
| 1918 |
litest_touch_down(dev, 0, 51, 95); |
| 1919 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 1920 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1921 |
|
| 1922 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 1923 |
|
| 1924 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 1925 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1926 |
litest_touch_up(dev, 0); |
| 1927 |
|
| 1928 |
litest_assert_button_event(li, BTN_RIGHT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 1929 |
|
| 1930 |
litest_dispatch(li); |
| 1931 |
|
| 1932 |
litest_assert_empty_queue(li); |
| 1933 |
} |
| 1934 |
END_TEST |
| 1935 |
|
| 1936 |
START_TEST(clickpad_middleemulation_click_enable_while_down) |
| 1937 |
{ |
| 1938 |
struct litest_device *dev = litest_current_device(); |
| 1939 |
struct libinput *li = dev->libinput; |
| 1940 |
|
| 1941 |
litest_enable_buttonareas(dev); |
| 1942 |
litest_drain_events(li); |
| 1943 |
|
| 1944 |
litest_touch_down(dev, 0, 49, 95); |
| 1945 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 1946 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1947 |
|
| 1948 |
litest_assert_button_event(li, BTN_MIDDLE, LIBINPUT_BUTTON_STATE_PRESSED); |
| 1949 |
|
| 1950 |
litest_enable_middleemu(dev); |
| 1951 |
|
| 1952 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 1953 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1954 |
litest_touch_up(dev, 0); |
| 1955 |
|
| 1956 |
litest_assert_button_event(li, BTN_MIDDLE, LIBINPUT_BUTTON_STATE_RELEASED); |
| 1957 |
|
| 1958 |
litest_dispatch(li); |
| 1959 |
|
| 1960 |
litest_assert_empty_queue(li); |
| 1961 |
|
| 1962 |
litest_touch_down(dev, 0, 49, 95); |
| 1963 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 1964 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1965 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 1966 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1967 |
litest_touch_up(dev, 0); |
| 1968 |
|
| 1969 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_PRESSED); |
| 1970 |
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_RELEASED); |
| 1971 |
|
| 1972 |
litest_dispatch(li); |
| 1973 |
} |
| 1974 |
END_TEST |
| 1975 |
|
| 1976 |
START_TEST(clickpad_middleemulation_click_disable_while_down) |
| 1977 |
{ |
| 1978 |
struct litest_device *dev = litest_current_device(); |
| 1979 |
struct libinput *li = dev->libinput; |
| 1980 |
|
| 1981 |
litest_enable_buttonareas(dev); |
| 1982 |
litest_enable_middleemu(dev); |
| 1983 |
|
| 1984 |
litest_drain_events(li); |
| 1985 |
|
| 1986 |
litest_touch_down(dev, 0, 30, 95); |
| 1987 |
litest_touch_down(dev, 1, 70, 95); |
| 1988 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 1989 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1990 |
|
| 1991 |
litest_assert_button_event(li, BTN_MIDDLE, LIBINPUT_BUTTON_STATE_PRESSED); |
| 1992 |
|
| 1993 |
litest_disable_middleemu(dev); |
| 1994 |
|
| 1995 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 1996 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 1997 |
litest_touch_up(dev, 0); |
| 1998 |
litest_touch_up(dev, 1); |
| 1999 |
|
| 2000 |
litest_assert_button_event(li, BTN_MIDDLE, LIBINPUT_BUTTON_STATE_RELEASED); |
| 2001 |
litest_dispatch(li); |
| 2002 |
|
| 2003 |
litest_assert_empty_queue(li); |
| 2004 |
|
| 2005 |
litest_touch_down(dev, 0, 49, 95); |
| 2006 |
litest_event(dev, EV_KEY, BTN_LEFT, 1); |
| 2007 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 2008 |
litest_event(dev, EV_KEY, BTN_LEFT, 0); |
| 2009 |
litest_event(dev, EV_SYN, SYN_REPORT, 0); |
| 2010 |
litest_touch_up(dev, 0); |
| 2011 |
|
| 2012 |
litest_assert_button_event(li, BTN_MIDDLE, LIBINPUT_BUTTON_STATE_PRESSED); |
| 2013 |
litest_assert_button_event(li, BTN_MIDDLE, LIBINPUT_BUTTON_STATE_RELEASED); |
| 2014 |
|
| 2015 |
litest_dispatch(li); |
| 2016 |
} |
| 2017 |
END_TEST |
| 2018 |
|
| 2019 |
START_TEST(touchpad_non_clickpad_detection) |
| 2020 |
{ |
| 2021 |
struct libinput_device *device; |
| 2022 |
struct libevdev_uinput *uinput; |
| 2023 |
static struct input_absinfo absinfo[] = { |
| 2024 |
{ ABS_X, 1472, 5472, 0, 0, 75 }, |
| 2025 |
{ ABS_Y, 1408, 4448, 0, 0, 129 }, |
| 2026 |
{ ABS_PRESSURE, 0, 255, 0, 0, 0 }, |
| 2027 |
{ ABS_TOOL_WIDTH, 0, 15, 0, 0, 0 }, |
| 2028 |
{ ABS_MT_SLOT, 0, 1, 0, 0, 0 }, |
| 2029 |
{ ABS_MT_POSITION_X, 1472, 5472, 0, 0, 75 }, |
| 2030 |
{ ABS_MT_POSITION_Y, 1408, 4448, 0, 0, 129 }, |
| 2031 |
{ ABS_MT_TRACKING_ID, 0, 65535, 0, 0, 0 }, |
| 2032 |
{ ABS_MT_PRESSURE, 0, 255, 0, 0, 0 }, |
| 2033 |
{ .value = -1 } |
| 2034 |
}; |
| 2035 |
uint32_t methods; |
| 2036 |
|
| 2037 |
/* Create a touchpad with only a left button but missing |
| 2038 |
* INPUT_PROP_BUTTONPAD. We should treat this as clickpad. |
| 2039 |
*/ |
| 2040 |
/* clang-format off */ |
| 2041 |
uinput = litest_create_uinput_abs_device("litest NonClickpad", |
| 2042 |
NULL, |
| 2043 |
absinfo, |
| 2044 |
EV_KEY, BTN_LEFT, |
| 2045 |
EV_KEY, BTN_TOOL_FINGER, |
| 2046 |
EV_KEY, BTN_TOUCH, |
| 2047 |
-1); |
| 2048 |
/* clang-format on */ |
| 2049 |
|
| 2050 |
_litest_context_destroy_ struct libinput *li = litest_create_context(); |
| 2051 |
device = libinput_path_add_device(li, libevdev_uinput_get_devnode(uinput)); |
| 2052 |
|
| 2053 |
methods = libinput_device_config_click_get_methods(device); |
| 2054 |
litest_assert(methods & LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS); |
| 2055 |
litest_assert(methods & LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER); |
| 2056 |
|
| 2057 |
libinput_path_remove_device(device); |
| 2058 |
libevdev_uinput_destroy(uinput); |
| 2059 |
} |
| 2060 |
END_TEST |
| 2061 |
|
| 2062 |
TEST_COLLECTION(touchpad_buttons) |
| 2063 |
{ |
| 2064 |
/* clang-format off */ |
| 2065 |
litest_add(touchpad_button, LITEST_TOUCHPAD, LITEST_CLICKPAD); |
| 2066 |
|
| 2067 |
litest_add(touchpad_1fg_clickfinger, LITEST_CLICKPAD, LITEST_ANY); |
| 2068 |
litest_add(touchpad_1fg_clickfinger_no_touch, LITEST_CLICKPAD, LITEST_ANY); |
| 2069 |
|
| 2070 |
litest_with_parameters(params, "map", 'I', 2, litest_named_i32(LIBINPUT_CONFIG_CLICKFINGER_MAP_LRM, "LRM"), |
| 2071 |
litest_named_i32(LIBINPUT_CONFIG_CLICKFINGER_MAP_LMR, "LMR")) { |
| 2072 |
litest_add_parametrized(touchpad_2fg_clickfinger, LITEST_CLICKPAD, LITEST_ANY, params); |
| 2073 |
litest_add_parametrized(touchpad_3fg_clickfinger, LITEST_CLICKPAD, LITEST_ANY, params); |
| 2074 |
litest_add_parametrized(touchpad_3fg_clickfinger_btntool, LITEST_CLICKPAD, LITEST_ANY, params); |
| 2075 |
litest_add_parametrized(touchpad_2fg_clickfinger_distance, LITEST_CLICKPAD, LITEST_ANY, params); |
| 2076 |
litest_add_parametrized(touchpad_3fg_clickfinger_distance, LITEST_CLICKPAD, LITEST_ANY, params); |
| 2077 |
litest_add_parametrized(touchpad_3fg_clickfinger_distance_btntool, LITEST_CLICKPAD, LITEST_ANY, params); |
| 2078 |
} |
| 2079 |
|
| 2080 |
litest_add_for_device(touchpad_2fg_clickfinger_bottom, LITEST_SYNAPTICS_TOPBUTTONPAD); |
| 2081 |
litest_add(touchpad_4fg_clickfinger, LITEST_CLICKPAD, LITEST_ANY); |
| 2082 |
litest_add(touchpad_4fg_clickfinger_btntool_2slots, LITEST_CLICKPAD, LITEST_ANY); |
| 2083 |
litest_add(touchpad_4fg_clickfinger_btntool_3slots, LITEST_CLICKPAD, LITEST_ANY); |
| 2084 |
litest_add(touchpad_clickfinger_to_area_method, LITEST_CLICKPAD, LITEST_ANY); |
| 2085 |
litest_add(touchpad_clickfinger_to_area_method_while_down, LITEST_CLICKPAD, LITEST_ANY); |
| 2086 |
litest_add(touchpad_area_to_clickfinger_method, LITEST_CLICKPAD, LITEST_ANY); |
| 2087 |
litest_add(touchpad_area_to_clickfinger_method_while_down, LITEST_CLICKPAD, LITEST_ANY); |
| 2088 |
/* run those two for the T440 one only so we don't have to worry |
| 2089 |
* about small touchpads messing with thumb detection expectations */ |
| 2090 |
litest_add_for_device(touchpad_clickfinger_3fg_tool_position, LITEST_SYNAPTICS_TOPBUTTONPAD); |
| 2091 |
litest_add_for_device(touchpad_clickfinger_4fg_tool_position, LITEST_SYNAPTICS_TOPBUTTONPAD); |
| 2092 |
|
| 2093 |
litest_add_for_device(touchpad_clickfinger_appletouch_config, LITEST_APPLETOUCH); |
| 2094 |
litest_add_for_device(touchpad_clickfinger_appletouch_1fg, LITEST_APPLETOUCH); |
| 2095 |
litest_add_for_device(touchpad_clickfinger_appletouch_2fg, LITEST_APPLETOUCH); |
| 2096 |
litest_add_for_device(touchpad_clickfinger_appletouch_3fg, LITEST_APPLETOUCH); |
| 2097 |
|
| 2098 |
litest_add_for_device(touchpad_1fg_clickfinger_no_touch_phantomclicks, LITEST_SYNAPTICS_PHANTOMCLICKS); |
| 2099 |
|
| 2100 |
litest_with_parameters(params, "fingers", 'i', 3, 1, 2, 3) { |
| 2101 |
litest_add_parametrized(touchpad_clickfinger_click_drag, LITEST_CLICKPAD, LITEST_ANY, params); |
| 2102 |
} |
| 2103 |
|
| 2104 |
litest_add(touchpad_click_defaults_clickfinger, LITEST_APPLE_CLICKPAD, LITEST_ANY); |
| 2105 |
litest_add(touchpad_click_default_clickfinger_map, LITEST_APPLE_CLICKPAD, LITEST_ANY); |
| 2106 |
litest_add(touchpad_click_set_clickfinger_map, LITEST_APPLE_CLICKPAD, LITEST_ANY); |
| 2107 |
litest_add(touchpad_click_defaults_btnarea, LITEST_CLICKPAD, LITEST_APPLE_CLICKPAD); |
| 2108 |
litest_add(touchpad_click_defaults_none, LITEST_TOUCHPAD, LITEST_CLICKPAD); |
| 2109 |
litest_add(touchpad_click_defaults_none, LITEST_ANY, LITEST_TOUCHPAD); |
| 2110 |
|
| 2111 |
litest_add(touchpad_btn_left, LITEST_TOUCHPAD|LITEST_BUTTON, LITEST_CLICKPAD); |
| 2112 |
litest_add(clickpad_btn_left, LITEST_CLICKPAD, LITEST_ANY); |
| 2113 |
litest_add(clickpad_click_n_drag, LITEST_CLICKPAD, LITEST_SINGLE_TOUCH); |
| 2114 |
litest_add(clickpad_finger_pin, LITEST_CLICKPAD, LITEST_ANY); |
| 2115 |
|
| 2116 |
litest_add(clickpad_softbutton_left, LITEST_CLICKPAD, LITEST_APPLE_CLICKPAD); |
| 2117 |
litest_add(clickpad_softbutton_middle, LITEST_CLICKPAD, LITEST_APPLE_CLICKPAD); |
| 2118 |
litest_add(clickpad_softbutton_right, LITEST_CLICKPAD, LITEST_APPLE_CLICKPAD); |
| 2119 |
litest_add(clickpad_softbutton_left_tap_n_drag, LITEST_CLICKPAD, LITEST_APPLE_CLICKPAD); |
| 2120 |
litest_add(clickpad_softbutton_right_tap_n_drag, LITEST_CLICKPAD, LITEST_APPLE_CLICKPAD); |
| 2121 |
litest_add(clickpad_softbutton_left_1st_fg_move, LITEST_CLICKPAD, LITEST_APPLE_CLICKPAD); |
| 2122 |
litest_add(clickpad_softbutton_left_2nd_fg_move, LITEST_CLICKPAD, LITEST_APPLE_CLICKPAD); |
| 2123 |
litest_add(clickpad_softbutton_left_to_right, LITEST_CLICKPAD, LITEST_APPLE_CLICKPAD); |
| 2124 |
litest_add(clickpad_softbutton_right_to_left, LITEST_CLICKPAD, LITEST_APPLE_CLICKPAD); |
| 2125 |
litest_add(clickpad_softbutton_hover_into_buttons, LITEST_CLICKPAD|LITEST_HOVER, LITEST_APPLE_CLICKPAD); |
| 2126 |
|
| 2127 |
litest_add(clickpad_topsoftbuttons_left, LITEST_TOPBUTTONPAD, LITEST_ANY); |
| 2128 |
litest_add(clickpad_topsoftbuttons_right, LITEST_TOPBUTTONPAD, LITEST_ANY); |
| 2129 |
litest_add(clickpad_topsoftbuttons_middle, LITEST_TOPBUTTONPAD, LITEST_ANY); |
| 2130 |
litest_add(clickpad_topsoftbuttons_move_out_leftclick, LITEST_TOPBUTTONPAD, LITEST_ANY); |
| 2131 |
litest_add(clickpad_topsoftbuttons_move_out_leftclick_before_timeout, LITEST_TOPBUTTONPAD, LITEST_ANY); |
| 2132 |
litest_add(clickpad_topsoftbuttons_clickfinger, LITEST_TOPBUTTONPAD, LITEST_ANY); |
| 2133 |
litest_add(clickpad_topsoftbuttons_clickfinger_dev_disabled, LITEST_TOPBUTTONPAD, LITEST_ANY); |
| 2134 |
|
| 2135 |
litest_add(clickpad_middleemulation_config_delayed, LITEST_CLICKPAD, LITEST_ANY); |
| 2136 |
litest_add(clickpad_middleemulation_click, LITEST_CLICKPAD, LITEST_ANY); |
| 2137 |
litest_add(clickpad_middleemulation_click_middle_left, LITEST_CLICKPAD, LITEST_ANY); |
| 2138 |
litest_add(clickpad_middleemulation_click_middle_right, LITEST_CLICKPAD, LITEST_ANY); |
| 2139 |
litest_add(clickpad_middleemulation_click_enable_while_down, LITEST_CLICKPAD, LITEST_ANY); |
| 2140 |
litest_add(clickpad_middleemulation_click_disable_while_down, LITEST_CLICKPAD, LITEST_ANY); |
| 2141 |
|
| 2142 |
litest_add_no_device(touchpad_non_clickpad_detection); |
| 2143 |
/* clang-format on */ |
| 2144 |
} |