2017-01-20 16:54:16 +11:00
|
|
|
/*
|
|
|
|
|
* Copyright © 2017 James Ye <jye836@gmail.com>
|
|
|
|
|
*
|
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
|
|
|
*
|
|
|
|
|
* The above copyright notice and this permission notice (including the next
|
|
|
|
|
* paragraph) shall be included in all copies or substantial portions of the
|
|
|
|
|
* Software.
|
|
|
|
|
*
|
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
|
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
|
|
* DEALINGS IN THE SOFTWARE.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
2020-07-03 12:46:38 +10:00
|
|
|
#include <fcntl.h>
|
2025-04-07 10:35:56 +10:00
|
|
|
#include <libevdev/libevdev.h>
|
2025-07-01 16:30:11 +10:00
|
|
|
#include <libinput.h>
|
2017-01-20 16:54:16 +11:00
|
|
|
|
|
|
|
|
#include "libinput-util.h"
|
|
|
|
|
#include "litest.h"
|
|
|
|
|
|
2017-04-21 17:52:37 +10:00
|
|
|
static inline bool
|
|
|
|
|
switch_has_lid(struct litest_device *dev)
|
|
|
|
|
{
|
|
|
|
|
return libinput_device_switch_has_switch(dev->libinput_device,
|
2020-05-28 15:25:02 +10:00
|
|
|
LIBINPUT_SWITCH_LID) > 0;
|
2017-04-21 17:52:37 +10:00
|
|
|
}
|
|
|
|
|
|
2017-09-01 17:30:08 +10:00
|
|
|
static inline bool
|
|
|
|
|
switch_has_tablet_mode(struct litest_device *dev)
|
|
|
|
|
{
|
|
|
|
|
return libinput_device_switch_has_switch(dev->libinput_device,
|
2020-05-28 15:25:02 +10:00
|
|
|
LIBINPUT_SWITCH_TABLET_MODE) > 0;
|
2017-09-01 17:30:08 +10:00
|
|
|
}
|
|
|
|
|
|
2017-04-24 08:22:08 +10:00
|
|
|
START_TEST(switch_has_cap)
|
|
|
|
|
{
|
|
|
|
|
struct litest_device *dev = litest_current_device();
|
|
|
|
|
|
2020-05-28 14:13:43 +10:00
|
|
|
/* Need to check for this specific device here because the
|
|
|
|
|
* unreliable tablet mode switch removes the capability too */
|
|
|
|
|
if (dev->which == LITEST_TABLET_MODE_UNRELIABLE) {
|
2025-07-01 16:30:11 +10:00
|
|
|
litest_assert(
|
|
|
|
|
!libinput_device_has_capability(dev->libinput_device,
|
|
|
|
|
LIBINPUT_DEVICE_CAP_SWITCH));
|
2024-10-12 10:31:42 +10:00
|
|
|
return LITEST_NOT_APPLICABLE;
|
2020-05-28 14:13:43 +10:00
|
|
|
}
|
|
|
|
|
|
2024-09-16 16:20:26 +10:00
|
|
|
litest_assert(libinput_device_has_capability(dev->libinput_device,
|
2025-07-01 16:30:11 +10:00
|
|
|
LIBINPUT_DEVICE_CAP_SWITCH));
|
2017-04-24 08:22:08 +10:00
|
|
|
}
|
|
|
|
|
END_TEST
|
|
|
|
|
|
2017-04-21 17:52:37 +10:00
|
|
|
START_TEST(switch_has_lid_switch)
|
2017-04-21 16:57:39 +10:00
|
|
|
{
|
|
|
|
|
struct litest_device *dev = litest_current_device();
|
|
|
|
|
|
2017-04-21 17:52:37 +10:00
|
|
|
if (!libevdev_has_event_code(dev->evdev, EV_SW, SW_LID))
|
2024-10-12 10:31:42 +10:00
|
|
|
return LITEST_NOT_APPLICABLE;
|
2017-04-21 17:52:37 +10:00
|
|
|
|
2024-09-16 16:20:26 +10:00
|
|
|
litest_assert_int_eq(libinput_device_switch_has_switch(dev->libinput_device,
|
2025-07-01 16:30:11 +10:00
|
|
|
LIBINPUT_SWITCH_LID),
|
|
|
|
|
1);
|
2017-04-21 16:57:39 +10:00
|
|
|
}
|
|
|
|
|
END_TEST
|
|
|
|
|
|
2020-05-28 14:13:43 +10:00
|
|
|
static bool
|
|
|
|
|
tablet_mode_switch_is_reliable(struct litest_device *dev)
|
|
|
|
|
{
|
|
|
|
|
bool is_unreliable = false;
|
|
|
|
|
|
2025-07-01 16:30:11 +10:00
|
|
|
quirks_get_bool(dev->quirks,
|
|
|
|
|
QUIRK_MODEL_TABLET_MODE_SWITCH_UNRELIABLE,
|
|
|
|
|
&is_unreliable);
|
2020-05-28 14:13:43 +10:00
|
|
|
|
|
|
|
|
return !is_unreliable;
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-21 17:52:37 +10:00
|
|
|
START_TEST(switch_has_tablet_mode_switch)
|
|
|
|
|
{
|
|
|
|
|
struct litest_device *dev = litest_current_device();
|
2020-05-28 14:13:43 +10:00
|
|
|
int has_switch;
|
2017-04-21 17:52:37 +10:00
|
|
|
|
|
|
|
|
if (!libevdev_has_event_code(dev->evdev, EV_SW, SW_TABLET_MODE))
|
2024-10-12 10:31:42 +10:00
|
|
|
return LITEST_NOT_APPLICABLE;
|
2017-04-21 17:52:37 +10:00
|
|
|
|
2020-05-28 14:13:43 +10:00
|
|
|
has_switch = libinput_device_switch_has_switch(dev->libinput_device,
|
|
|
|
|
LIBINPUT_SWITCH_TABLET_MODE);
|
|
|
|
|
|
|
|
|
|
if (!tablet_mode_switch_is_reliable(dev))
|
2024-09-16 16:20:26 +10:00
|
|
|
litest_assert_int_ne(has_switch, 1);
|
2020-05-28 14:13:43 +10:00
|
|
|
else
|
2024-09-16 16:20:26 +10:00
|
|
|
litest_assert_int_eq(has_switch, 1);
|
2017-04-21 17:52:37 +10:00
|
|
|
}
|
|
|
|
|
END_TEST
|
|
|
|
|
|
2017-04-21 17:31:49 +10:00
|
|
|
START_TEST(switch_toggle)
|
2017-01-20 16:54:16 +11:00
|
|
|
{
|
2017-04-21 17:27:27 +10:00
|
|
|
struct litest_device *dev = litest_current_device();
|
|
|
|
|
struct libinput *li = dev->libinput;
|
2017-01-20 16:54:16 +11:00
|
|
|
struct libinput_event *event;
|
2025-02-13 22:10:02 +01:00
|
|
|
enum libinput_switch sw = litest_test_param_get_i32(test_env->params, "switch");
|
2017-01-20 16:54:16 +11:00
|
|
|
|
|
|
|
|
litest_drain_events(li);
|
|
|
|
|
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_grab_device(dev);
|
2017-04-21 17:31:49 +10:00
|
|
|
litest_switch_action(dev, sw, LIBINPUT_SWITCH_STATE_ON);
|
2024-09-13 15:13:38 +10:00
|
|
|
litest_dispatch(li);
|
2017-01-20 16:54:16 +11:00
|
|
|
|
2020-05-28 15:25:02 +10:00
|
|
|
if (libinput_device_switch_has_switch(dev->libinput_device, sw) > 0) {
|
2017-04-21 17:52:37 +10:00
|
|
|
event = libinput_get_event(li);
|
|
|
|
|
litest_is_switch_event(event, sw, LIBINPUT_SWITCH_STATE_ON);
|
|
|
|
|
libinput_event_destroy(event);
|
|
|
|
|
} else {
|
|
|
|
|
litest_assert_empty_queue(li);
|
|
|
|
|
}
|
2017-01-20 16:54:16 +11:00
|
|
|
|
2017-04-21 17:31:49 +10:00
|
|
|
litest_switch_action(dev, sw, LIBINPUT_SWITCH_STATE_OFF);
|
2024-09-13 15:13:38 +10:00
|
|
|
litest_dispatch(li);
|
2017-01-20 16:54:16 +11:00
|
|
|
|
2020-05-28 15:25:02 +10:00
|
|
|
if (libinput_device_switch_has_switch(dev->libinput_device, sw) > 0) {
|
2017-04-21 17:52:37 +10:00
|
|
|
event = libinput_get_event(li);
|
|
|
|
|
litest_is_switch_event(event, sw, LIBINPUT_SWITCH_STATE_OFF);
|
|
|
|
|
libinput_event_destroy(event);
|
|
|
|
|
}
|
2017-01-20 16:54:16 +11:00
|
|
|
|
|
|
|
|
litest_assert_empty_queue(li);
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_ungrab_device(dev);
|
2017-01-20 16:54:16 +11:00
|
|
|
}
|
|
|
|
|
END_TEST
|
|
|
|
|
|
2017-04-21 17:31:49 +10:00
|
|
|
START_TEST(switch_toggle_double)
|
2017-01-20 16:54:16 +11:00
|
|
|
{
|
2017-04-21 17:27:27 +10:00
|
|
|
struct litest_device *dev = litest_current_device();
|
|
|
|
|
struct libinput *li = dev->libinput;
|
2017-01-20 16:54:16 +11:00
|
|
|
struct libinput_event *event;
|
2025-02-13 22:10:02 +01:00
|
|
|
enum libinput_switch sw = litest_test_param_get_i32(test_env->params, "switch");
|
2017-04-21 17:52:37 +10:00
|
|
|
|
2020-05-28 15:25:02 +10:00
|
|
|
if (libinput_device_switch_has_switch(dev->libinput_device, sw) <= 0)
|
2024-10-12 10:31:42 +10:00
|
|
|
return LITEST_NOT_APPLICABLE;
|
2017-01-20 16:54:16 +11:00
|
|
|
|
|
|
|
|
litest_drain_events(li);
|
|
|
|
|
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_grab_device(dev);
|
2017-04-21 17:31:49 +10:00
|
|
|
litest_switch_action(dev, sw, LIBINPUT_SWITCH_STATE_ON);
|
2024-09-13 15:13:38 +10:00
|
|
|
litest_dispatch(li);
|
2017-01-20 16:54:16 +11:00
|
|
|
|
|
|
|
|
event = libinput_get_event(li);
|
2017-04-21 17:31:49 +10:00
|
|
|
litest_is_switch_event(event, sw, LIBINPUT_SWITCH_STATE_ON);
|
2017-01-20 16:54:16 +11:00
|
|
|
libinput_event_destroy(event);
|
|
|
|
|
|
|
|
|
|
/* This will be filtered by the kernel, so this test is a bit
|
|
|
|
|
* useless */
|
2017-04-21 17:31:49 +10:00
|
|
|
litest_switch_action(dev, sw, LIBINPUT_SWITCH_STATE_ON);
|
2024-09-13 15:13:38 +10:00
|
|
|
litest_dispatch(li);
|
2017-01-20 16:54:16 +11:00
|
|
|
|
|
|
|
|
litest_assert_empty_queue(li);
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_ungrab_device(dev);
|
2017-01-20 16:54:16 +11:00
|
|
|
}
|
|
|
|
|
END_TEST
|
|
|
|
|
|
2017-01-30 12:58:37 +10:00
|
|
|
static bool
|
|
|
|
|
lid_switch_is_reliable(struct litest_device *dev)
|
|
|
|
|
{
|
2018-05-24 11:56:24 +10:00
|
|
|
char *prop;
|
2017-01-30 12:58:37 +10:00
|
|
|
bool is_reliable = false;
|
|
|
|
|
|
2025-07-01 16:30:11 +10:00
|
|
|
if (quirks_get_string(dev->quirks, QUIRK_ATTR_LID_SWITCH_RELIABILITY, &prop)) {
|
2018-05-24 11:56:24 +10:00
|
|
|
is_reliable = streq(prop, "reliable");
|
|
|
|
|
}
|
2017-01-30 12:58:37 +10:00
|
|
|
|
|
|
|
|
return is_reliable;
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-21 17:31:49 +10:00
|
|
|
START_TEST(switch_down_on_init)
|
2017-01-24 15:04:39 +10:00
|
|
|
{
|
2017-04-21 17:27:27 +10:00
|
|
|
struct litest_device *dev = litest_current_device();
|
2017-01-24 15:04:39 +10:00
|
|
|
struct libinput_event *event;
|
2025-02-13 22:10:02 +01:00
|
|
|
enum libinput_switch sw = litest_test_param_get_i32(test_env->params, "switch");
|
2017-01-24 15:04:39 +10:00
|
|
|
|
2020-05-28 15:25:02 +10:00
|
|
|
if (libinput_device_switch_has_switch(dev->libinput_device, sw) <= 0)
|
2024-10-12 10:31:42 +10:00
|
|
|
return LITEST_NOT_APPLICABLE;
|
2017-04-21 17:52:37 +10:00
|
|
|
|
|
|
|
|
if (sw == LIBINPUT_SWITCH_LID && !lid_switch_is_reliable(dev))
|
2024-10-12 10:31:42 +10:00
|
|
|
return LITEST_NOT_APPLICABLE;
|
2017-01-30 12:58:37 +10:00
|
|
|
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_grab_device(dev);
|
2017-04-21 17:31:49 +10:00
|
|
|
litest_switch_action(dev, sw, LIBINPUT_SWITCH_STATE_ON);
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_ungrab_device(dev);
|
2017-01-24 15:04:39 +10:00
|
|
|
|
|
|
|
|
/* need separate context to test */
|
2025-04-07 13:15:28 +10:00
|
|
|
_litest_context_destroy_ struct libinput *li = litest_create_context();
|
2025-07-01 16:30:11 +10:00
|
|
|
libinput_path_add_device(li, libevdev_uinput_get_devnode(dev->uinput));
|
2024-09-13 15:13:38 +10:00
|
|
|
litest_dispatch(li);
|
2017-01-24 15:04:39 +10:00
|
|
|
|
2024-09-11 16:23:08 +10:00
|
|
|
litest_wait_for_event_of_type(li, LIBINPUT_EVENT_SWITCH_TOGGLE);
|
2017-01-24 15:04:39 +10:00
|
|
|
event = libinput_get_event(li);
|
2017-04-21 17:31:49 +10:00
|
|
|
litest_is_switch_event(event, sw, LIBINPUT_SWITCH_STATE_ON);
|
2017-01-24 15:04:39 +10:00
|
|
|
libinput_event_destroy(event);
|
|
|
|
|
|
|
|
|
|
while ((event = libinput_get_event(li))) {
|
2024-09-16 16:49:38 +10:00
|
|
|
litest_assert_enum_ne(libinput_event_get_type(event),
|
|
|
|
|
LIBINPUT_EVENT_SWITCH_TOGGLE);
|
2017-01-24 15:04:39 +10:00
|
|
|
libinput_event_destroy(event);
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-21 17:31:49 +10:00
|
|
|
litest_switch_action(dev, sw, LIBINPUT_SWITCH_STATE_OFF);
|
2024-09-13 15:13:38 +10:00
|
|
|
litest_dispatch(li);
|
2017-01-24 15:04:39 +10:00
|
|
|
event = libinput_get_event(li);
|
2017-04-21 17:31:49 +10:00
|
|
|
litest_is_switch_event(event, sw, LIBINPUT_SWITCH_STATE_OFF);
|
2017-01-24 15:04:39 +10:00
|
|
|
libinput_event_destroy(event);
|
|
|
|
|
litest_assert_empty_queue(li);
|
|
|
|
|
}
|
|
|
|
|
END_TEST
|
|
|
|
|
|
2017-04-21 17:31:49 +10:00
|
|
|
START_TEST(switch_not_down_on_init)
|
2017-01-30 12:58:37 +10:00
|
|
|
{
|
2017-04-21 17:27:27 +10:00
|
|
|
struct litest_device *dev = litest_current_device();
|
2017-01-30 12:58:37 +10:00
|
|
|
struct libinput_event *event;
|
2017-04-21 17:31:49 +10:00
|
|
|
enum libinput_switch sw = LIBINPUT_SWITCH_LID;
|
2017-01-30 12:58:37 +10:00
|
|
|
|
2020-05-28 15:25:02 +10:00
|
|
|
if (libinput_device_switch_has_switch(dev->libinput_device, sw) <= 0)
|
2024-10-12 10:31:42 +10:00
|
|
|
return LITEST_NOT_APPLICABLE;
|
2017-04-21 17:52:37 +10:00
|
|
|
|
|
|
|
|
if (sw == LIBINPUT_SWITCH_LID && lid_switch_is_reliable(dev))
|
2024-10-12 10:31:42 +10:00
|
|
|
return LITEST_NOT_APPLICABLE;
|
2017-01-30 12:58:37 +10:00
|
|
|
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_grab_device(dev);
|
2017-04-21 17:31:49 +10:00
|
|
|
litest_switch_action(dev, sw, LIBINPUT_SWITCH_STATE_ON);
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_ungrab_device(dev);
|
2017-01-30 12:58:37 +10:00
|
|
|
|
|
|
|
|
/* need separate context to test */
|
2025-04-07 13:15:28 +10:00
|
|
|
_litest_context_destroy_ struct libinput *li = litest_create_context();
|
2025-07-01 16:30:11 +10:00
|
|
|
libinput_path_add_device(li, libevdev_uinput_get_devnode(dev->uinput));
|
2024-09-13 15:13:38 +10:00
|
|
|
litest_dispatch(li);
|
2017-01-30 12:58:37 +10:00
|
|
|
|
|
|
|
|
while ((event = libinput_get_event(li)) != NULL) {
|
2024-09-16 16:49:38 +10:00
|
|
|
litest_assert_enum_ne(libinput_event_get_type(event),
|
|
|
|
|
LIBINPUT_EVENT_SWITCH_TOGGLE);
|
2017-01-30 12:58:37 +10:00
|
|
|
libinput_event_destroy(event);
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-21 17:31:49 +10:00
|
|
|
litest_switch_action(dev, sw, LIBINPUT_SWITCH_STATE_OFF);
|
2017-01-30 12:58:37 +10:00
|
|
|
litest_assert_empty_queue(li);
|
|
|
|
|
}
|
|
|
|
|
END_TEST
|
|
|
|
|
|
2017-01-20 16:54:16 +11:00
|
|
|
static inline struct litest_device *
|
2017-09-01 17:30:08 +10:00
|
|
|
switch_init_paired_touchpad(struct libinput *li)
|
2017-01-20 16:54:16 +11:00
|
|
|
{
|
|
|
|
|
enum litest_device_type which = LITEST_SYNAPTICS_I2C;
|
|
|
|
|
|
|
|
|
|
return litest_add_device(li, which);
|
|
|
|
|
}
|
|
|
|
|
|
2017-09-01 17:30:08 +10:00
|
|
|
START_TEST(switch_disable_touchpad)
|
2017-01-20 16:54:16 +11:00
|
|
|
{
|
|
|
|
|
struct litest_device *sw = litest_current_device();
|
|
|
|
|
struct litest_device *touchpad;
|
|
|
|
|
struct libinput *li = sw->libinput;
|
2025-07-01 16:30:11 +10:00
|
|
|
enum libinput_switch which =
|
|
|
|
|
litest_test_param_get_i32(test_env->params, "switch");
|
2020-05-28 15:25:02 +10:00
|
|
|
if (libinput_device_switch_has_switch(sw->libinput_device, which) <= 0)
|
2024-10-12 10:31:42 +10:00
|
|
|
return LITEST_NOT_APPLICABLE;
|
2017-04-21 17:52:37 +10:00
|
|
|
|
2017-09-01 17:30:08 +10:00
|
|
|
touchpad = switch_init_paired_touchpad(li);
|
2017-01-20 16:54:16 +11:00
|
|
|
litest_disable_tap(touchpad->libinput_device);
|
2021-05-27 19:20:03 +02:00
|
|
|
litest_disable_hold_gestures(touchpad->libinput_device);
|
2017-01-20 16:54:16 +11:00
|
|
|
litest_drain_events(li);
|
|
|
|
|
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_grab_device(sw);
|
|
|
|
|
|
2017-09-01 17:30:08 +10:00
|
|
|
/* switch is on - no events */
|
|
|
|
|
litest_switch_action(sw, which, LIBINPUT_SWITCH_STATE_ON);
|
2017-01-20 16:54:16 +11:00
|
|
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_SWITCH_TOGGLE);
|
|
|
|
|
|
|
|
|
|
litest_touch_down(touchpad, 0, 50, 50);
|
test: drop the sleep_ms argument
This forces events for every ~10ms now. If we want a slower movement, we need
more steps - just like a real touchpad does it.
Cocinelle spatch files were variants of:
@@
expression A, B, C, D, E, F, G, H, I, J, K;
@@
- litest_touch_move_two_touches(A, B, C, D, E, F, G, H, I)
+ litest_touch_move_two_touches(A, B, C, D, E, F, G, H)
The only test that needed a real fix was touchpad_no_palm_detect_2fg_scroll,
it used 12ms before, now it's using 10ms so on the bcm5974 touchpad the second
finger was a speed-thumb. Increasing the events and thus slowing down the
pointer means it's a normal finger and the test succeeds again.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-28 09:16:52 +10:00
|
|
|
litest_touch_move_to(touchpad, 0, 50, 50, 70, 50, 10);
|
2017-01-20 16:54:16 +11:00
|
|
|
litest_touch_up(touchpad, 0);
|
|
|
|
|
litest_assert_empty_queue(li);
|
|
|
|
|
|
2017-09-01 17:30:08 +10:00
|
|
|
/* switch is off - motion events */
|
|
|
|
|
litest_switch_action(sw, which, LIBINPUT_SWITCH_STATE_OFF);
|
2017-01-20 16:54:16 +11:00
|
|
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_SWITCH_TOGGLE);
|
|
|
|
|
|
|
|
|
|
litest_touch_down(touchpad, 0, 50, 50);
|
test: drop the sleep_ms argument
This forces events for every ~10ms now. If we want a slower movement, we need
more steps - just like a real touchpad does it.
Cocinelle spatch files were variants of:
@@
expression A, B, C, D, E, F, G, H, I, J, K;
@@
- litest_touch_move_two_touches(A, B, C, D, E, F, G, H, I)
+ litest_touch_move_two_touches(A, B, C, D, E, F, G, H)
The only test that needed a real fix was touchpad_no_palm_detect_2fg_scroll,
it used 12ms before, now it's using 10ms so on the bcm5974 touchpad the second
finger was a speed-thumb. Increasing the events and thus slowing down the
pointer means it's a normal finger and the test succeeds again.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-28 09:16:52 +10:00
|
|
|
litest_touch_move_to(touchpad, 0, 50, 50, 70, 50, 10);
|
2017-01-20 16:54:16 +11:00
|
|
|
litest_touch_up(touchpad, 0);
|
|
|
|
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
|
|
|
|
|
|
2025-04-07 15:12:51 +10:00
|
|
|
litest_device_destroy(touchpad);
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_ungrab_device(sw);
|
2017-01-20 16:54:16 +11:00
|
|
|
}
|
|
|
|
|
END_TEST
|
|
|
|
|
|
2017-09-01 17:30:08 +10:00
|
|
|
START_TEST(switch_disable_touchpad_during_touch)
|
2017-01-20 16:54:16 +11:00
|
|
|
{
|
|
|
|
|
struct litest_device *sw = litest_current_device();
|
|
|
|
|
struct litest_device *touchpad;
|
|
|
|
|
struct libinput *li = sw->libinput;
|
2025-07-01 16:30:11 +10:00
|
|
|
enum libinput_switch which =
|
|
|
|
|
litest_test_param_get_i32(test_env->params, "switch");
|
2020-05-28 15:25:02 +10:00
|
|
|
if (libinput_device_switch_has_switch(sw->libinput_device, which) <= 0)
|
2024-10-12 10:31:42 +10:00
|
|
|
return LITEST_NOT_APPLICABLE;
|
2017-04-21 17:52:37 +10:00
|
|
|
|
2017-09-01 17:30:08 +10:00
|
|
|
touchpad = switch_init_paired_touchpad(li);
|
2017-01-20 16:54:16 +11:00
|
|
|
litest_disable_tap(touchpad->libinput_device);
|
2021-05-27 19:20:03 +02:00
|
|
|
litest_disable_hold_gestures(touchpad->libinput_device);
|
2017-01-20 16:54:16 +11:00
|
|
|
litest_drain_events(li);
|
|
|
|
|
|
|
|
|
|
litest_touch_down(touchpad, 0, 50, 50);
|
test: drop the sleep_ms argument
This forces events for every ~10ms now. If we want a slower movement, we need
more steps - just like a real touchpad does it.
Cocinelle spatch files were variants of:
@@
expression A, B, C, D, E, F, G, H, I, J, K;
@@
- litest_touch_move_two_touches(A, B, C, D, E, F, G, H, I)
+ litest_touch_move_two_touches(A, B, C, D, E, F, G, H)
The only test that needed a real fix was touchpad_no_palm_detect_2fg_scroll,
it used 12ms before, now it's using 10ms so on the bcm5974 touchpad the second
finger was a speed-thumb. Increasing the events and thus slowing down the
pointer means it's a normal finger and the test succeeds again.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-28 09:16:52 +10:00
|
|
|
litest_touch_move_to(touchpad, 0, 50, 50, 70, 50, 5);
|
2017-01-20 16:54:16 +11:00
|
|
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
|
|
|
|
|
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_grab_device(sw);
|
2017-09-01 17:30:08 +10:00
|
|
|
litest_switch_action(sw, which, LIBINPUT_SWITCH_STATE_ON);
|
2017-01-20 16:54:16 +11:00
|
|
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_SWITCH_TOGGLE);
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_ungrab_device(sw);
|
2017-01-20 16:54:16 +11:00
|
|
|
|
test: drop the sleep_ms argument
This forces events for every ~10ms now. If we want a slower movement, we need
more steps - just like a real touchpad does it.
Cocinelle spatch files were variants of:
@@
expression A, B, C, D, E, F, G, H, I, J, K;
@@
- litest_touch_move_two_touches(A, B, C, D, E, F, G, H, I)
+ litest_touch_move_two_touches(A, B, C, D, E, F, G, H)
The only test that needed a real fix was touchpad_no_palm_detect_2fg_scroll,
it used 12ms before, now it's using 10ms so on the bcm5974 touchpad the second
finger was a speed-thumb. Increasing the events and thus slowing down the
pointer means it's a normal finger and the test succeeds again.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-28 09:16:52 +10:00
|
|
|
litest_touch_move_to(touchpad, 0, 70, 50, 50, 50, 5);
|
2017-01-20 16:54:16 +11:00
|
|
|
litest_touch_up(touchpad, 0);
|
|
|
|
|
litest_assert_empty_queue(li);
|
|
|
|
|
|
2025-04-07 15:12:51 +10:00
|
|
|
litest_device_destroy(touchpad);
|
2017-01-20 16:54:16 +11:00
|
|
|
}
|
|
|
|
|
END_TEST
|
|
|
|
|
|
2017-09-01 17:30:08 +10:00
|
|
|
START_TEST(switch_disable_touchpad_edge_scroll)
|
2017-01-20 16:54:16 +11:00
|
|
|
{
|
|
|
|
|
struct litest_device *sw = litest_current_device();
|
|
|
|
|
struct litest_device *touchpad;
|
|
|
|
|
struct libinput *li = sw->libinput;
|
2025-07-01 16:30:11 +10:00
|
|
|
enum libinput_switch which =
|
|
|
|
|
litest_test_param_get_i32(test_env->params, "switch");
|
2020-05-28 15:25:02 +10:00
|
|
|
if (libinput_device_switch_has_switch(sw->libinput_device, which) <= 0)
|
2024-10-12 10:31:42 +10:00
|
|
|
return LITEST_NOT_APPLICABLE;
|
2017-04-21 17:52:37 +10:00
|
|
|
|
2017-09-01 17:30:08 +10:00
|
|
|
touchpad = switch_init_paired_touchpad(li);
|
2017-01-20 16:54:16 +11:00
|
|
|
litest_enable_edge_scroll(touchpad);
|
|
|
|
|
|
|
|
|
|
litest_drain_events(li);
|
|
|
|
|
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_grab_device(sw);
|
2017-09-01 17:30:08 +10:00
|
|
|
litest_switch_action(sw, which, LIBINPUT_SWITCH_STATE_ON);
|
2017-01-20 16:54:16 +11:00
|
|
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_SWITCH_TOGGLE);
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_ungrab_device(sw);
|
2017-01-20 16:54:16 +11:00
|
|
|
|
|
|
|
|
litest_touch_down(touchpad, 0, 99, 20);
|
2024-09-13 15:13:38 +10:00
|
|
|
litest_dispatch(li);
|
2025-04-01 09:23:10 +10:00
|
|
|
litest_timeout_edgescroll(li);
|
2024-09-13 15:13:38 +10:00
|
|
|
litest_dispatch(li);
|
2017-01-20 16:54:16 +11:00
|
|
|
litest_assert_empty_queue(li);
|
|
|
|
|
|
test: drop the sleep_ms argument
This forces events for every ~10ms now. If we want a slower movement, we need
more steps - just like a real touchpad does it.
Cocinelle spatch files were variants of:
@@
expression A, B, C, D, E, F, G, H, I, J, K;
@@
- litest_touch_move_two_touches(A, B, C, D, E, F, G, H, I)
+ litest_touch_move_two_touches(A, B, C, D, E, F, G, H)
The only test that needed a real fix was touchpad_no_palm_detect_2fg_scroll,
it used 12ms before, now it's using 10ms so on the bcm5974 touchpad the second
finger was a speed-thumb. Increasing the events and thus slowing down the
pointer means it's a normal finger and the test succeeds again.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-28 09:16:52 +10:00
|
|
|
litest_touch_move_to(touchpad, 0, 99, 20, 99, 80, 60);
|
2024-09-13 15:13:38 +10:00
|
|
|
litest_dispatch(li);
|
2017-01-20 16:54:16 +11:00
|
|
|
litest_assert_empty_queue(li);
|
|
|
|
|
|
test: drop the sleep_ms argument
This forces events for every ~10ms now. If we want a slower movement, we need
more steps - just like a real touchpad does it.
Cocinelle spatch files were variants of:
@@
expression A, B, C, D, E, F, G, H, I, J, K;
@@
- litest_touch_move_two_touches(A, B, C, D, E, F, G, H, I)
+ litest_touch_move_two_touches(A, B, C, D, E, F, G, H)
The only test that needed a real fix was touchpad_no_palm_detect_2fg_scroll,
it used 12ms before, now it's using 10ms so on the bcm5974 touchpad the second
finger was a speed-thumb. Increasing the events and thus slowing down the
pointer means it's a normal finger and the test succeeds again.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-28 09:16:52 +10:00
|
|
|
litest_touch_move_to(touchpad, 0, 99, 80, 99, 20, 60);
|
2017-01-20 16:54:16 +11:00
|
|
|
litest_touch_up(touchpad, 0);
|
2024-09-13 15:13:38 +10:00
|
|
|
litest_dispatch(li);
|
2017-01-20 16:54:16 +11:00
|
|
|
litest_assert_empty_queue(li);
|
|
|
|
|
|
2025-04-07 15:12:51 +10:00
|
|
|
litest_device_destroy(touchpad);
|
2017-01-20 16:54:16 +11:00
|
|
|
}
|
|
|
|
|
END_TEST
|
|
|
|
|
|
2017-09-01 17:30:08 +10:00
|
|
|
START_TEST(switch_disable_touchpad_edge_scroll_interrupt)
|
2017-01-20 16:54:16 +11:00
|
|
|
{
|
|
|
|
|
struct litest_device *sw = litest_current_device();
|
|
|
|
|
struct litest_device *touchpad;
|
|
|
|
|
struct libinput *li = sw->libinput;
|
|
|
|
|
struct libinput_event *event;
|
2025-07-01 16:30:11 +10:00
|
|
|
enum libinput_switch which =
|
|
|
|
|
litest_test_param_get_i32(test_env->params, "switch");
|
2020-05-28 15:25:02 +10:00
|
|
|
if (libinput_device_switch_has_switch(sw->libinput_device, which) <= 0)
|
2024-10-12 10:31:42 +10:00
|
|
|
return LITEST_NOT_APPLICABLE;
|
2017-04-21 17:52:37 +10:00
|
|
|
|
2017-09-01 17:30:08 +10:00
|
|
|
touchpad = switch_init_paired_touchpad(li);
|
2017-01-20 16:54:16 +11:00
|
|
|
litest_enable_edge_scroll(touchpad);
|
|
|
|
|
|
|
|
|
|
litest_drain_events(li);
|
|
|
|
|
|
|
|
|
|
litest_touch_down(touchpad, 0, 99, 20);
|
2024-09-13 15:13:38 +10:00
|
|
|
litest_dispatch(li);
|
2025-04-01 09:23:10 +10:00
|
|
|
litest_timeout_edgescroll(li);
|
test: drop the sleep_ms argument
This forces events for every ~10ms now. If we want a slower movement, we need
more steps - just like a real touchpad does it.
Cocinelle spatch files were variants of:
@@
expression A, B, C, D, E, F, G, H, I, J, K;
@@
- litest_touch_move_two_touches(A, B, C, D, E, F, G, H, I)
+ litest_touch_move_two_touches(A, B, C, D, E, F, G, H)
The only test that needed a real fix was touchpad_no_palm_detect_2fg_scroll,
it used 12ms before, now it's using 10ms so on the bcm5974 touchpad the second
finger was a speed-thumb. Increasing the events and thus slowing down the
pointer means it's a normal finger and the test succeeds again.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-28 09:16:52 +10:00
|
|
|
litest_touch_move_to(touchpad, 0, 99, 20, 99, 30, 10);
|
2024-09-13 15:13:38 +10:00
|
|
|
litest_dispatch(li);
|
2018-11-22 10:24:54 +10:00
|
|
|
litest_assert_only_axis_events(li, LIBINPUT_EVENT_POINTER_SCROLL_FINGER);
|
2017-01-20 16:54:16 +11:00
|
|
|
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_grab_device(sw);
|
2017-09-01 17:30:08 +10:00
|
|
|
litest_switch_action(sw, which, LIBINPUT_SWITCH_STATE_ON);
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_ungrab_device(sw);
|
2024-09-13 15:13:38 +10:00
|
|
|
litest_dispatch(li);
|
2017-01-20 16:54:16 +11:00
|
|
|
|
2018-11-22 10:24:54 +10:00
|
|
|
litest_assert_axis_end_sequence(li,
|
|
|
|
|
LIBINPUT_EVENT_POINTER_SCROLL_FINGER,
|
|
|
|
|
LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL,
|
|
|
|
|
LIBINPUT_POINTER_AXIS_SOURCE_FINGER);
|
2017-01-20 16:54:16 +11:00
|
|
|
|
|
|
|
|
event = libinput_get_event(li);
|
2017-09-01 17:30:08 +10:00
|
|
|
litest_is_switch_event(event, which, LIBINPUT_SWITCH_STATE_ON);
|
2017-01-20 16:54:16 +11:00
|
|
|
libinput_event_destroy(event);
|
|
|
|
|
|
2025-04-07 15:12:51 +10:00
|
|
|
litest_device_destroy(touchpad);
|
2017-01-20 16:54:16 +11:00
|
|
|
}
|
|
|
|
|
END_TEST
|
|
|
|
|
|
2017-09-01 17:30:08 +10:00
|
|
|
START_TEST(switch_disable_touchpad_already_open)
|
2017-01-20 16:54:16 +11:00
|
|
|
{
|
|
|
|
|
struct litest_device *sw = litest_current_device();
|
|
|
|
|
struct litest_device *touchpad;
|
|
|
|
|
struct libinput *li = sw->libinput;
|
2025-07-01 16:30:11 +10:00
|
|
|
enum libinput_switch which =
|
|
|
|
|
litest_test_param_get_i32(test_env->params, "switch");
|
2020-05-28 15:25:02 +10:00
|
|
|
if (libinput_device_switch_has_switch(sw->libinput_device, which) <= 0)
|
2024-10-12 10:31:42 +10:00
|
|
|
return LITEST_NOT_APPLICABLE;
|
2017-04-21 17:52:37 +10:00
|
|
|
|
2017-09-01 17:30:08 +10:00
|
|
|
touchpad = switch_init_paired_touchpad(li);
|
|
|
|
|
|
2017-01-20 16:54:16 +11:00
|
|
|
litest_disable_tap(touchpad->libinput_device);
|
2021-05-27 19:20:03 +02:00
|
|
|
litest_disable_hold_gestures(touchpad->libinput_device);
|
2017-01-20 16:54:16 +11:00
|
|
|
litest_drain_events(li);
|
|
|
|
|
|
2017-09-01 17:30:08 +10:00
|
|
|
/* default: switch is off - motion events */
|
2017-01-20 16:54:16 +11:00
|
|
|
litest_touch_down(touchpad, 0, 50, 50);
|
test: drop the sleep_ms argument
This forces events for every ~10ms now. If we want a slower movement, we need
more steps - just like a real touchpad does it.
Cocinelle spatch files were variants of:
@@
expression A, B, C, D, E, F, G, H, I, J, K;
@@
- litest_touch_move_two_touches(A, B, C, D, E, F, G, H, I)
+ litest_touch_move_two_touches(A, B, C, D, E, F, G, H)
The only test that needed a real fix was touchpad_no_palm_detect_2fg_scroll,
it used 12ms before, now it's using 10ms so on the bcm5974 touchpad the second
finger was a speed-thumb. Increasing the events and thus slowing down the
pointer means it's a normal finger and the test succeeds again.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-28 09:16:52 +10:00
|
|
|
litest_touch_move_to(touchpad, 0, 50, 50, 70, 50, 10);
|
2017-01-20 16:54:16 +11:00
|
|
|
litest_touch_up(touchpad, 0);
|
|
|
|
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
|
|
|
|
|
|
2017-09-01 17:30:08 +10:00
|
|
|
/* disable switch - motion events */
|
|
|
|
|
litest_switch_action(sw, which, LIBINPUT_SWITCH_STATE_OFF);
|
2017-01-20 16:54:16 +11:00
|
|
|
litest_assert_empty_queue(li);
|
|
|
|
|
|
|
|
|
|
litest_touch_down(touchpad, 0, 50, 50);
|
test: drop the sleep_ms argument
This forces events for every ~10ms now. If we want a slower movement, we need
more steps - just like a real touchpad does it.
Cocinelle spatch files were variants of:
@@
expression A, B, C, D, E, F, G, H, I, J, K;
@@
- litest_touch_move_two_touches(A, B, C, D, E, F, G, H, I)
+ litest_touch_move_two_touches(A, B, C, D, E, F, G, H)
The only test that needed a real fix was touchpad_no_palm_detect_2fg_scroll,
it used 12ms before, now it's using 10ms so on the bcm5974 touchpad the second
finger was a speed-thumb. Increasing the events and thus slowing down the
pointer means it's a normal finger and the test succeeds again.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-28 09:16:52 +10:00
|
|
|
litest_touch_move_to(touchpad, 0, 50, 50, 70, 50, 10);
|
2017-01-20 16:54:16 +11:00
|
|
|
litest_touch_up(touchpad, 0);
|
|
|
|
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
|
|
|
|
|
|
2025-04-07 15:12:51 +10:00
|
|
|
litest_device_destroy(touchpad);
|
2017-01-20 16:54:16 +11:00
|
|
|
}
|
|
|
|
|
END_TEST
|
|
|
|
|
|
2017-09-05 14:38:53 +10:00
|
|
|
START_TEST(switch_dont_resume_disabled_touchpad)
|
|
|
|
|
{
|
|
|
|
|
struct litest_device *sw = litest_current_device();
|
|
|
|
|
struct litest_device *touchpad;
|
|
|
|
|
struct libinput *li = sw->libinput;
|
2025-07-01 16:30:11 +10:00
|
|
|
enum libinput_switch which =
|
|
|
|
|
litest_test_param_get_i32(test_env->params, "switch");
|
2020-05-28 15:25:02 +10:00
|
|
|
if (libinput_device_switch_has_switch(sw->libinput_device, which) <= 0)
|
2024-10-12 10:31:42 +10:00
|
|
|
return LITEST_NOT_APPLICABLE;
|
2017-09-05 14:38:53 +10:00
|
|
|
|
|
|
|
|
touchpad = switch_init_paired_touchpad(li);
|
|
|
|
|
litest_disable_tap(touchpad->libinput_device);
|
2021-05-27 19:20:03 +02:00
|
|
|
litest_disable_hold_gestures(touchpad->libinput_device);
|
2025-07-01 16:30:11 +10:00
|
|
|
libinput_device_config_send_events_set_mode(
|
|
|
|
|
touchpad->libinput_device,
|
|
|
|
|
LIBINPUT_CONFIG_SEND_EVENTS_DISABLED);
|
2017-09-05 14:38:53 +10:00
|
|
|
litest_drain_events(li);
|
|
|
|
|
|
|
|
|
|
/* switch is on - no events */
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_grab_device(sw);
|
2017-09-05 14:38:53 +10:00
|
|
|
litest_switch_action(sw, which, LIBINPUT_SWITCH_STATE_ON);
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_ungrab_device(sw);
|
2017-09-05 14:38:53 +10:00
|
|
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_SWITCH_TOGGLE);
|
|
|
|
|
|
|
|
|
|
litest_touch_down(touchpad, 0, 50, 50);
|
test: drop the sleep_ms argument
This forces events for every ~10ms now. If we want a slower movement, we need
more steps - just like a real touchpad does it.
Cocinelle spatch files were variants of:
@@
expression A, B, C, D, E, F, G, H, I, J, K;
@@
- litest_touch_move_two_touches(A, B, C, D, E, F, G, H, I)
+ litest_touch_move_two_touches(A, B, C, D, E, F, G, H)
The only test that needed a real fix was touchpad_no_palm_detect_2fg_scroll,
it used 12ms before, now it's using 10ms so on the bcm5974 touchpad the second
finger was a speed-thumb. Increasing the events and thus slowing down the
pointer means it's a normal finger and the test succeeds again.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-28 09:16:52 +10:00
|
|
|
litest_touch_move_to(touchpad, 0, 50, 50, 70, 50, 10);
|
2017-09-05 14:38:53 +10:00
|
|
|
litest_touch_up(touchpad, 0);
|
|
|
|
|
litest_assert_empty_queue(li);
|
|
|
|
|
|
|
|
|
|
/* switch is off but but tp is still disabled */
|
|
|
|
|
litest_switch_action(sw, which, LIBINPUT_SWITCH_STATE_OFF);
|
|
|
|
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_SWITCH_TOGGLE);
|
|
|
|
|
|
|
|
|
|
litest_touch_down(touchpad, 0, 50, 50);
|
test: drop the sleep_ms argument
This forces events for every ~10ms now. If we want a slower movement, we need
more steps - just like a real touchpad does it.
Cocinelle spatch files were variants of:
@@
expression A, B, C, D, E, F, G, H, I, J, K;
@@
- litest_touch_move_two_touches(A, B, C, D, E, F, G, H, I)
+ litest_touch_move_two_touches(A, B, C, D, E, F, G, H)
The only test that needed a real fix was touchpad_no_palm_detect_2fg_scroll,
it used 12ms before, now it's using 10ms so on the bcm5974 touchpad the second
finger was a speed-thumb. Increasing the events and thus slowing down the
pointer means it's a normal finger and the test succeeds again.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-28 09:16:52 +10:00
|
|
|
litest_touch_move_to(touchpad, 0, 50, 50, 70, 50, 10);
|
2017-09-05 14:38:53 +10:00
|
|
|
litest_touch_up(touchpad, 0);
|
|
|
|
|
litest_assert_empty_queue(li);
|
|
|
|
|
|
2025-04-07 15:12:51 +10:00
|
|
|
litest_device_destroy(touchpad);
|
2017-09-05 14:38:53 +10:00
|
|
|
}
|
|
|
|
|
END_TEST
|
|
|
|
|
|
|
|
|
|
START_TEST(switch_dont_resume_disabled_touchpad_external_mouse)
|
|
|
|
|
{
|
|
|
|
|
struct litest_device *sw = litest_current_device();
|
|
|
|
|
struct litest_device *touchpad, *mouse;
|
|
|
|
|
struct libinput *li = sw->libinput;
|
2025-07-01 16:30:11 +10:00
|
|
|
enum libinput_switch which =
|
|
|
|
|
litest_test_param_get_i32(test_env->params, "switch");
|
2020-05-28 15:25:02 +10:00
|
|
|
if (libinput_device_switch_has_switch(sw->libinput_device, which) <= 0)
|
2024-10-12 10:31:42 +10:00
|
|
|
return LITEST_NOT_APPLICABLE;
|
2017-09-05 14:38:53 +10:00
|
|
|
|
|
|
|
|
touchpad = switch_init_paired_touchpad(li);
|
|
|
|
|
mouse = litest_add_device(li, LITEST_MOUSE);
|
|
|
|
|
litest_disable_tap(touchpad->libinput_device);
|
2021-05-27 19:20:03 +02:00
|
|
|
litest_disable_hold_gestures(touchpad->libinput_device);
|
2025-07-01 16:30:11 +10:00
|
|
|
libinput_device_config_send_events_set_mode(
|
|
|
|
|
touchpad->libinput_device,
|
|
|
|
|
LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE);
|
2017-09-05 14:38:53 +10:00
|
|
|
litest_drain_events(li);
|
|
|
|
|
|
|
|
|
|
litest_touch_down(touchpad, 0, 50, 50);
|
test: drop the sleep_ms argument
This forces events for every ~10ms now. If we want a slower movement, we need
more steps - just like a real touchpad does it.
Cocinelle spatch files were variants of:
@@
expression A, B, C, D, E, F, G, H, I, J, K;
@@
- litest_touch_move_two_touches(A, B, C, D, E, F, G, H, I)
+ litest_touch_move_two_touches(A, B, C, D, E, F, G, H)
The only test that needed a real fix was touchpad_no_palm_detect_2fg_scroll,
it used 12ms before, now it's using 10ms so on the bcm5974 touchpad the second
finger was a speed-thumb. Increasing the events and thus slowing down the
pointer means it's a normal finger and the test succeeds again.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-28 09:16:52 +10:00
|
|
|
litest_touch_move_to(touchpad, 0, 50, 50, 70, 50, 10);
|
2017-09-05 14:38:53 +10:00
|
|
|
litest_touch_up(touchpad, 0);
|
|
|
|
|
litest_assert_empty_queue(li);
|
|
|
|
|
|
|
|
|
|
/* switch is on - no events */
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_grab_device(sw);
|
2017-09-05 14:38:53 +10:00
|
|
|
litest_switch_action(sw, which, LIBINPUT_SWITCH_STATE_ON);
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_ungrab_device(sw);
|
2017-09-05 14:38:53 +10:00
|
|
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_SWITCH_TOGGLE);
|
|
|
|
|
|
|
|
|
|
litest_touch_down(touchpad, 0, 50, 50);
|
test: drop the sleep_ms argument
This forces events for every ~10ms now. If we want a slower movement, we need
more steps - just like a real touchpad does it.
Cocinelle spatch files were variants of:
@@
expression A, B, C, D, E, F, G, H, I, J, K;
@@
- litest_touch_move_two_touches(A, B, C, D, E, F, G, H, I)
+ litest_touch_move_two_touches(A, B, C, D, E, F, G, H)
The only test that needed a real fix was touchpad_no_palm_detect_2fg_scroll,
it used 12ms before, now it's using 10ms so on the bcm5974 touchpad the second
finger was a speed-thumb. Increasing the events and thus slowing down the
pointer means it's a normal finger and the test succeeds again.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-28 09:16:52 +10:00
|
|
|
litest_touch_move_to(touchpad, 0, 50, 50, 70, 50, 10);
|
2017-09-05 14:38:53 +10:00
|
|
|
litest_touch_up(touchpad, 0);
|
|
|
|
|
litest_assert_empty_queue(li);
|
|
|
|
|
|
|
|
|
|
/* switch is off but but tp is still disabled */
|
|
|
|
|
litest_switch_action(sw, which, LIBINPUT_SWITCH_STATE_OFF);
|
|
|
|
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_SWITCH_TOGGLE);
|
|
|
|
|
|
|
|
|
|
litest_touch_down(touchpad, 0, 50, 50);
|
test: drop the sleep_ms argument
This forces events for every ~10ms now. If we want a slower movement, we need
more steps - just like a real touchpad does it.
Cocinelle spatch files were variants of:
@@
expression A, B, C, D, E, F, G, H, I, J, K;
@@
- litest_touch_move_two_touches(A, B, C, D, E, F, G, H, I)
+ litest_touch_move_two_touches(A, B, C, D, E, F, G, H)
The only test that needed a real fix was touchpad_no_palm_detect_2fg_scroll,
it used 12ms before, now it's using 10ms so on the bcm5974 touchpad the second
finger was a speed-thumb. Increasing the events and thus slowing down the
pointer means it's a normal finger and the test succeeds again.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-28 09:16:52 +10:00
|
|
|
litest_touch_move_to(touchpad, 0, 50, 50, 70, 50, 10);
|
2017-09-05 14:38:53 +10:00
|
|
|
litest_touch_up(touchpad, 0);
|
|
|
|
|
litest_assert_empty_queue(li);
|
|
|
|
|
|
2025-04-07 15:12:51 +10:00
|
|
|
litest_device_destroy(touchpad);
|
|
|
|
|
litest_device_destroy(mouse);
|
2017-09-05 14:38:53 +10:00
|
|
|
}
|
|
|
|
|
END_TEST
|
|
|
|
|
|
2017-01-25 15:21:52 +10:00
|
|
|
START_TEST(lid_open_on_key)
|
|
|
|
|
{
|
|
|
|
|
struct litest_device *sw = litest_current_device();
|
|
|
|
|
struct litest_device *keyboard;
|
|
|
|
|
struct libinput *li = sw->libinput;
|
|
|
|
|
struct libinput_event *event;
|
|
|
|
|
|
2017-04-21 17:52:37 +10:00
|
|
|
if (!switch_has_lid(sw))
|
2024-10-12 10:31:42 +10:00
|
|
|
return LITEST_NOT_APPLICABLE;
|
2017-04-21 17:52:37 +10:00
|
|
|
|
2017-01-25 15:21:52 +10:00
|
|
|
keyboard = litest_add_device(li, LITEST_KEYBOARD);
|
|
|
|
|
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_grab_device(sw);
|
2017-10-27 15:03:52 +10:00
|
|
|
for (int i = 0; i < 3; i++) {
|
2025-07-01 16:30:11 +10:00
|
|
|
litest_switch_action(sw, LIBINPUT_SWITCH_LID, LIBINPUT_SWITCH_STATE_ON);
|
2017-10-27 15:03:52 +10:00
|
|
|
litest_drain_events(li);
|
|
|
|
|
|
|
|
|
|
litest_event(keyboard, EV_KEY, KEY_A, 1);
|
|
|
|
|
litest_event(keyboard, EV_SYN, SYN_REPORT, 0);
|
|
|
|
|
litest_event(keyboard, EV_KEY, KEY_A, 0);
|
|
|
|
|
litest_event(keyboard, EV_SYN, SYN_REPORT, 0);
|
2024-09-13 15:13:38 +10:00
|
|
|
litest_dispatch(li);
|
2017-01-25 15:21:52 +10:00
|
|
|
|
2017-10-27 15:03:52 +10:00
|
|
|
event = libinput_get_event(li);
|
|
|
|
|
litest_is_switch_event(event,
|
|
|
|
|
LIBINPUT_SWITCH_LID,
|
|
|
|
|
LIBINPUT_SWITCH_STATE_OFF);
|
|
|
|
|
libinput_event_destroy(event);
|
2017-01-25 15:21:52 +10:00
|
|
|
|
2017-10-27 15:03:52 +10:00
|
|
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_KEYBOARD_KEY);
|
2017-01-25 15:21:52 +10:00
|
|
|
|
2017-10-27 15:03:52 +10:00
|
|
|
litest_switch_action(sw,
|
|
|
|
|
LIBINPUT_SWITCH_LID,
|
|
|
|
|
LIBINPUT_SWITCH_STATE_OFF);
|
|
|
|
|
litest_assert_empty_queue(li);
|
|
|
|
|
}
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_ungrab_device(sw);
|
2017-01-25 15:21:52 +10:00
|
|
|
|
2025-04-07 15:12:51 +10:00
|
|
|
litest_device_destroy(keyboard);
|
2017-01-25 15:21:52 +10:00
|
|
|
}
|
|
|
|
|
END_TEST
|
|
|
|
|
|
|
|
|
|
START_TEST(lid_open_on_key_touchpad_enabled)
|
|
|
|
|
{
|
|
|
|
|
struct litest_device *sw = litest_current_device();
|
|
|
|
|
struct litest_device *keyboard, *touchpad;
|
|
|
|
|
struct libinput *li = sw->libinput;
|
|
|
|
|
|
2017-04-21 17:52:37 +10:00
|
|
|
if (!switch_has_lid(sw))
|
2024-10-12 10:31:42 +10:00
|
|
|
return LITEST_NOT_APPLICABLE;
|
2017-04-21 17:52:37 +10:00
|
|
|
|
2017-01-25 15:21:52 +10:00
|
|
|
keyboard = litest_add_device(li, LITEST_KEYBOARD);
|
|
|
|
|
touchpad = litest_add_device(li, LITEST_SYNAPTICS_I2C);
|
|
|
|
|
|
2021-05-27 19:20:03 +02:00
|
|
|
litest_disable_hold_gestures(touchpad->libinput_device);
|
|
|
|
|
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_grab_device(sw);
|
2025-07-01 16:30:11 +10:00
|
|
|
litest_switch_action(sw, LIBINPUT_SWITCH_LID, LIBINPUT_SWITCH_STATE_ON);
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_ungrab_device(sw);
|
2017-01-25 15:21:52 +10:00
|
|
|
litest_drain_events(li);
|
|
|
|
|
|
|
|
|
|
litest_event(keyboard, EV_KEY, KEY_A, 1);
|
|
|
|
|
litest_event(keyboard, EV_SYN, SYN_REPORT, 0);
|
|
|
|
|
litest_event(keyboard, EV_KEY, KEY_A, 0);
|
|
|
|
|
litest_event(keyboard, EV_SYN, SYN_REPORT, 0);
|
|
|
|
|
litest_drain_events(li);
|
2025-04-01 09:23:10 +10:00
|
|
|
litest_timeout_dwt_long(li);
|
2017-01-25 15:21:52 +10:00
|
|
|
|
|
|
|
|
litest_touch_down(touchpad, 0, 50, 50);
|
test: drop the sleep_ms argument
This forces events for every ~10ms now. If we want a slower movement, we need
more steps - just like a real touchpad does it.
Cocinelle spatch files were variants of:
@@
expression A, B, C, D, E, F, G, H, I, J, K;
@@
- litest_touch_move_two_touches(A, B, C, D, E, F, G, H, I)
+ litest_touch_move_two_touches(A, B, C, D, E, F, G, H)
The only test that needed a real fix was touchpad_no_palm_detect_2fg_scroll,
it used 12ms before, now it's using 10ms so on the bcm5974 touchpad the second
finger was a speed-thumb. Increasing the events and thus slowing down the
pointer means it's a normal finger and the test succeeds again.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-28 09:16:52 +10:00
|
|
|
litest_touch_move_to(touchpad, 0, 50, 50, 70, 70, 10);
|
2017-01-25 15:21:52 +10:00
|
|
|
litest_touch_up(touchpad, 0);
|
2024-09-13 15:13:38 +10:00
|
|
|
litest_dispatch(li);
|
2017-01-25 15:21:52 +10:00
|
|
|
|
|
|
|
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
|
|
|
|
|
|
2025-04-07 15:12:51 +10:00
|
|
|
litest_device_destroy(keyboard);
|
|
|
|
|
litest_device_destroy(touchpad);
|
2017-01-25 15:21:52 +10:00
|
|
|
}
|
|
|
|
|
END_TEST
|
|
|
|
|
|
2017-09-01 17:30:08 +10:00
|
|
|
START_TEST(switch_suspend_with_keyboard)
|
2017-05-04 14:50:31 +10:00
|
|
|
{
|
|
|
|
|
struct litest_device *keyboard;
|
|
|
|
|
struct litest_device *sw;
|
2025-07-01 16:30:11 +10:00
|
|
|
enum libinput_switch which =
|
|
|
|
|
litest_test_param_get_i32(test_env->params, "switch");
|
2025-04-07 13:15:28 +10:00
|
|
|
|
|
|
|
|
_litest_context_destroy_ struct libinput *li = litest_create_context();
|
2017-05-04 14:50:31 +10:00
|
|
|
|
2025-07-01 16:30:11 +10:00
|
|
|
switch (which) {
|
2017-09-01 17:30:08 +10:00
|
|
|
case LIBINPUT_SWITCH_LID:
|
|
|
|
|
sw = litest_add_device(li, LITEST_LID_SWITCH);
|
|
|
|
|
break;
|
|
|
|
|
case LIBINPUT_SWITCH_TABLET_MODE:
|
|
|
|
|
sw = litest_add_device(li, LITEST_THINKPAD_EXTRABUTTONS);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
abort();
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-13 15:13:38 +10:00
|
|
|
litest_dispatch(li);
|
2017-05-04 14:50:31 +10:00
|
|
|
|
|
|
|
|
keyboard = litest_add_device(li, LITEST_KEYBOARD);
|
2024-09-13 15:13:38 +10:00
|
|
|
litest_dispatch(li);
|
2017-05-04 14:50:31 +10:00
|
|
|
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_grab_device(sw);
|
2017-09-01 17:30:08 +10:00
|
|
|
litest_switch_action(sw, which, LIBINPUT_SWITCH_STATE_ON);
|
2017-05-04 14:50:31 +10:00
|
|
|
litest_drain_events(li);
|
2017-09-01 17:30:08 +10:00
|
|
|
litest_switch_action(sw, which, LIBINPUT_SWITCH_STATE_OFF);
|
2017-05-04 14:50:31 +10:00
|
|
|
litest_drain_events(li);
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_ungrab_device(sw);
|
2017-05-04 14:50:31 +10:00
|
|
|
|
2025-04-07 15:12:51 +10:00
|
|
|
litest_device_destroy(keyboard);
|
2017-05-04 14:50:31 +10:00
|
|
|
litest_drain_events(li);
|
|
|
|
|
|
2025-04-07 15:12:51 +10:00
|
|
|
litest_device_destroy(sw);
|
2024-09-13 15:13:38 +10:00
|
|
|
litest_dispatch(li);
|
2017-05-04 14:50:31 +10:00
|
|
|
}
|
|
|
|
|
END_TEST
|
|
|
|
|
|
2017-09-01 17:30:08 +10:00
|
|
|
START_TEST(switch_suspend_with_touchpad)
|
2017-05-05 12:48:35 +10:00
|
|
|
{
|
|
|
|
|
struct litest_device *touchpad, *sw;
|
2025-07-01 16:30:11 +10:00
|
|
|
enum libinput_switch which =
|
|
|
|
|
litest_test_param_get_i32(test_env->params, "switch");
|
2025-04-07 13:15:28 +10:00
|
|
|
|
|
|
|
|
_litest_context_destroy_ struct libinput *li = litest_create_context();
|
2017-05-05 12:48:35 +10:00
|
|
|
|
2025-07-01 16:30:11 +10:00
|
|
|
switch (which) {
|
2017-09-01 17:30:08 +10:00
|
|
|
case LIBINPUT_SWITCH_LID:
|
|
|
|
|
sw = litest_add_device(li, LITEST_LID_SWITCH);
|
|
|
|
|
break;
|
|
|
|
|
case LIBINPUT_SWITCH_TABLET_MODE:
|
|
|
|
|
sw = litest_add_device(li, LITEST_THINKPAD_EXTRABUTTONS);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
abort();
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-05 12:48:35 +10:00
|
|
|
litest_drain_events(li);
|
|
|
|
|
|
|
|
|
|
touchpad = litest_add_device(li, LITEST_SYNAPTICS_I2C);
|
|
|
|
|
litest_drain_events(li);
|
|
|
|
|
|
2020-08-03 15:23:51 +10:00
|
|
|
litest_grab_device(sw);
|
|
|
|
|
litest_switch_action(sw, which, LIBINPUT_SWITCH_STATE_ON);
|
|
|
|
|
litest_drain_events(li);
|
|
|
|
|
litest_switch_action(sw, which, LIBINPUT_SWITCH_STATE_OFF);
|
|
|
|
|
litest_drain_events(li);
|
|
|
|
|
litest_ungrab_device(sw);
|
|
|
|
|
|
2025-04-07 15:12:51 +10:00
|
|
|
litest_device_destroy(sw);
|
2017-05-05 12:48:35 +10:00
|
|
|
litest_drain_events(li);
|
2025-04-07 15:12:51 +10:00
|
|
|
litest_device_destroy(touchpad);
|
2017-05-05 12:48:35 +10:00
|
|
|
litest_drain_events(li);
|
|
|
|
|
}
|
|
|
|
|
END_TEST
|
|
|
|
|
|
2017-01-30 12:58:37 +10:00
|
|
|
START_TEST(lid_update_hw_on_key)
|
|
|
|
|
{
|
|
|
|
|
struct litest_device *sw = litest_current_device();
|
|
|
|
|
struct libinput *li = sw->libinput;
|
|
|
|
|
struct litest_device *keyboard;
|
2025-04-07 10:35:56 +10:00
|
|
|
_free_(libevdev) *evdev = NULL;
|
2020-07-03 12:46:38 +10:00
|
|
|
struct input_event event;
|
|
|
|
|
int rc;
|
2017-01-30 12:58:37 +10:00
|
|
|
|
2017-04-21 17:52:37 +10:00
|
|
|
if (!switch_has_lid(sw))
|
2024-10-12 10:31:42 +10:00
|
|
|
return LITEST_NOT_APPLICABLE;
|
2017-04-21 17:52:37 +10:00
|
|
|
|
2017-01-30 12:58:37 +10:00
|
|
|
keyboard = litest_add_device(li, LITEST_KEYBOARD);
|
|
|
|
|
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_grab_device(sw);
|
2025-07-01 16:30:11 +10:00
|
|
|
litest_switch_action(sw, LIBINPUT_SWITCH_LID, LIBINPUT_SWITCH_STATE_ON);
|
2017-01-30 12:58:37 +10:00
|
|
|
litest_drain_events(li);
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_ungrab_device(sw);
|
2017-01-30 12:58:37 +10:00
|
|
|
|
2020-07-03 12:46:38 +10:00
|
|
|
/* Separate direct libevdev context to check if the HW event goes
|
|
|
|
|
* through */
|
2025-07-01 16:30:11 +10:00
|
|
|
_autoclose_ int fd =
|
|
|
|
|
open(libevdev_uinput_get_devnode(sw->uinput), O_RDONLY | O_NONBLOCK);
|
2024-09-16 16:20:26 +10:00
|
|
|
litest_assert_int_ge(fd, 0);
|
|
|
|
|
litest_assert_int_eq(libevdev_new_from_fd(fd, &evdev), 0);
|
|
|
|
|
litest_assert_int_eq(libevdev_get_event_value(evdev, EV_SW, SW_LID), 1);
|
2017-01-30 12:58:37 +10:00
|
|
|
|
2020-07-03 12:46:38 +10:00
|
|
|
/* Typing on the keyboard should trigger a lid open event */
|
2017-01-30 12:58:37 +10:00
|
|
|
litest_event(keyboard, EV_KEY, KEY_A, 1);
|
|
|
|
|
litest_event(keyboard, EV_SYN, SYN_REPORT, 0);
|
|
|
|
|
litest_event(keyboard, EV_KEY, KEY_A, 0);
|
|
|
|
|
litest_event(keyboard, EV_SYN, SYN_REPORT, 0);
|
|
|
|
|
litest_drain_events(li);
|
|
|
|
|
|
2020-07-03 12:46:38 +10:00
|
|
|
rc = libevdev_next_event(evdev, LIBEVDEV_READ_FLAG_NORMAL, &event);
|
2024-09-16 16:20:26 +10:00
|
|
|
litest_assert_int_eq(rc, LIBEVDEV_READ_STATUS_SUCCESS);
|
|
|
|
|
litest_assert_int_eq(event.type, EV_SW);
|
|
|
|
|
litest_assert_int_eq(event.code, SW_LID);
|
|
|
|
|
litest_assert_int_eq(event.value, 0);
|
2020-07-03 12:46:38 +10:00
|
|
|
rc = libevdev_next_event(evdev, LIBEVDEV_READ_FLAG_NORMAL, &event);
|
2024-09-16 16:20:26 +10:00
|
|
|
litest_assert_int_eq(rc, LIBEVDEV_READ_STATUS_SUCCESS);
|
|
|
|
|
litest_assert_int_eq(event.type, EV_SYN);
|
|
|
|
|
litest_assert_int_eq(event.code, SYN_REPORT);
|
|
|
|
|
litest_assert_int_eq(event.value, 0);
|
2020-07-03 12:46:38 +10:00
|
|
|
rc = libevdev_next_event(evdev, LIBEVDEV_READ_FLAG_NORMAL, &event);
|
2024-09-16 16:20:26 +10:00
|
|
|
litest_assert_int_eq(rc, -EAGAIN);
|
2017-01-30 12:58:37 +10:00
|
|
|
|
2025-04-07 15:12:51 +10:00
|
|
|
litest_device_destroy(keyboard);
|
2017-01-30 12:58:37 +10:00
|
|
|
}
|
|
|
|
|
END_TEST
|
|
|
|
|
|
2017-05-19 12:57:23 +02:00
|
|
|
START_TEST(lid_update_hw_on_key_closed_on_init)
|
|
|
|
|
{
|
|
|
|
|
struct litest_device *sw = litest_current_device();
|
|
|
|
|
struct litest_device *keyboard;
|
2025-07-01 16:30:11 +10:00
|
|
|
_free_(libevdev) * evdev;
|
2020-07-03 12:46:38 +10:00
|
|
|
struct input_event event;
|
|
|
|
|
int rc;
|
2017-05-19 12:57:23 +02:00
|
|
|
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_grab_device(sw);
|
2025-07-01 16:30:11 +10:00
|
|
|
litest_switch_action(sw, LIBINPUT_SWITCH_LID, LIBINPUT_SWITCH_STATE_ON);
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_ungrab_device(sw);
|
2017-05-19 12:57:23 +02:00
|
|
|
|
2020-07-03 12:46:38 +10:00
|
|
|
/* Separate direct libevdev context to check if the HW event goes
|
|
|
|
|
* through */
|
2025-07-01 16:30:11 +10:00
|
|
|
_autoclose_ int fd =
|
|
|
|
|
open(libevdev_uinput_get_devnode(sw->uinput), O_RDONLY | O_NONBLOCK);
|
2024-09-16 16:20:26 +10:00
|
|
|
litest_assert_int_ge(fd, 0);
|
|
|
|
|
litest_assert_int_eq(libevdev_new_from_fd(fd, &evdev), 0);
|
|
|
|
|
litest_assert_int_eq(libevdev_get_event_value(evdev, EV_SW, SW_LID), 1);
|
2017-05-19 12:57:23 +02:00
|
|
|
|
|
|
|
|
keyboard = litest_add_device(sw->libinput, LITEST_KEYBOARD);
|
|
|
|
|
|
|
|
|
|
/* separate context for the right state on init */
|
2025-04-07 13:15:28 +10:00
|
|
|
_litest_context_destroy_ struct libinput *li = litest_create_context();
|
2025-07-01 16:30:11 +10:00
|
|
|
libinput_path_add_device(li, libevdev_uinput_get_devnode(sw->uinput));
|
|
|
|
|
libinput_path_add_device(li, libevdev_uinput_get_devnode(keyboard->uinput));
|
2017-05-19 12:57:23 +02:00
|
|
|
|
2020-07-03 12:46:38 +10:00
|
|
|
/* don't expect a switch waiting for us, this is run for an
|
|
|
|
|
* unreliable device */
|
2017-05-19 12:57:23 +02:00
|
|
|
while (libinput_next_event_type(li) != LIBINPUT_EVENT_NONE) {
|
2024-09-16 16:49:38 +10:00
|
|
|
litest_assert_enum_ne(libinput_next_event_type(li),
|
|
|
|
|
LIBINPUT_EVENT_SWITCH_TOGGLE);
|
2017-05-19 12:57:23 +02:00
|
|
|
libinput_event_destroy(libinput_get_event(li));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
litest_event(keyboard, EV_KEY, KEY_A, 1);
|
|
|
|
|
litest_event(keyboard, EV_SYN, SYN_REPORT, 0);
|
|
|
|
|
litest_event(keyboard, EV_KEY, KEY_A, 0);
|
|
|
|
|
litest_event(keyboard, EV_SYN, SYN_REPORT, 0);
|
|
|
|
|
/* No switch event, we're still in vanilla (open) state */
|
|
|
|
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_KEYBOARD_KEY);
|
|
|
|
|
|
|
|
|
|
/* Make sure kernel state has updated */
|
2020-07-03 12:46:38 +10:00
|
|
|
rc = libevdev_next_event(evdev, LIBEVDEV_READ_FLAG_NORMAL, &event);
|
2024-09-16 16:20:26 +10:00
|
|
|
litest_assert_int_eq(rc, LIBEVDEV_READ_STATUS_SUCCESS);
|
|
|
|
|
litest_assert_int_eq(event.type, EV_SW);
|
|
|
|
|
litest_assert_int_eq(event.code, SW_LID);
|
|
|
|
|
litest_assert_int_eq(event.value, 0);
|
2020-07-03 12:46:38 +10:00
|
|
|
rc = libevdev_next_event(evdev, LIBEVDEV_READ_FLAG_NORMAL, &event);
|
2024-09-16 16:20:26 +10:00
|
|
|
litest_assert_int_eq(rc, LIBEVDEV_READ_STATUS_SUCCESS);
|
|
|
|
|
litest_assert_int_eq(event.type, EV_SYN);
|
|
|
|
|
litest_assert_int_eq(event.code, SYN_REPORT);
|
|
|
|
|
litest_assert_int_eq(event.value, 0);
|
2020-07-03 12:46:38 +10:00
|
|
|
rc = libevdev_next_event(evdev, LIBEVDEV_READ_FLAG_NORMAL, &event);
|
2024-09-16 16:20:26 +10:00
|
|
|
litest_assert_int_eq(rc, -EAGAIN);
|
2017-05-19 12:57:23 +02:00
|
|
|
|
2025-04-07 15:12:51 +10:00
|
|
|
litest_device_destroy(keyboard);
|
2017-05-19 12:57:23 +02:00
|
|
|
}
|
|
|
|
|
END_TEST
|
|
|
|
|
|
2017-09-19 10:10:22 +10:00
|
|
|
START_TEST(lid_update_hw_on_key_multiple_keyboards)
|
|
|
|
|
{
|
|
|
|
|
struct litest_device *sw = litest_current_device();
|
|
|
|
|
struct libinput *li = sw->libinput;
|
|
|
|
|
struct litest_device *keyboard1, *keyboard2;
|
2025-07-01 16:30:11 +10:00
|
|
|
_free_(libevdev) * evdev;
|
2020-07-03 12:46:38 +10:00
|
|
|
struct input_event event;
|
|
|
|
|
int rc;
|
2017-09-19 10:10:22 +10:00
|
|
|
|
|
|
|
|
if (!switch_has_lid(sw))
|
2024-10-12 10:31:42 +10:00
|
|
|
return LITEST_NOT_APPLICABLE;
|
2017-09-19 10:10:22 +10:00
|
|
|
|
2025-07-01 16:30:11 +10:00
|
|
|
keyboard1 = litest_add_device(li, LITEST_KEYBOARD_BLADE_STEALTH_VIDEOSWITCH);
|
2024-09-13 15:13:38 +10:00
|
|
|
litest_dispatch(li);
|
2017-09-19 10:10:22 +10:00
|
|
|
|
|
|
|
|
keyboard2 = litest_add_device(li, LITEST_KEYBOARD_BLADE_STEALTH);
|
2024-09-13 15:13:38 +10:00
|
|
|
litest_dispatch(li);
|
2017-09-19 10:10:22 +10:00
|
|
|
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_grab_device(sw);
|
2025-07-01 16:30:11 +10:00
|
|
|
litest_switch_action(sw, LIBINPUT_SWITCH_LID, LIBINPUT_SWITCH_STATE_ON);
|
2017-09-19 10:10:22 +10:00
|
|
|
litest_drain_events(li);
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_ungrab_device(sw);
|
2017-09-19 10:10:22 +10:00
|
|
|
|
2020-07-03 12:46:38 +10:00
|
|
|
/* Separate direct libevdev context to check if the HW event goes
|
|
|
|
|
* through */
|
2025-07-01 16:30:11 +10:00
|
|
|
_autoclose_ int fd =
|
|
|
|
|
open(libevdev_uinput_get_devnode(sw->uinput), O_RDONLY | O_NONBLOCK);
|
2024-09-16 16:20:26 +10:00
|
|
|
litest_assert_int_ge(fd, 0);
|
|
|
|
|
litest_assert_int_eq(libevdev_new_from_fd(fd, &evdev), 0);
|
|
|
|
|
litest_assert_int_eq(libevdev_get_event_value(evdev, EV_SW, SW_LID), 1);
|
2017-09-19 10:10:22 +10:00
|
|
|
|
2020-07-03 12:46:38 +10:00
|
|
|
/* Typing on the second keyboard should trigger a lid open event */
|
2017-09-19 10:10:22 +10:00
|
|
|
litest_event(keyboard2, EV_KEY, KEY_A, 1);
|
|
|
|
|
litest_event(keyboard2, EV_SYN, SYN_REPORT, 0);
|
|
|
|
|
litest_event(keyboard2, EV_KEY, KEY_A, 0);
|
|
|
|
|
litest_event(keyboard2, EV_SYN, SYN_REPORT, 0);
|
|
|
|
|
litest_drain_events(li);
|
|
|
|
|
|
2020-07-03 12:46:38 +10:00
|
|
|
rc = libevdev_next_event(evdev, LIBEVDEV_READ_FLAG_NORMAL, &event);
|
2024-09-16 16:20:26 +10:00
|
|
|
litest_assert_int_eq(rc, LIBEVDEV_READ_STATUS_SUCCESS);
|
|
|
|
|
litest_assert_int_eq(event.type, EV_SW);
|
|
|
|
|
litest_assert_int_eq(event.code, SW_LID);
|
|
|
|
|
litest_assert_int_eq(event.value, 0);
|
2020-07-03 12:46:38 +10:00
|
|
|
rc = libevdev_next_event(evdev, LIBEVDEV_READ_FLAG_NORMAL, &event);
|
2024-09-16 16:20:26 +10:00
|
|
|
litest_assert_int_eq(rc, LIBEVDEV_READ_STATUS_SUCCESS);
|
|
|
|
|
litest_assert_int_eq(event.type, EV_SYN);
|
|
|
|
|
litest_assert_int_eq(event.code, SYN_REPORT);
|
|
|
|
|
litest_assert_int_eq(event.value, 0);
|
2020-07-03 12:46:38 +10:00
|
|
|
rc = libevdev_next_event(evdev, LIBEVDEV_READ_FLAG_NORMAL, &event);
|
2024-09-16 16:20:26 +10:00
|
|
|
litest_assert_int_eq(rc, -EAGAIN);
|
2017-09-19 10:10:22 +10:00
|
|
|
|
2025-04-07 15:12:51 +10:00
|
|
|
litest_device_destroy(keyboard1);
|
|
|
|
|
litest_device_destroy(keyboard2);
|
2017-09-19 10:10:22 +10:00
|
|
|
}
|
|
|
|
|
END_TEST
|
|
|
|
|
|
2017-07-25 09:38:46 +10:00
|
|
|
START_TEST(lid_key_press)
|
|
|
|
|
{
|
|
|
|
|
struct litest_device *sw = litest_current_device();
|
|
|
|
|
struct libinput *li = sw->libinput;
|
|
|
|
|
|
|
|
|
|
litest_drain_events(li);
|
|
|
|
|
|
2018-02-01 15:25:34 +10:00
|
|
|
litest_keyboard_key(sw, KEY_VOLUMEUP, true);
|
|
|
|
|
litest_keyboard_key(sw, KEY_VOLUMEUP, false);
|
2024-09-13 15:13:38 +10:00
|
|
|
litest_dispatch(li);
|
2017-07-25 09:38:46 +10:00
|
|
|
|
2017-09-04 10:40:04 +10:00
|
|
|
/* Check that we're routing key events from a lid device too */
|
|
|
|
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_KEYBOARD_KEY);
|
2017-07-25 09:38:46 +10:00
|
|
|
}
|
|
|
|
|
END_TEST
|
|
|
|
|
|
2017-09-01 17:30:08 +10:00
|
|
|
START_TEST(tablet_mode_disable_touchpad_on_init)
|
|
|
|
|
{
|
|
|
|
|
struct litest_device *sw = litest_current_device();
|
|
|
|
|
struct litest_device *touchpad;
|
|
|
|
|
struct libinput *li = sw->libinput;
|
|
|
|
|
|
|
|
|
|
if (!switch_has_tablet_mode(sw))
|
2024-10-12 10:31:42 +10:00
|
|
|
return LITEST_NOT_APPLICABLE;
|
2017-09-01 17:30:08 +10:00
|
|
|
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_grab_device(sw);
|
2025-07-01 16:30:11 +10:00
|
|
|
litest_switch_action(sw, LIBINPUT_SWITCH_TABLET_MODE, LIBINPUT_SWITCH_STATE_ON);
|
2017-09-01 17:30:08 +10:00
|
|
|
litest_drain_events(li);
|
|
|
|
|
|
|
|
|
|
/* touchpad comes with switch already on - no events */
|
|
|
|
|
touchpad = switch_init_paired_touchpad(li);
|
|
|
|
|
litest_disable_tap(touchpad->libinput_device);
|
2021-05-27 19:20:03 +02:00
|
|
|
litest_disable_hold_gestures(touchpad->libinput_device);
|
2017-09-01 17:30:08 +10:00
|
|
|
litest_drain_events(li);
|
|
|
|
|
|
|
|
|
|
litest_touch_down(touchpad, 0, 50, 50);
|
test: drop the sleep_ms argument
This forces events for every ~10ms now. If we want a slower movement, we need
more steps - just like a real touchpad does it.
Cocinelle spatch files were variants of:
@@
expression A, B, C, D, E, F, G, H, I, J, K;
@@
- litest_touch_move_two_touches(A, B, C, D, E, F, G, H, I)
+ litest_touch_move_two_touches(A, B, C, D, E, F, G, H)
The only test that needed a real fix was touchpad_no_palm_detect_2fg_scroll,
it used 12ms before, now it's using 10ms so on the bcm5974 touchpad the second
finger was a speed-thumb. Increasing the events and thus slowing down the
pointer means it's a normal finger and the test succeeds again.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-28 09:16:52 +10:00
|
|
|
litest_touch_move_to(touchpad, 0, 50, 50, 70, 50, 10);
|
2017-09-01 17:30:08 +10:00
|
|
|
litest_touch_up(touchpad, 0);
|
|
|
|
|
litest_assert_empty_queue(li);
|
|
|
|
|
|
|
|
|
|
litest_switch_action(sw,
|
|
|
|
|
LIBINPUT_SWITCH_TABLET_MODE,
|
|
|
|
|
LIBINPUT_SWITCH_STATE_OFF);
|
|
|
|
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_SWITCH_TOGGLE);
|
|
|
|
|
|
|
|
|
|
litest_touch_down(touchpad, 0, 50, 50);
|
test: drop the sleep_ms argument
This forces events for every ~10ms now. If we want a slower movement, we need
more steps - just like a real touchpad does it.
Cocinelle spatch files were variants of:
@@
expression A, B, C, D, E, F, G, H, I, J, K;
@@
- litest_touch_move_two_touches(A, B, C, D, E, F, G, H, I)
+ litest_touch_move_two_touches(A, B, C, D, E, F, G, H)
The only test that needed a real fix was touchpad_no_palm_detect_2fg_scroll,
it used 12ms before, now it's using 10ms so on the bcm5974 touchpad the second
finger was a speed-thumb. Increasing the events and thus slowing down the
pointer means it's a normal finger and the test succeeds again.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-28 09:16:52 +10:00
|
|
|
litest_touch_move_to(touchpad, 0, 50, 50, 70, 50, 10);
|
2017-09-01 17:30:08 +10:00
|
|
|
litest_touch_up(touchpad, 0);
|
|
|
|
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_ungrab_device(sw);
|
2017-09-01 17:30:08 +10:00
|
|
|
|
2025-04-07 15:12:51 +10:00
|
|
|
litest_device_destroy(touchpad);
|
2017-09-01 17:30:08 +10:00
|
|
|
}
|
|
|
|
|
END_TEST
|
|
|
|
|
|
2018-10-09 11:07:02 +10:00
|
|
|
START_TEST(tablet_mode_disable_touchpad_on_resume)
|
|
|
|
|
{
|
|
|
|
|
struct litest_device *sw = litest_current_device();
|
|
|
|
|
struct litest_device *touchpad;
|
|
|
|
|
struct libinput *li = sw->libinput;
|
|
|
|
|
struct libinput_event *event;
|
|
|
|
|
bool have_switch_toggle = false;
|
|
|
|
|
|
|
|
|
|
if (!switch_has_tablet_mode(sw))
|
2024-10-12 10:31:42 +10:00
|
|
|
return LITEST_NOT_APPLICABLE;
|
2018-10-09 11:07:02 +10:00
|
|
|
|
|
|
|
|
touchpad = switch_init_paired_touchpad(li);
|
|
|
|
|
litest_disable_tap(touchpad->libinput_device);
|
2021-05-27 19:20:03 +02:00
|
|
|
litest_disable_hold_gestures(touchpad->libinput_device);
|
2018-10-09 11:07:02 +10:00
|
|
|
litest_drain_events(li);
|
|
|
|
|
|
|
|
|
|
libinput_suspend(li);
|
2025-07-01 16:30:11 +10:00
|
|
|
litest_switch_action(sw, LIBINPUT_SWITCH_TABLET_MODE, LIBINPUT_SWITCH_STATE_ON);
|
2018-10-09 11:07:02 +10:00
|
|
|
litest_drain_events(li);
|
|
|
|
|
libinput_resume(li);
|
2024-09-13 15:13:38 +10:00
|
|
|
litest_dispatch(li);
|
2018-10-09 11:07:02 +10:00
|
|
|
|
|
|
|
|
while ((event = libinput_get_event(li))) {
|
|
|
|
|
enum libinput_event_type type;
|
|
|
|
|
|
|
|
|
|
type = libinput_event_get_type(event);
|
|
|
|
|
switch (type) {
|
|
|
|
|
case LIBINPUT_EVENT_DEVICE_ADDED:
|
|
|
|
|
break;
|
|
|
|
|
case LIBINPUT_EVENT_SWITCH_TOGGLE:
|
|
|
|
|
litest_is_switch_event(event,
|
|
|
|
|
LIBINPUT_SWITCH_TABLET_MODE,
|
|
|
|
|
LIBINPUT_SWITCH_STATE_ON);
|
|
|
|
|
have_switch_toggle = true;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
2024-10-08 19:27:28 +10:00
|
|
|
litest_abort_msg("Unexpected event type");
|
2018-10-09 11:07:02 +10:00
|
|
|
}
|
|
|
|
|
libinput_event_destroy(event);
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-16 16:20:26 +10:00
|
|
|
litest_assert(have_switch_toggle);
|
2018-10-09 11:07:02 +10:00
|
|
|
|
|
|
|
|
litest_touch_down(touchpad, 0, 50, 50);
|
|
|
|
|
litest_touch_move_to(touchpad, 0, 50, 50, 70, 50, 10);
|
|
|
|
|
litest_touch_up(touchpad, 0);
|
|
|
|
|
litest_assert_empty_queue(li);
|
|
|
|
|
|
|
|
|
|
litest_switch_action(sw,
|
|
|
|
|
LIBINPUT_SWITCH_TABLET_MODE,
|
|
|
|
|
LIBINPUT_SWITCH_STATE_OFF);
|
2024-09-13 15:13:38 +10:00
|
|
|
litest_dispatch(li);
|
2018-10-09 11:07:02 +10:00
|
|
|
event = libinput_get_event(li);
|
|
|
|
|
litest_is_switch_event(event,
|
|
|
|
|
LIBINPUT_SWITCH_TABLET_MODE,
|
|
|
|
|
LIBINPUT_SWITCH_STATE_OFF);
|
|
|
|
|
libinput_event_destroy(event);
|
|
|
|
|
|
|
|
|
|
litest_touch_down(touchpad, 0, 50, 50);
|
|
|
|
|
litest_touch_move_to(touchpad, 0, 50, 50, 70, 50, 10);
|
|
|
|
|
litest_touch_up(touchpad, 0);
|
|
|
|
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
|
|
|
|
|
|
2025-04-07 15:12:51 +10:00
|
|
|
litest_device_destroy(touchpad);
|
2018-10-09 11:07:02 +10:00
|
|
|
}
|
|
|
|
|
END_TEST
|
|
|
|
|
|
|
|
|
|
START_TEST(tablet_mode_enable_touchpad_on_resume)
|
|
|
|
|
{
|
|
|
|
|
struct litest_device *sw = litest_current_device();
|
|
|
|
|
struct litest_device *touchpad;
|
|
|
|
|
struct libinput *li = sw->libinput;
|
|
|
|
|
struct libinput_event *event;
|
|
|
|
|
|
|
|
|
|
if (!switch_has_tablet_mode(sw))
|
2024-10-12 10:31:42 +10:00
|
|
|
return LITEST_NOT_APPLICABLE;
|
2018-10-09 11:07:02 +10:00
|
|
|
|
|
|
|
|
touchpad = switch_init_paired_touchpad(li);
|
|
|
|
|
litest_disable_tap(touchpad->libinput_device);
|
|
|
|
|
litest_drain_events(li);
|
|
|
|
|
|
2025-07-01 16:30:11 +10:00
|
|
|
litest_switch_action(sw, LIBINPUT_SWITCH_TABLET_MODE, LIBINPUT_SWITCH_STATE_ON);
|
2018-10-09 11:07:02 +10:00
|
|
|
libinput_suspend(li);
|
|
|
|
|
litest_drain_events(li);
|
|
|
|
|
|
|
|
|
|
litest_switch_action(sw,
|
|
|
|
|
LIBINPUT_SWITCH_TABLET_MODE,
|
|
|
|
|
LIBINPUT_SWITCH_STATE_OFF);
|
|
|
|
|
|
|
|
|
|
libinput_resume(li);
|
2024-09-13 15:13:38 +10:00
|
|
|
litest_dispatch(li);
|
2018-10-09 11:07:02 +10:00
|
|
|
|
|
|
|
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_DEVICE_ADDED);
|
|
|
|
|
|
|
|
|
|
litest_touch_down(touchpad, 0, 50, 50);
|
|
|
|
|
litest_touch_move_to(touchpad, 0, 50, 50, 70, 50, 10);
|
|
|
|
|
litest_touch_up(touchpad, 0);
|
2021-05-27 19:20:03 +02:00
|
|
|
litest_drain_events_of_type(li,
|
|
|
|
|
LIBINPUT_EVENT_GESTURE_HOLD_BEGIN,
|
2024-09-11 16:19:33 +10:00
|
|
|
LIBINPUT_EVENT_GESTURE_HOLD_END);
|
2018-10-09 11:07:02 +10:00
|
|
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
|
|
|
|
|
|
2025-07-01 16:30:11 +10:00
|
|
|
litest_switch_action(sw, LIBINPUT_SWITCH_TABLET_MODE, LIBINPUT_SWITCH_STATE_ON);
|
2024-09-13 15:13:38 +10:00
|
|
|
litest_dispatch(li);
|
2018-10-09 11:07:02 +10:00
|
|
|
event = libinput_get_event(li);
|
|
|
|
|
litest_is_switch_event(event,
|
|
|
|
|
LIBINPUT_SWITCH_TABLET_MODE,
|
|
|
|
|
LIBINPUT_SWITCH_STATE_ON);
|
|
|
|
|
libinput_event_destroy(event);
|
|
|
|
|
|
|
|
|
|
litest_touch_down(touchpad, 0, 50, 50);
|
|
|
|
|
litest_touch_move_to(touchpad, 0, 50, 50, 70, 50, 10);
|
|
|
|
|
litest_touch_up(touchpad, 0);
|
|
|
|
|
litest_assert_empty_queue(li);
|
|
|
|
|
|
2025-04-07 15:12:51 +10:00
|
|
|
litest_device_destroy(touchpad);
|
2018-10-09 11:07:02 +10:00
|
|
|
}
|
|
|
|
|
END_TEST
|
|
|
|
|
|
2017-09-20 14:40:59 +10:00
|
|
|
START_TEST(tablet_mode_disable_keyboard)
|
|
|
|
|
{
|
|
|
|
|
struct litest_device *sw = litest_current_device();
|
|
|
|
|
struct litest_device *keyboard;
|
|
|
|
|
struct libinput *li = sw->libinput;
|
|
|
|
|
|
|
|
|
|
if (!switch_has_tablet_mode(sw))
|
2024-10-12 10:31:42 +10:00
|
|
|
return LITEST_NOT_APPLICABLE;
|
2017-09-20 14:40:59 +10:00
|
|
|
|
|
|
|
|
keyboard = litest_add_device(li, LITEST_KEYBOARD);
|
|
|
|
|
litest_drain_events(li);
|
|
|
|
|
|
|
|
|
|
litest_keyboard_key(keyboard, KEY_A, true);
|
|
|
|
|
litest_keyboard_key(keyboard, KEY_A, false);
|
2023-07-14 12:57:58 +10:00
|
|
|
litest_keyboard_key(keyboard, KEY_B, true); /* KEY_B down but not up */
|
2024-09-13 15:13:38 +10:00
|
|
|
litest_dispatch(li);
|
2023-07-14 12:57:58 +10:00
|
|
|
|
|
|
|
|
litest_assert_key_event(li, KEY_A, LIBINPUT_KEY_STATE_PRESSED);
|
|
|
|
|
litest_assert_key_event(li, KEY_A, LIBINPUT_KEY_STATE_RELEASED);
|
2025-07-01 16:30:11 +10:00
|
|
|
litest_assert_key_event(li,
|
|
|
|
|
KEY_B,
|
|
|
|
|
LIBINPUT_KEY_STATE_PRESSED); /* KEY_B down but not up */
|
2017-09-20 14:40:59 +10:00
|
|
|
|
2025-07-01 16:30:11 +10:00
|
|
|
litest_switch_action(sw, LIBINPUT_SWITCH_TABLET_MODE, LIBINPUT_SWITCH_STATE_ON);
|
2017-09-20 14:40:59 +10:00
|
|
|
|
2023-07-14 12:57:58 +10:00
|
|
|
/* The key currently down must be released */
|
|
|
|
|
litest_assert_key_event(li, KEY_B, LIBINPUT_KEY_STATE_RELEASED);
|
2025-07-01 16:30:11 +10:00
|
|
|
litest_assert_switch_event(li,
|
|
|
|
|
LIBINPUT_SWITCH_TABLET_MODE,
|
|
|
|
|
LIBINPUT_SWITCH_STATE_ON);
|
2023-07-14 12:57:58 +10:00
|
|
|
litest_assert_empty_queue(li);
|
|
|
|
|
|
|
|
|
|
litest_keyboard_key(keyboard, KEY_B, false); /* release the kernel device */
|
2017-09-20 14:40:59 +10:00
|
|
|
litest_keyboard_key(keyboard, KEY_A, true);
|
|
|
|
|
litest_keyboard_key(keyboard, KEY_A, false);
|
|
|
|
|
litest_assert_empty_queue(li);
|
|
|
|
|
|
|
|
|
|
litest_switch_action(sw,
|
|
|
|
|
LIBINPUT_SWITCH_TABLET_MODE,
|
|
|
|
|
LIBINPUT_SWITCH_STATE_OFF);
|
2025-07-01 16:30:11 +10:00
|
|
|
litest_assert_switch_event(li,
|
|
|
|
|
LIBINPUT_SWITCH_TABLET_MODE,
|
|
|
|
|
LIBINPUT_SWITCH_STATE_OFF);
|
2017-09-20 14:40:59 +10:00
|
|
|
|
|
|
|
|
litest_keyboard_key(keyboard, KEY_A, true);
|
|
|
|
|
litest_keyboard_key(keyboard, KEY_A, false);
|
2023-07-14 12:57:58 +10:00
|
|
|
litest_keyboard_key(keyboard, KEY_B, true);
|
|
|
|
|
litest_keyboard_key(keyboard, KEY_B, false);
|
|
|
|
|
litest_assert_key_event(li, KEY_A, LIBINPUT_KEY_STATE_PRESSED);
|
|
|
|
|
litest_assert_key_event(li, KEY_A, LIBINPUT_KEY_STATE_RELEASED);
|
|
|
|
|
litest_assert_key_event(li, KEY_B, LIBINPUT_KEY_STATE_PRESSED);
|
|
|
|
|
litest_assert_key_event(li, KEY_B, LIBINPUT_KEY_STATE_RELEASED);
|
2017-09-20 14:40:59 +10:00
|
|
|
|
2025-04-07 15:12:51 +10:00
|
|
|
litest_device_destroy(keyboard);
|
2017-09-20 14:40:59 +10:00
|
|
|
}
|
|
|
|
|
END_TEST
|
|
|
|
|
|
|
|
|
|
START_TEST(tablet_mode_disable_keyboard_on_init)
|
|
|
|
|
{
|
|
|
|
|
struct litest_device *sw = litest_current_device();
|
|
|
|
|
struct litest_device *keyboard;
|
|
|
|
|
struct libinput *li = sw->libinput;
|
|
|
|
|
|
|
|
|
|
if (!switch_has_tablet_mode(sw))
|
2024-10-12 10:31:42 +10:00
|
|
|
return LITEST_NOT_APPLICABLE;
|
2017-09-20 14:40:59 +10:00
|
|
|
|
2025-07-01 16:30:11 +10:00
|
|
|
litest_switch_action(sw, LIBINPUT_SWITCH_TABLET_MODE, LIBINPUT_SWITCH_STATE_ON);
|
2017-09-20 14:40:59 +10:00
|
|
|
litest_drain_events(li);
|
|
|
|
|
|
|
|
|
|
/* keyboard comes with switch already on - no events */
|
|
|
|
|
keyboard = litest_add_device(li, LITEST_KEYBOARD);
|
|
|
|
|
litest_drain_events(li);
|
|
|
|
|
|
|
|
|
|
litest_keyboard_key(keyboard, KEY_A, true);
|
|
|
|
|
litest_keyboard_key(keyboard, KEY_A, false);
|
|
|
|
|
litest_assert_empty_queue(li);
|
|
|
|
|
|
|
|
|
|
litest_switch_action(sw,
|
|
|
|
|
LIBINPUT_SWITCH_TABLET_MODE,
|
|
|
|
|
LIBINPUT_SWITCH_STATE_OFF);
|
|
|
|
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_SWITCH_TOGGLE);
|
|
|
|
|
|
|
|
|
|
litest_keyboard_key(keyboard, KEY_A, true);
|
|
|
|
|
litest_keyboard_key(keyboard, KEY_A, false);
|
|
|
|
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_KEYBOARD_KEY);
|
|
|
|
|
|
2025-04-07 15:12:51 +10:00
|
|
|
litest_device_destroy(keyboard);
|
2017-09-20 14:40:59 +10:00
|
|
|
}
|
|
|
|
|
END_TEST
|
|
|
|
|
|
2018-10-09 11:07:02 +10:00
|
|
|
START_TEST(tablet_mode_disable_keyboard_on_resume)
|
|
|
|
|
{
|
|
|
|
|
struct litest_device *sw = litest_current_device();
|
|
|
|
|
struct litest_device *keyboard;
|
|
|
|
|
struct libinput *li = sw->libinput;
|
|
|
|
|
struct libinput_event *event;
|
|
|
|
|
bool have_switch_toggle = false;
|
|
|
|
|
|
|
|
|
|
if (!switch_has_tablet_mode(sw))
|
2024-10-12 10:31:42 +10:00
|
|
|
return LITEST_NOT_APPLICABLE;
|
2018-10-09 11:07:02 +10:00
|
|
|
|
|
|
|
|
keyboard = litest_add_device(li, LITEST_KEYBOARD);
|
|
|
|
|
litest_drain_events(li);
|
|
|
|
|
libinput_suspend(li);
|
|
|
|
|
|
2020-07-03 12:46:38 +10:00
|
|
|
/* We cannot grab this device because libinput doesn't have an open
|
|
|
|
|
* fd to this device, we need an independent grab.
|
|
|
|
|
*/
|
|
|
|
|
libevdev_grab(sw->evdev, LIBEVDEV_GRAB);
|
2025-07-01 16:30:11 +10:00
|
|
|
litest_switch_action(sw, LIBINPUT_SWITCH_TABLET_MODE, LIBINPUT_SWITCH_STATE_ON);
|
2020-07-03 12:46:38 +10:00
|
|
|
libevdev_grab(sw->evdev, LIBEVDEV_UNGRAB);
|
2018-10-09 11:07:02 +10:00
|
|
|
litest_drain_events(li);
|
|
|
|
|
|
|
|
|
|
libinput_resume(li);
|
2024-09-13 15:13:38 +10:00
|
|
|
litest_dispatch(li);
|
2018-10-09 11:07:02 +10:00
|
|
|
|
|
|
|
|
while ((event = libinput_get_event(li))) {
|
|
|
|
|
enum libinput_event_type type;
|
|
|
|
|
|
|
|
|
|
type = libinput_event_get_type(event);
|
|
|
|
|
switch (type) {
|
|
|
|
|
case LIBINPUT_EVENT_DEVICE_ADDED:
|
|
|
|
|
break;
|
|
|
|
|
case LIBINPUT_EVENT_SWITCH_TOGGLE:
|
|
|
|
|
litest_is_switch_event(event,
|
|
|
|
|
LIBINPUT_SWITCH_TABLET_MODE,
|
|
|
|
|
LIBINPUT_SWITCH_STATE_ON);
|
|
|
|
|
have_switch_toggle = true;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
2024-10-08 19:27:28 +10:00
|
|
|
litest_abort_msg("Unexpected event type");
|
2018-10-09 11:07:02 +10:00
|
|
|
}
|
|
|
|
|
libinput_event_destroy(event);
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-16 16:20:26 +10:00
|
|
|
litest_assert(have_switch_toggle);
|
2018-10-09 11:07:02 +10:00
|
|
|
|
|
|
|
|
litest_keyboard_key(keyboard, KEY_A, true);
|
|
|
|
|
litest_keyboard_key(keyboard, KEY_A, false);
|
|
|
|
|
litest_assert_empty_queue(li);
|
|
|
|
|
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_grab_device(sw);
|
2018-10-09 11:07:02 +10:00
|
|
|
litest_switch_action(sw,
|
|
|
|
|
LIBINPUT_SWITCH_TABLET_MODE,
|
|
|
|
|
LIBINPUT_SWITCH_STATE_OFF);
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_ungrab_device(sw);
|
2018-10-09 11:07:02 +10:00
|
|
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_SWITCH_TOGGLE);
|
|
|
|
|
|
|
|
|
|
litest_keyboard_key(keyboard, KEY_A, true);
|
|
|
|
|
litest_keyboard_key(keyboard, KEY_A, false);
|
|
|
|
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_KEYBOARD_KEY);
|
|
|
|
|
|
2025-04-07 15:12:51 +10:00
|
|
|
litest_device_destroy(keyboard);
|
2018-10-09 11:07:02 +10:00
|
|
|
}
|
|
|
|
|
END_TEST
|
|
|
|
|
|
|
|
|
|
START_TEST(tablet_mode_enable_keyboard_on_resume)
|
|
|
|
|
{
|
|
|
|
|
struct litest_device *sw = litest_current_device();
|
|
|
|
|
struct litest_device *keyboard;
|
|
|
|
|
struct libinput *li = sw->libinput;
|
|
|
|
|
|
|
|
|
|
if (!switch_has_tablet_mode(sw))
|
2024-10-12 10:31:42 +10:00
|
|
|
return LITEST_NOT_APPLICABLE;
|
2018-10-09 11:07:02 +10:00
|
|
|
|
|
|
|
|
keyboard = litest_add_device(li, LITEST_KEYBOARD);
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_grab_device(sw);
|
2025-07-01 16:30:11 +10:00
|
|
|
litest_switch_action(sw, LIBINPUT_SWITCH_TABLET_MODE, LIBINPUT_SWITCH_STATE_ON);
|
2018-10-09 11:07:02 +10:00
|
|
|
litest_drain_events(li);
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_ungrab_device(sw);
|
2018-10-09 11:07:02 +10:00
|
|
|
libinput_suspend(li);
|
|
|
|
|
litest_drain_events(li);
|
|
|
|
|
|
|
|
|
|
litest_switch_action(sw,
|
|
|
|
|
LIBINPUT_SWITCH_TABLET_MODE,
|
|
|
|
|
LIBINPUT_SWITCH_STATE_OFF);
|
|
|
|
|
|
|
|
|
|
libinput_resume(li);
|
2024-09-13 15:13:38 +10:00
|
|
|
litest_dispatch(li);
|
2018-10-09 11:07:02 +10:00
|
|
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_DEVICE_ADDED);
|
|
|
|
|
|
|
|
|
|
litest_keyboard_key(keyboard, KEY_A, true);
|
|
|
|
|
litest_keyboard_key(keyboard, KEY_A, false);
|
|
|
|
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_KEYBOARD_KEY);
|
|
|
|
|
|
2025-07-01 16:30:11 +10:00
|
|
|
litest_switch_action(sw, LIBINPUT_SWITCH_TABLET_MODE, LIBINPUT_SWITCH_STATE_ON);
|
2018-10-09 11:07:02 +10:00
|
|
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_SWITCH_TOGGLE);
|
|
|
|
|
|
|
|
|
|
litest_keyboard_key(keyboard, KEY_A, true);
|
|
|
|
|
litest_keyboard_key(keyboard, KEY_A, false);
|
|
|
|
|
litest_assert_empty_queue(li);
|
|
|
|
|
|
2025-04-07 15:12:51 +10:00
|
|
|
litest_device_destroy(keyboard);
|
2018-10-09 11:07:02 +10:00
|
|
|
}
|
|
|
|
|
END_TEST
|
|
|
|
|
|
2017-09-20 14:40:59 +10:00
|
|
|
START_TEST(tablet_mode_disable_trackpoint)
|
|
|
|
|
{
|
|
|
|
|
struct litest_device *sw = litest_current_device();
|
|
|
|
|
struct litest_device *trackpoint;
|
|
|
|
|
struct libinput *li = sw->libinput;
|
|
|
|
|
|
|
|
|
|
if (!switch_has_tablet_mode(sw))
|
2024-10-12 10:31:42 +10:00
|
|
|
return LITEST_NOT_APPLICABLE;
|
2017-09-20 14:40:59 +10:00
|
|
|
|
|
|
|
|
trackpoint = litest_add_device(li, LITEST_TRACKPOINT);
|
|
|
|
|
litest_drain_events(li);
|
|
|
|
|
|
|
|
|
|
litest_event(trackpoint, EV_REL, REL_Y, -1);
|
|
|
|
|
litest_event(trackpoint, EV_SYN, SYN_REPORT, 0);
|
|
|
|
|
litest_event(trackpoint, EV_REL, REL_Y, -1);
|
|
|
|
|
litest_event(trackpoint, EV_SYN, SYN_REPORT, 0);
|
|
|
|
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
|
|
|
|
|
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_grab_device(sw);
|
2025-07-01 16:30:11 +10:00
|
|
|
litest_switch_action(sw, LIBINPUT_SWITCH_TABLET_MODE, LIBINPUT_SWITCH_STATE_ON);
|
2017-09-20 14:40:59 +10:00
|
|
|
litest_drain_events(li);
|
|
|
|
|
|
|
|
|
|
litest_event(trackpoint, EV_REL, REL_Y, -1);
|
|
|
|
|
litest_event(trackpoint, EV_SYN, SYN_REPORT, 0);
|
|
|
|
|
litest_event(trackpoint, EV_REL, REL_Y, -1);
|
|
|
|
|
litest_event(trackpoint, EV_SYN, SYN_REPORT, 0);
|
|
|
|
|
litest_assert_empty_queue(li);
|
|
|
|
|
|
|
|
|
|
litest_switch_action(sw,
|
|
|
|
|
LIBINPUT_SWITCH_TABLET_MODE,
|
|
|
|
|
LIBINPUT_SWITCH_STATE_OFF);
|
|
|
|
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_SWITCH_TOGGLE);
|
|
|
|
|
|
|
|
|
|
litest_event(trackpoint, EV_REL, REL_Y, -1);
|
|
|
|
|
litest_event(trackpoint, EV_SYN, SYN_REPORT, 0);
|
|
|
|
|
litest_event(trackpoint, EV_REL, REL_Y, -1);
|
|
|
|
|
litest_event(trackpoint, EV_SYN, SYN_REPORT, 0);
|
|
|
|
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_ungrab_device(sw);
|
2017-09-20 14:40:59 +10:00
|
|
|
|
2025-04-07 15:12:51 +10:00
|
|
|
litest_device_destroy(trackpoint);
|
2017-09-20 14:40:59 +10:00
|
|
|
}
|
|
|
|
|
END_TEST
|
2019-05-28 13:19:42 +10:00
|
|
|
|
2017-09-20 14:40:59 +10:00
|
|
|
START_TEST(tablet_mode_disable_trackpoint_on_init)
|
|
|
|
|
{
|
|
|
|
|
struct litest_device *sw = litest_current_device();
|
|
|
|
|
struct litest_device *trackpoint;
|
|
|
|
|
struct libinput *li = sw->libinput;
|
|
|
|
|
|
|
|
|
|
if (!switch_has_tablet_mode(sw))
|
2024-10-12 10:31:42 +10:00
|
|
|
return LITEST_NOT_APPLICABLE;
|
2017-09-20 14:40:59 +10:00
|
|
|
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_grab_device(sw);
|
2025-07-01 16:30:11 +10:00
|
|
|
litest_switch_action(sw, LIBINPUT_SWITCH_TABLET_MODE, LIBINPUT_SWITCH_STATE_ON);
|
2017-09-20 14:40:59 +10:00
|
|
|
litest_drain_events(li);
|
|
|
|
|
|
|
|
|
|
/* trackpoint comes with switch already on - no events */
|
|
|
|
|
trackpoint = litest_add_device(li, LITEST_TRACKPOINT);
|
|
|
|
|
litest_drain_events(li);
|
|
|
|
|
|
|
|
|
|
litest_event(trackpoint, EV_REL, REL_Y, -1);
|
|
|
|
|
litest_event(trackpoint, EV_SYN, SYN_REPORT, 0);
|
|
|
|
|
litest_event(trackpoint, EV_REL, REL_Y, -1);
|
|
|
|
|
litest_event(trackpoint, EV_SYN, SYN_REPORT, 0);
|
|
|
|
|
litest_assert_empty_queue(li);
|
|
|
|
|
|
|
|
|
|
litest_switch_action(sw,
|
|
|
|
|
LIBINPUT_SWITCH_TABLET_MODE,
|
|
|
|
|
LIBINPUT_SWITCH_STATE_OFF);
|
|
|
|
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_SWITCH_TOGGLE);
|
|
|
|
|
|
|
|
|
|
litest_event(trackpoint, EV_REL, REL_Y, -1);
|
|
|
|
|
litest_event(trackpoint, EV_SYN, SYN_REPORT, 0);
|
|
|
|
|
litest_event(trackpoint, EV_REL, REL_Y, -1);
|
|
|
|
|
litest_event(trackpoint, EV_SYN, SYN_REPORT, 0);
|
|
|
|
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_ungrab_device(sw);
|
2017-09-20 14:40:59 +10:00
|
|
|
|
2025-04-07 15:12:51 +10:00
|
|
|
litest_device_destroy(trackpoint);
|
2017-09-20 14:40:59 +10:00
|
|
|
}
|
|
|
|
|
END_TEST
|
|
|
|
|
|
2017-11-06 15:28:04 +10:00
|
|
|
START_TEST(dock_toggle)
|
|
|
|
|
{
|
|
|
|
|
struct litest_device *sw = litest_current_device();
|
|
|
|
|
struct libinput *li = sw->libinput;
|
|
|
|
|
|
|
|
|
|
if (!libevdev_has_event_code(sw->evdev, EV_SW, SW_DOCK))
|
2024-10-12 10:31:42 +10:00
|
|
|
return LITEST_NOT_APPLICABLE;
|
2017-11-06 15:28:04 +10:00
|
|
|
|
|
|
|
|
litest_drain_events(li);
|
|
|
|
|
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_grab_device(sw);
|
2017-11-06 15:28:04 +10:00
|
|
|
litest_event(sw, EV_SW, SW_DOCK, 1);
|
2024-09-13 15:13:38 +10:00
|
|
|
litest_dispatch(li);
|
2017-11-06 15:28:04 +10:00
|
|
|
|
|
|
|
|
litest_event(sw, EV_SW, SW_DOCK, 0);
|
2024-09-13 15:13:38 +10:00
|
|
|
litest_dispatch(li);
|
2020-07-03 12:46:38 +10:00
|
|
|
litest_ungrab_device(sw);
|
2017-11-06 15:28:04 +10:00
|
|
|
|
|
|
|
|
litest_assert_empty_queue(li);
|
|
|
|
|
}
|
|
|
|
|
END_TEST
|
2018-03-21 12:54:10 +10:00
|
|
|
|
|
|
|
|
TEST_COLLECTION(switch)
|
2017-01-20 16:54:16 +11:00
|
|
|
{
|
2025-07-01 11:30:59 +10:00
|
|
|
/* clang-format off */
|
2021-02-05 14:51:02 +10:00
|
|
|
litest_add(switch_has_cap, LITEST_SWITCH, LITEST_ANY);
|
|
|
|
|
litest_add(switch_has_lid_switch, LITEST_SWITCH, LITEST_ANY);
|
|
|
|
|
litest_add(switch_has_tablet_mode_switch, LITEST_SWITCH, LITEST_ANY);
|
|
|
|
|
litest_add(switch_not_down_on_init, LITEST_SWITCH, LITEST_ANY);
|
2025-01-08 09:13:47 +10:00
|
|
|
|
2025-02-13 22:10:02 +01:00
|
|
|
litest_with_parameters(params, "switch", 'I', 2, litest_named_i32(LIBINPUT_SWITCH_LID, "lid"),
|
|
|
|
|
litest_named_i32(LIBINPUT_SWITCH_TABLET_MODE, "tablet_mode")) {
|
2025-01-08 09:13:47 +10:00
|
|
|
litest_add_parametrized(switch_toggle, LITEST_SWITCH, LITEST_ANY, params);
|
|
|
|
|
litest_add_parametrized(switch_toggle_double, LITEST_SWITCH, LITEST_ANY, params);
|
|
|
|
|
litest_add_parametrized(switch_down_on_init, LITEST_SWITCH, LITEST_ANY, params);
|
|
|
|
|
litest_add_parametrized(switch_disable_touchpad, LITEST_SWITCH, LITEST_ANY, params);
|
|
|
|
|
litest_add_parametrized(switch_disable_touchpad_during_touch, LITEST_SWITCH, LITEST_ANY, params);
|
|
|
|
|
litest_add_parametrized(switch_disable_touchpad_edge_scroll, LITEST_SWITCH, LITEST_ANY, params);
|
|
|
|
|
litest_add_parametrized(switch_disable_touchpad_edge_scroll_interrupt, LITEST_SWITCH, LITEST_ANY, params);
|
|
|
|
|
litest_add_parametrized(switch_disable_touchpad_already_open, LITEST_SWITCH, LITEST_ANY, params);
|
|
|
|
|
litest_add_parametrized(switch_dont_resume_disabled_touchpad, LITEST_SWITCH, LITEST_ANY, params);
|
|
|
|
|
litest_add_parametrized(switch_dont_resume_disabled_touchpad_external_mouse, LITEST_SWITCH, LITEST_ANY, params);
|
|
|
|
|
|
|
|
|
|
litest_add_parametrized_no_device(switch_suspend_with_keyboard, params);
|
|
|
|
|
litest_add_parametrized_no_device(switch_suspend_with_touchpad, params);
|
|
|
|
|
}
|
2021-02-05 14:51:02 +10:00
|
|
|
|
|
|
|
|
litest_add(lid_open_on_key, LITEST_SWITCH, LITEST_ANY);
|
|
|
|
|
litest_add(lid_open_on_key_touchpad_enabled, LITEST_SWITCH, LITEST_ANY);
|
|
|
|
|
litest_add_for_device(lid_update_hw_on_key, LITEST_LID_SWITCH_SURFACE3);
|
|
|
|
|
litest_add_for_device(lid_update_hw_on_key_closed_on_init, LITEST_LID_SWITCH_SURFACE3);
|
|
|
|
|
litest_add_for_device(lid_update_hw_on_key_multiple_keyboards, LITEST_LID_SWITCH_SURFACE3);
|
|
|
|
|
litest_add_for_device(lid_key_press, LITEST_GPIO_KEYS);
|
|
|
|
|
|
|
|
|
|
litest_add(tablet_mode_disable_touchpad_on_init, LITEST_SWITCH, LITEST_ANY);
|
|
|
|
|
litest_add(tablet_mode_disable_touchpad_on_resume, LITEST_SWITCH, LITEST_ANY);
|
|
|
|
|
litest_add(tablet_mode_enable_touchpad_on_resume, LITEST_SWITCH, LITEST_ANY);
|
|
|
|
|
litest_add(tablet_mode_disable_keyboard, LITEST_SWITCH, LITEST_ANY);
|
|
|
|
|
litest_add(tablet_mode_disable_keyboard_on_init, LITEST_SWITCH, LITEST_ANY);
|
|
|
|
|
litest_add(tablet_mode_disable_keyboard_on_resume, LITEST_SWITCH, LITEST_ANY);
|
|
|
|
|
litest_add(tablet_mode_enable_keyboard_on_resume, LITEST_SWITCH, LITEST_ANY);
|
|
|
|
|
litest_add(tablet_mode_disable_trackpoint, LITEST_SWITCH, LITEST_ANY);
|
|
|
|
|
litest_add(tablet_mode_disable_trackpoint_on_init, LITEST_SWITCH, LITEST_ANY);
|
|
|
|
|
|
|
|
|
|
litest_add(dock_toggle, LITEST_SWITCH, LITEST_ANY);
|
2025-07-01 11:30:59 +10:00
|
|
|
/* clang-format on */
|
2017-01-20 16:54:16 +11:00
|
|
|
}
|