summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2016-06-15 19:36:56 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2016-06-20 09:17:38 +1000
commit9bb0cfd8785294a735407c862d7b59621a4ec98d (patch)
tree7d7da84c8e73b761f7d6be09a6ac18fbda93edaa /src
parent5f55d717744e37216d3c1ac5741e0f4d9154e2de (diff)
test: add an apple magicmouse device
This device has a touchpad on the mouse but it's labeled as mouse. For litest we only label it as LITEST_MOUSE feature and test the touchpad directly on the device. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/evdev.c7
-rw-r--r--src/evdev.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/evdev.c b/src/evdev.c
index e18492aa..335c2386 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1806,6 +1806,7 @@ evdev_read_model_flags(struct evdev_device *device)
MODEL(LENOVO_T450_TOUCHPAD),
MODEL(PRECISE_TOUCHPAD),
MODEL(TRACKBALL),
+ MODEL(APPLE_MAGICMOUSE),
{ NULL, EVDEV_MODEL_DEFAULT },
#undef MODEL
};
@@ -2424,6 +2425,12 @@ evdev_pre_configure_model_quirks(struct evdev_device *device)
libevdev_disable_event_code(device->evdev, EV_KEY, 0x119);
libevdev_disable_event_code(device->evdev, EV_KEY, 0x11a);
}
+ /* The Apple MagicMouse has a touchpad built-in but the kernel still
+ * emulates a full 2/3 button mouse for us. Ignore anything from the
+ * ABS interface
+ */
+ if (device->model_flags & EVDEV_MODEL_APPLE_MAGICMOUSE)
+ libevdev_disable_event_type(device->evdev, EV_ABS);
}
struct evdev_device *
diff --git a/src/evdev.h b/src/evdev.h
index 99e3b73c..d995985f 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -116,6 +116,7 @@ enum evdev_device_model {
EVDEV_MODEL_LENOVO_T450_TOUCHPAD= (1 << 17),
EVDEV_MODEL_PRECISE_TOUCHPAD = (1 << 18),
EVDEV_MODEL_TRACKBALL = (1 << 19),
+ EVDEV_MODEL_APPLE_MAGICMOUSE = (1 << 20),
};
struct mt_slot {