Allow initial device configuration after receiving DEVICE_ADDED event
authorJonas Ådahl <jadahl@gmail.com>
Sat, 25 Jan 2014 10:46:55 +0000 (11:46 +0100)
committerJonas Ådahl <jadahl@gmail.com>
Sat, 25 Jan 2014 10:46:55 +0000 (11:46 +0100)
By specifying that a device will not be read until the next time the
user calls libinput_dispatch(), if data is available, it will allow for
setting up initial configuration, such as tap button, output screen
size, acceleration parameters, etc.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
src/libinput.h

index 2419468f6e8f6694c2e2aa7931db5b75b126ad02..af1614e94bd1afc0e4c7a9d160baeb99f0c8dd93 100644 (file)
@@ -120,7 +120,21 @@ enum libinput_touch_type {
  */
 enum libinput_event_type {
        LIBINPUT_EVENT_NONE = 0,
+
+       /**
+        * Signals that a device has been added to the context. The device will
+        * not be read until the next time the user calls libinput_dispatch()
+        * and data is available.
+        *
+        * This allows setting up initial device configuration before any events
+        * are created.
+        */
        LIBINPUT_EVENT_DEVICE_ADDED,
+
+       /**
+        * Signals that a device has been removed. No more events from the
+        * associated device will be in the queue or be queued after this event.
+        */
        LIBINPUT_EVENT_DEVICE_REMOVED,
 
        LIBINPUT_EVENT_KEYBOARD_KEY = 300,