mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-03 13:30:27 +01:00
touchpad/clickfinger: limit middle click to 3 fingers
Don't middle click on clickpads with click method clickfinger when more than 3 fingers are used. Signed-off-by: José Expósito <jose.exposito89@gmail.com>
This commit is contained in:
parent
74f6821d7a
commit
c71a1f4347
2 changed files with 2 additions and 40 deletions
|
|
@ -1141,8 +1141,9 @@ out:
|
|||
case 0:
|
||||
case 1: button = BTN_LEFT; break;
|
||||
case 2: button = BTN_RIGHT; break;
|
||||
case 3: button = BTN_MIDDLE; break;
|
||||
default:
|
||||
button = BTN_MIDDLE; break;
|
||||
button = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -291,7 +291,6 @@ START_TEST(touchpad_4fg_clickfinger)
|
|||
{
|
||||
struct litest_device *dev = litest_current_device();
|
||||
struct libinput *li = dev->libinput;
|
||||
struct libinput_event *event;
|
||||
|
||||
if (litest_slot_count(dev) < 4)
|
||||
return;
|
||||
|
|
@ -315,18 +314,6 @@ START_TEST(touchpad_4fg_clickfinger)
|
|||
|
||||
libinput_dispatch(li);
|
||||
|
||||
litest_wait_for_event(li);
|
||||
event = libinput_get_event(li);
|
||||
litest_is_button_event(event,
|
||||
BTN_MIDDLE,
|
||||
LIBINPUT_BUTTON_STATE_PRESSED);
|
||||
libinput_event_destroy(event);
|
||||
event = libinput_get_event(li);
|
||||
litest_is_button_event(event,
|
||||
BTN_MIDDLE,
|
||||
LIBINPUT_BUTTON_STATE_RELEASED);
|
||||
libinput_event_destroy(event);
|
||||
|
||||
litest_assert_empty_queue(li);
|
||||
}
|
||||
END_TEST
|
||||
|
|
@ -335,7 +322,6 @@ START_TEST(touchpad_4fg_clickfinger_btntool_2slots)
|
|||
{
|
||||
struct litest_device *dev = litest_current_device();
|
||||
struct libinput *li = dev->libinput;
|
||||
struct libinput_event *event;
|
||||
|
||||
if (litest_slot_count(dev) >= 3 ||
|
||||
!libevdev_has_event_code(dev->evdev, EV_KEY, BTN_TOOL_QUADTAP))
|
||||
|
|
@ -360,18 +346,6 @@ START_TEST(touchpad_4fg_clickfinger_btntool_2slots)
|
|||
litest_touch_up(dev, 0);
|
||||
litest_touch_up(dev, 1);
|
||||
|
||||
litest_wait_for_event(li);
|
||||
event = libinput_get_event(li);
|
||||
litest_is_button_event(event,
|
||||
BTN_MIDDLE,
|
||||
LIBINPUT_BUTTON_STATE_PRESSED);
|
||||
libinput_event_destroy(event);
|
||||
event = libinput_get_event(li);
|
||||
litest_is_button_event(event,
|
||||
BTN_MIDDLE,
|
||||
LIBINPUT_BUTTON_STATE_RELEASED);
|
||||
libinput_event_destroy(event);
|
||||
|
||||
litest_assert_empty_queue(li);
|
||||
}
|
||||
END_TEST
|
||||
|
|
@ -380,7 +354,6 @@ START_TEST(touchpad_4fg_clickfinger_btntool_3slots)
|
|||
{
|
||||
struct litest_device *dev = litest_current_device();
|
||||
struct libinput *li = dev->libinput;
|
||||
struct libinput_event *event;
|
||||
|
||||
if (litest_slot_count(dev) != 3 ||
|
||||
!libevdev_has_event_code(dev->evdev, EV_KEY, BTN_TOOL_TRIPLETAP))
|
||||
|
|
@ -409,18 +382,6 @@ START_TEST(touchpad_4fg_clickfinger_btntool_3slots)
|
|||
|
||||
libinput_dispatch(li);
|
||||
|
||||
litest_wait_for_event(li);
|
||||
event = libinput_get_event(li);
|
||||
litest_is_button_event(event,
|
||||
BTN_MIDDLE,
|
||||
LIBINPUT_BUTTON_STATE_PRESSED);
|
||||
libinput_event_destroy(event);
|
||||
event = libinput_get_event(li);
|
||||
litest_is_button_event(event,
|
||||
BTN_MIDDLE,
|
||||
LIBINPUT_BUTTON_STATE_RELEASED);
|
||||
libinput_event_destroy(event);
|
||||
|
||||
litest_assert_empty_queue(li);
|
||||
}
|
||||
END_TEST
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue