touchpad: Handle two-finger click as right click for button pads

dev
Kristian Høgsberg 12 years ago
parent 382ff46ffb
commit 3bdaa3e249
  1. 10
      src/evdev-touchpad.c

@ -571,6 +571,8 @@ process_key(struct touchpad_dispatch *touchpad,
struct input_event *e, struct input_event *e,
uint32_t time) uint32_t time)
{ {
uint32_t code;
switch (e->code) { switch (e->code) {
case BTN_TOUCH: case BTN_TOUCH:
if (!touchpad->has_pressure) { if (!touchpad->has_pressure) {
@ -588,8 +590,12 @@ process_key(struct touchpad_dispatch *touchpad,
case BTN_FORWARD: case BTN_FORWARD:
case BTN_BACK: case BTN_BACK:
case BTN_TASK: case BTN_TASK:
notify_button(device->seat, if (!touchpad->fsm.enable && e->code == BTN_LEFT &&
time, e->code, 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 : e->value ? WL_POINTER_BUTTON_STATE_PRESSED :
WL_POINTER_BUTTON_STATE_RELEASED); WL_POINTER_BUTTON_STATE_RELEASED);
break; break;

Loading…
Cancel
Save