Hi, On 09/23/2014 08:09 AM, Peter Hutterer wrote: > Tapping and clickfinger is unaffected, physical and software buttons are > swapped. The main area of a clickpad remains as left button though. > > Signed-off-by: Peter Hutterer <[email protected]> > --- > src/evdev-mt-touchpad-buttons.c | 17 ++++++++++++----- > src/evdev-mt-touchpad.c | 19 +++++++++++++++++++ > 2 files changed, 31 insertions(+), 5 deletions(-) > > diff --git a/src/evdev-mt-touchpad-buttons.c b/src/evdev-mt-touchpad-buttons.c > index 21417ab..d571a23 100644 > --- a/src/evdev-mt-touchpad-buttons.c > +++ b/src/evdev-mt-touchpad-buttons.c > @@ -661,14 +661,17 @@ tp_post_physical_buttons(struct tp_dispatch *tp, > uint64_t time) > enum libinput_button_state state; > > if ((current & 0x1) ^ (old & 0x1)) { > + uint32_t b; > + > if (!!(current & 0x1)) > state = LIBINPUT_BUTTON_STATE_PRESSED; > else > state = LIBINPUT_BUTTON_STATE_RELEASED; > > + b = evdev_to_left_handed(tp->device, button); > evdev_pointer_notify_button(tp->device, > time, > - button, > + b, > state); > } > > @@ -758,10 +761,12 @@ tp_post_softbutton_buttons(struct tp_dispatch *tp, > uint64_t time) > } > > if ((button & MIDDLE) || ((button & LEFT) && (button & RIGHT))) > - button = BTN_MIDDLE; > + button = evdev_to_left_handed(tp->device, BTN_MIDDLE); > else if (button & RIGHT) > - button = BTN_RIGHT; > - else > + button = evdev_to_left_handed(tp->device, BTN_RIGHT); > + else if (button & LEFT) > + button = evdev_to_left_handed(tp->device, BTN_LEFT); > + else /* main area is always BTN_LEFT */ > button = BTN_LEFT; > > tp->buttons.active = button; > @@ -778,7 +783,9 @@ tp_post_softbutton_buttons(struct tp_dispatch *tp, > uint64_t time) > tp->buttons.click_pending = false; > > if (button) > - tp_notify_softbutton(tp, time, button, is_top, state); > + tp_notify_softbutton(tp, time, > + button, > + is_top, state); > > return 1; > }
Please drop this unrelated reformatting hunk, other then that the entire patch-set looks good and is: Reviewed-by: Hans de Goede <[email protected]> Regards, Hans > diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c > index 56f46ec..a8d12e4 100644 > --- a/src/evdev-mt-touchpad.c > +++ b/src/evdev-mt-touchpad.c > @@ -1056,6 +1056,23 @@ tp_sendevents_get_default_mode(struct libinput_device > *device) > return LIBINPUT_CONFIG_SEND_EVENTS_ENABLED; > } > > +static void > +tp_change_to_left_handed(struct evdev_device *device) > +{ > + struct tp_dispatch *tp = (struct tp_dispatch *)device->dispatch; > + > + if (device->buttons.want_left_handed == device->buttons.left_handed) > + return; > + > + if (tp->buttons.state & 0x3) /* BTN_LEFT|BTN_RIGHT */ > + return; > + > + /* tapping and clickfinger aren't affected by left-handed config, > + * so checking physical buttons is enough */ > + > + device->buttons.left_handed = device->buttons.want_left_handed; > +} > + > struct evdev_dispatch * > evdev_mt_touchpad_create(struct evdev_device *device) > { > @@ -1078,5 +1095,7 @@ evdev_mt_touchpad_create(struct evdev_device *device) > tp->sendevents.config.get_mode = tp_sendevents_get_mode; > tp->sendevents.config.get_default_mode = tp_sendevents_get_default_mode; > > + evdev_init_left_handed(device, tp_change_to_left_handed); > + > return &tp->base; > } > _______________________________________________ wayland-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/wayland-devel
