The top soft buttons are intended for use with a trackpoint, and to e.g.
make middle button scrolling work correctly, we must post the events for
these "buttons" through the trackpoint device.
This commit is a preparation patch for this, it adds a link to the
trackpoint to the touchpad, but does not yet do anything with it.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
{
struct tp_dispatch *tp = (struct tp_dispatch*)device->dispatch;
+ if (tp->buttons.trackpoint == NULL &&
+ (added_device->tags & EVDEV_TAG_TRACKPOINT))
+ tp->buttons.trackpoint = added_device;
+
if (tp->sendevents.current_mode !=
LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE)
return;
struct tp_dispatch *tp = (struct tp_dispatch*)device->dispatch;
struct libinput_device *dev;
+ if (removed_device == tp->buttons.trackpoint)
+ tp->buttons.trackpoint = NULL;
+
if (tp->sendevents.current_mode !=
LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE)
return;
int32_t rightbutton_left_edge;
int32_t leftbutton_right_edge;
} top_area;
+
+ struct evdev_device *trackpoint;
} buttons; /* physical buttons */
enum touchpad_event queued;
}
static void
+evdev_tag_trackpoint(struct evdev_device *device,
+ struct udev_device *udev_device)
+{
+ if (libevdev_has_property(device->evdev, INPUT_PROP_POINTING_STICK))
+ device->tags |= EVDEV_TAG_TRACKPOINT;
+}
+
+static void
fallback_process(struct evdev_dispatch *dispatch,
struct evdev_device *device,
struct input_event *event,
struct udev_device *udev_device)
{
evdev_tag_external_mouse(device, udev_device);
+ evdev_tag_trackpoint(device, udev_device);
}
static int
enum evdev_device_tags {
EVDEV_TAG_EXTERNAL_MOUSE = (1 << 0),
EVDEV_TAG_INTERNAL_TOUCHPAD = (1 << 1),
+ EVDEV_TAG_TRACKPOINT = (1 << 2),
};
struct mt_slot {