[clutter/wip/evdev-tablet-support: 4/6] evdev: Add axes managed by libinput



commit fea0232ccbf40bbcfba65e1a58764281482a9ec6
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Jan 9 17:14:05 2015 +0100

    evdev: Add axes managed by libinput

 clutter/evdev/clutter-input-device-evdev.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/clutter/evdev/clutter-input-device-evdev.c b/clutter/evdev/clutter-input-device-evdev.c
index 9865388..2895809 100644
--- a/clutter/evdev/clutter-input-device-evdev.c
+++ b/clutter/evdev/clutter-input-device-evdev.c
@@ -123,6 +123,19 @@ _clutter_input_device_evdev_new (ClutterDeviceManager *manager,
                          "product-id", product,
                          NULL);
 
+  if (type == CLUTTER_TABLET_DEVICE)
+    {
+      ClutterInputDevice *dev = CLUTTER_INPUT_DEVICE (device);
+
+      /* Add axes, matching libinput_tablet_axis order */
+      _clutter_input_device_add_axis (dev, CLUTTER_INPUT_AXIS_X, 0, 0, 0);
+      _clutter_input_device_add_axis (dev, CLUTTER_INPUT_AXIS_Y, 0, 0, 0);
+      _clutter_input_device_add_axis (dev, CLUTTER_INPUT_AXIS_DISTANCE, 0, 0, 0);
+      _clutter_input_device_add_axis (dev, CLUTTER_INPUT_AXIS_PRESSURE, 0, 0, 0);
+      _clutter_input_device_add_axis (dev, CLUTTER_INPUT_AXIS_XTILT, 0, 0, 0);
+      _clutter_input_device_add_axis (dev, CLUTTER_INPUT_AXIS_YTILT, 0, 0, 0);
+    }
+
   device->seat = seat;
   device->libinput_device = libinput_device;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]