mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-04-20 06:00:51 +02:00
touchpad: Handle two-finger click as right click for button pads
This commit is contained in:
parent
17ea8f9e50
commit
57334b7088
1 changed files with 8 additions and 2 deletions
|
|
@ -571,6 +571,8 @@ process_key(struct touchpad_dispatch *touchpad,
|
|||
struct input_event *e,
|
||||
uint32_t time)
|
||||
{
|
||||
uint32_t code;
|
||||
|
||||
switch (e->code) {
|
||||
case BTN_TOUCH:
|
||||
if (!touchpad->has_pressure) {
|
||||
|
|
@ -588,8 +590,12 @@ process_key(struct touchpad_dispatch *touchpad,
|
|||
case BTN_FORWARD:
|
||||
case BTN_BACK:
|
||||
case BTN_TASK:
|
||||
notify_button(device->seat,
|
||||
time, e->code,
|
||||
if (!touchpad->fsm.enable && e->code == BTN_LEFT &&
|
||||
touchpad->finger_state == TOUCHPAD_FINGERS_TWO)
|
||||
code = BTN_RIGHT;
|
||||
else
|
||||
code = e->code;
|
||||
notify_button(device->seat, time, code,
|
||||
e->value ? WL_POINTER_BUTTON_STATE_PRESSED :
|
||||
WL_POINTER_BUTTON_STATE_RELEASED);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue