summaryrefslogtreecommitdiff
path: root/src/evdev.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2019-05-28 09:54:27 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2019-05-28 13:23:49 +1000
commit8dfe8c68eb9bde9eecc7de5665903d258df42272 (patch)
tree255a6ad0dd2ec2de9d14284fc7beb6618c694788 /src/evdev.c
parent3dc27d5d38aa79ec49c438a35cedf4a8e07d3124 (diff)
downloadlibinput-8dfe8c68eb9bde9eecc7de5665903d258df42272.tar.gz
quirks: add trackpoint integration attribute
Some versions [1] of the Lenovo ThinkPad Compact USB Keyboard with TrackPoint USB have the pointing stick on an event node that has keys but is not a regular keyboard. Thus the stick falls through the cracks and gets disabled on tablet mode switch. Instead of adding more hacks let's do this properly: tag the pointing stick as external and have the code in place to deal with that. [1] This may be caused by recent kernel changes Fixes #291 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/evdev.c')
-rw-r--r--src/evdev.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/src/evdev.c b/src/evdev.c
index 3b0cfaeb..5c080590 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -387,10 +387,34 @@ static void
evdev_tag_trackpoint(struct evdev_device *device,
struct udev_device *udev_device)
{
- if (libevdev_has_property(device->evdev,
- INPUT_PROP_POINTING_STICK) ||
- parse_udev_flag(device, udev_device, "ID_INPUT_POINTINGSTICK"))
- device->tags |= EVDEV_TAG_TRACKPOINT;
+ struct quirks_context *quirks;
+ struct quirks *q;
+ char *prop;
+
+ if (!libevdev_has_property(device->evdev,
+ INPUT_PROP_POINTING_STICK) &&
+ !parse_udev_flag(device, udev_device, "ID_INPUT_POINTINGSTICK"))
+ return;
+
+ device->tags |= EVDEV_TAG_TRACKPOINT;
+
+ quirks = evdev_libinput_context(device)->quirks;
+ q = quirks_fetch_for_device(quirks, device->udev_device);
+ if (q && quirks_get_string(q, QUIRK_ATTR_TRACKPOINT_INTEGRATION, &prop)) {
+ if (streq(prop, "internal")) {
+ /* noop, this is the default anyway */
+ } else if (streq(prop, "external")) {
+ device->tags |= EVDEV_TAG_EXTERNAL_MOUSE;
+ evdev_log_info(device,
+ "is an external pointing stick\n");
+ } else {
+ evdev_log_info(device,
+ "tagged with unknown value %s\n",
+ prop);
+ }
+ }
+
+ quirks_unref(q);
}
static inline void