1a46c0ec8Sopenharmony_ci/* 2a46c0ec8Sopenharmony_ci * Copyright © 2013 Jonas Ådahl 3a46c0ec8Sopenharmony_ci * Copyright © 2013-2015 Red Hat, Inc. 4a46c0ec8Sopenharmony_ci * 5a46c0ec8Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a 6a46c0ec8Sopenharmony_ci * copy of this software and associated documentation files (the "Software"), 7a46c0ec8Sopenharmony_ci * to deal in the Software without restriction, including without limitation 8a46c0ec8Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9a46c0ec8Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the 10a46c0ec8Sopenharmony_ci * Software is furnished to do so, subject to the following conditions: 11a46c0ec8Sopenharmony_ci * 12a46c0ec8Sopenharmony_ci * The above copyright notice and this permission notice (including the next 13a46c0ec8Sopenharmony_ci * paragraph) shall be included in all copies or substantial portions of the 14a46c0ec8Sopenharmony_ci * Software. 15a46c0ec8Sopenharmony_ci * 16a46c0ec8Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17a46c0ec8Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18a46c0ec8Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 19a46c0ec8Sopenharmony_ci * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20a46c0ec8Sopenharmony_ci * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21a46c0ec8Sopenharmony_ci * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22a46c0ec8Sopenharmony_ci * DEALINGS IN THE SOFTWARE. 23a46c0ec8Sopenharmony_ci */ 24a46c0ec8Sopenharmony_ci 25a46c0ec8Sopenharmony_ci#ifndef LIBINPUT_H 26a46c0ec8Sopenharmony_ci#define LIBINPUT_H 27a46c0ec8Sopenharmony_ci 28a46c0ec8Sopenharmony_ci#ifdef __cplusplus 29a46c0ec8Sopenharmony_ciextern "C" { 30a46c0ec8Sopenharmony_ci#endif 31a46c0ec8Sopenharmony_ci 32a46c0ec8Sopenharmony_ci#include <stdlib.h> 33a46c0ec8Sopenharmony_ci#include <stdint.h> 34a46c0ec8Sopenharmony_ci#include <stdarg.h> 35a46c0ec8Sopenharmony_ci#include <libudev.h> 36a46c0ec8Sopenharmony_ci 37a46c0ec8Sopenharmony_ci#define LIBINPUT_ATTRIBUTE_PRINTF(_format, _args) \ 38a46c0ec8Sopenharmony_ci __attribute__ ((format (printf, _format, _args))) 39a46c0ec8Sopenharmony_ci#define LIBINPUT_ATTRIBUTE_DEPRECATED __attribute__ ((deprecated)) 40a46c0ec8Sopenharmony_ci 41a46c0ec8Sopenharmony_ci/** 42a46c0ec8Sopenharmony_ci * @ingroup base 43a46c0ec8Sopenharmony_ci * @struct libinput 44a46c0ec8Sopenharmony_ci * 45a46c0ec8Sopenharmony_ci * A handle for accessing libinput. This struct is refcounted, use 46a46c0ec8Sopenharmony_ci * libinput_ref() and libinput_unref(). 47a46c0ec8Sopenharmony_ci */ 48a46c0ec8Sopenharmony_cistruct libinput; 49a46c0ec8Sopenharmony_ci 50a46c0ec8Sopenharmony_ci/** 51a46c0ec8Sopenharmony_ci * @ingroup device 52a46c0ec8Sopenharmony_ci * @struct libinput_device 53a46c0ec8Sopenharmony_ci * 54a46c0ec8Sopenharmony_ci * A base handle for accessing libinput devices. This struct is 55a46c0ec8Sopenharmony_ci * refcounted, use libinput_device_ref() and libinput_device_unref(). 56a46c0ec8Sopenharmony_ci */ 57a46c0ec8Sopenharmony_cistruct libinput_device; 58a46c0ec8Sopenharmony_ci 59a46c0ec8Sopenharmony_ci/** 60a46c0ec8Sopenharmony_ci * @ingroup device 61a46c0ec8Sopenharmony_ci * @struct libinput_device_group 62a46c0ec8Sopenharmony_ci * 63a46c0ec8Sopenharmony_ci * A base handle for accessing libinput device groups. This struct is 64a46c0ec8Sopenharmony_ci * refcounted, use libinput_device_group_ref() and 65a46c0ec8Sopenharmony_ci * libinput_device_group_unref(). 66a46c0ec8Sopenharmony_ci */ 67a46c0ec8Sopenharmony_cistruct libinput_device_group; 68a46c0ec8Sopenharmony_ci 69a46c0ec8Sopenharmony_ci/** 70a46c0ec8Sopenharmony_ci * @ingroup seat 71a46c0ec8Sopenharmony_ci * @struct libinput_seat 72a46c0ec8Sopenharmony_ci * 73a46c0ec8Sopenharmony_ci * The base handle for accessing libinput seats. This struct is 74a46c0ec8Sopenharmony_ci * refcounted, use libinput_seat_ref() and libinput_seat_unref(). 75a46c0ec8Sopenharmony_ci */ 76a46c0ec8Sopenharmony_cistruct libinput_seat; 77a46c0ec8Sopenharmony_ci 78a46c0ec8Sopenharmony_ci/** 79a46c0ec8Sopenharmony_ci * @ingroup device 80a46c0ec8Sopenharmony_ci * @struct libinput_tablet_tool 81a46c0ec8Sopenharmony_ci * 82a46c0ec8Sopenharmony_ci * An object representing a tool being used by a device with the @ref 83a46c0ec8Sopenharmony_ci * LIBINPUT_DEVICE_CAP_TABLET_TOOL capability. 84a46c0ec8Sopenharmony_ci * 85a46c0ec8Sopenharmony_ci * Tablet events generated by such a device are bound to a specific tool 86a46c0ec8Sopenharmony_ci * rather than coming from the device directly. Depending on the hardware it 87a46c0ec8Sopenharmony_ci * is possible to track the same physical tool across multiple 88a46c0ec8Sopenharmony_ci * struct libinput_device devices. 89a46c0ec8Sopenharmony_ci * See libinput_tablet_tool_get_serial() for more details. 90a46c0ec8Sopenharmony_ci * 91a46c0ec8Sopenharmony_ci * This struct is refcounted, use libinput_tablet_tool_ref() and 92a46c0ec8Sopenharmony_ci * libinput_tablet_tool_unref(). 93a46c0ec8Sopenharmony_ci * 94a46c0ec8Sopenharmony_ci * @since 1.2 95a46c0ec8Sopenharmony_ci */ 96a46c0ec8Sopenharmony_cistruct libinput_tablet_tool; 97a46c0ec8Sopenharmony_ci 98a46c0ec8Sopenharmony_ci/** 99a46c0ec8Sopenharmony_ci * @ingroup event 100a46c0ec8Sopenharmony_ci * @struct libinput_event 101a46c0ec8Sopenharmony_ci * 102a46c0ec8Sopenharmony_ci * The base event type. Use libinput_event_get_pointer_event() or similar to 103a46c0ec8Sopenharmony_ci * get the actual event type. 104a46c0ec8Sopenharmony_ci * 105a46c0ec8Sopenharmony_ci * @warning Unlike other structs events are considered transient and 106a46c0ec8Sopenharmony_ci * <b>not</b> refcounted. 107a46c0ec8Sopenharmony_ci */ 108a46c0ec8Sopenharmony_cistruct libinput_event; 109a46c0ec8Sopenharmony_ci 110a46c0ec8Sopenharmony_ci/** 111a46c0ec8Sopenharmony_ci * @ingroup event 112a46c0ec8Sopenharmony_ci * @struct libinput_event_device_notify 113a46c0ec8Sopenharmony_ci * 114a46c0ec8Sopenharmony_ci * An event notifying the caller of a device being added or removed. 115a46c0ec8Sopenharmony_ci */ 116a46c0ec8Sopenharmony_cistruct libinput_event_device_notify; 117a46c0ec8Sopenharmony_ci 118a46c0ec8Sopenharmony_ci/** 119a46c0ec8Sopenharmony_ci * @ingroup event_keyboard 120a46c0ec8Sopenharmony_ci * @struct libinput_event_keyboard 121a46c0ec8Sopenharmony_ci * 122a46c0ec8Sopenharmony_ci * A keyboard event representing a key press/release. 123a46c0ec8Sopenharmony_ci */ 124a46c0ec8Sopenharmony_cistruct libinput_event_keyboard; 125a46c0ec8Sopenharmony_ci 126a46c0ec8Sopenharmony_ci/** 127a46c0ec8Sopenharmony_ci * @ingroup event_pointer 128a46c0ec8Sopenharmony_ci * @struct libinput_event_pointer 129a46c0ec8Sopenharmony_ci * 130a46c0ec8Sopenharmony_ci * A pointer event representing relative or absolute pointer movement, 131a46c0ec8Sopenharmony_ci * a button press/release or scroll axis events. 132a46c0ec8Sopenharmony_ci */ 133a46c0ec8Sopenharmony_cistruct libinput_event_pointer; 134a46c0ec8Sopenharmony_ci 135a46c0ec8Sopenharmony_ci/** 136a46c0ec8Sopenharmony_ci * @ingroup event_touch 137a46c0ec8Sopenharmony_ci * @struct libinput_event_touch 138a46c0ec8Sopenharmony_ci * 139a46c0ec8Sopenharmony_ci * Touch event representing a touch down, move or up, as well as a touch 140a46c0ec8Sopenharmony_ci * cancel and touch frame events. Valid event types for this event are @ref 141a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TOUCH_DOWN, @ref LIBINPUT_EVENT_TOUCH_MOTION, @ref 142a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TOUCH_UP, @ref LIBINPUT_EVENT_TOUCH_CANCEL and @ref 143a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TOUCH_FRAME. 144a46c0ec8Sopenharmony_ci */ 145a46c0ec8Sopenharmony_cistruct libinput_event_touch; 146a46c0ec8Sopenharmony_ci 147a46c0ec8Sopenharmony_ci/** 148a46c0ec8Sopenharmony_ci * @ingroup event_tablet 149a46c0ec8Sopenharmony_ci * @struct libinput_event_tablet_tool 150a46c0ec8Sopenharmony_ci * 151a46c0ec8Sopenharmony_ci * Tablet tool event representing an axis update, button press, or tool 152a46c0ec8Sopenharmony_ci * update. Valid event types for this event are @ref 153a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_AXIS, @ref 154a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY and @ref 155a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_BUTTON. 156a46c0ec8Sopenharmony_ci * 157a46c0ec8Sopenharmony_ci * @since 1.2 158a46c0ec8Sopenharmony_ci */ 159a46c0ec8Sopenharmony_cistruct libinput_event_tablet_tool; 160a46c0ec8Sopenharmony_ci 161a46c0ec8Sopenharmony_ci/** 162a46c0ec8Sopenharmony_ci * @ingroup event_tablet_pad 163a46c0ec8Sopenharmony_ci * @struct libinput_event_tablet_pad 164a46c0ec8Sopenharmony_ci * 165a46c0ec8Sopenharmony_ci * Tablet pad event representing a button press, or ring/strip update on 166a46c0ec8Sopenharmony_ci * the tablet pad itself. Valid event types for this event are @ref 167a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_PAD_BUTTON, @ref LIBINPUT_EVENT_TABLET_PAD_RING and 168a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_PAD_STRIP. 169a46c0ec8Sopenharmony_ci * 170a46c0ec8Sopenharmony_ci * @since 1.3 171a46c0ec8Sopenharmony_ci */ 172a46c0ec8Sopenharmony_cistruct libinput_event_tablet_pad; 173a46c0ec8Sopenharmony_ci 174a46c0ec8Sopenharmony_ci/** 175a46c0ec8Sopenharmony_ci * @ingroup base 176a46c0ec8Sopenharmony_ci * 177a46c0ec8Sopenharmony_ci * Log priority for internal logging messages. 178a46c0ec8Sopenharmony_ci */ 179a46c0ec8Sopenharmony_cienum libinput_log_priority { 180a46c0ec8Sopenharmony_ci LIBINPUT_LOG_PRIORITY_DEBUG = 10, 181a46c0ec8Sopenharmony_ci LIBINPUT_LOG_PRIORITY_INFO = 20, 182a46c0ec8Sopenharmony_ci LIBINPUT_LOG_PRIORITY_ERROR = 30, 183a46c0ec8Sopenharmony_ci}; 184a46c0ec8Sopenharmony_ci 185a46c0ec8Sopenharmony_ci/** 186a46c0ec8Sopenharmony_ci * @ingroup device 187a46c0ec8Sopenharmony_ci * 188a46c0ec8Sopenharmony_ci * Capabilities on a device. A device may have one or more capabilities 189a46c0ec8Sopenharmony_ci * at a time, capabilities remain static for the lifetime of the device. 190a46c0ec8Sopenharmony_ci */ 191a46c0ec8Sopenharmony_cienum libinput_device_capability { 192a46c0ec8Sopenharmony_ci LIBINPUT_DEVICE_CAP_KEYBOARD = 0, 193a46c0ec8Sopenharmony_ci LIBINPUT_DEVICE_CAP_POINTER = 1, 194a46c0ec8Sopenharmony_ci LIBINPUT_DEVICE_CAP_TOUCH = 2, 195a46c0ec8Sopenharmony_ci LIBINPUT_DEVICE_CAP_TABLET_TOOL = 3, 196a46c0ec8Sopenharmony_ci LIBINPUT_DEVICE_CAP_TABLET_PAD = 4, 197a46c0ec8Sopenharmony_ci LIBINPUT_DEVICE_CAP_GESTURE = 5, 198a46c0ec8Sopenharmony_ci LIBINPUT_DEVICE_CAP_SWITCH = 6, 199a46c0ec8Sopenharmony_ci}; 200a46c0ec8Sopenharmony_ci 201a46c0ec8Sopenharmony_ci/** 202a46c0ec8Sopenharmony_ci * @ingroup device 203a46c0ec8Sopenharmony_ci * 204a46c0ec8Sopenharmony_ci * Logical state of a key. Note that the logical state may not represent 205a46c0ec8Sopenharmony_ci * the physical state of the key. 206a46c0ec8Sopenharmony_ci */ 207a46c0ec8Sopenharmony_cienum libinput_key_state { 208a46c0ec8Sopenharmony_ci LIBINPUT_KEY_STATE_RELEASED = 0, 209a46c0ec8Sopenharmony_ci LIBINPUT_KEY_STATE_PRESSED = 1 210a46c0ec8Sopenharmony_ci}; 211a46c0ec8Sopenharmony_ci 212a46c0ec8Sopenharmony_ci/** 213a46c0ec8Sopenharmony_ci * @ingroup device 214a46c0ec8Sopenharmony_ci * 215a46c0ec8Sopenharmony_ci * Mask reflecting LEDs on a device. 216a46c0ec8Sopenharmony_ci */ 217a46c0ec8Sopenharmony_cienum libinput_led { 218a46c0ec8Sopenharmony_ci LIBINPUT_LED_NUM_LOCK = (1 << 0), 219a46c0ec8Sopenharmony_ci LIBINPUT_LED_CAPS_LOCK = (1 << 1), 220a46c0ec8Sopenharmony_ci LIBINPUT_LED_SCROLL_LOCK = (1 << 2) 221a46c0ec8Sopenharmony_ci}; 222a46c0ec8Sopenharmony_ci 223a46c0ec8Sopenharmony_ci/** 224a46c0ec8Sopenharmony_ci * @ingroup device 225a46c0ec8Sopenharmony_ci * 226a46c0ec8Sopenharmony_ci * Logical state of a physical button. Note that the logical state may not 227a46c0ec8Sopenharmony_ci * represent the physical state of the button. 228a46c0ec8Sopenharmony_ci */ 229a46c0ec8Sopenharmony_cienum libinput_button_state { 230a46c0ec8Sopenharmony_ci LIBINPUT_BUTTON_STATE_RELEASED = 0, 231a46c0ec8Sopenharmony_ci LIBINPUT_BUTTON_STATE_PRESSED = 1 232a46c0ec8Sopenharmony_ci}; 233a46c0ec8Sopenharmony_ci 234a46c0ec8Sopenharmony_ci/** 235a46c0ec8Sopenharmony_ci * @ingroup device 236a46c0ec8Sopenharmony_ci * 237a46c0ec8Sopenharmony_ci * Axes on a device with the capability @ref LIBINPUT_DEVICE_CAP_POINTER 238a46c0ec8Sopenharmony_ci * that are not x or y coordinates. 239a46c0ec8Sopenharmony_ci * 240a46c0ec8Sopenharmony_ci * The two scroll axes @ref LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL and 241a46c0ec8Sopenharmony_ci * @ref LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL are engaged separately, 242a46c0ec8Sopenharmony_ci * depending on the device. libinput provides some scroll direction locking 243a46c0ec8Sopenharmony_ci * but it is up to the caller to determine which axis is needed and 244a46c0ec8Sopenharmony_ci * appropriate in the current interaction 245a46c0ec8Sopenharmony_ci */ 246a46c0ec8Sopenharmony_cienum libinput_pointer_axis { 247a46c0ec8Sopenharmony_ci LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL = 0, 248a46c0ec8Sopenharmony_ci LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL = 1, 249a46c0ec8Sopenharmony_ci}; 250a46c0ec8Sopenharmony_ci 251a46c0ec8Sopenharmony_ci/** 252a46c0ec8Sopenharmony_ci * @ingroup device 253a46c0ec8Sopenharmony_ci * 254a46c0ec8Sopenharmony_ci * The source for a libinput_pointer_axis event. See 255a46c0ec8Sopenharmony_ci * libinput_event_pointer_get_axis_source() for details. 256a46c0ec8Sopenharmony_ci * 257a46c0ec8Sopenharmony_ci * @note Pointer axis sources are deprecated, the source is now encoded in 258a46c0ec8Sopenharmony_ci * the event types 259a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_SCROLL_WHEEL, 260a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_SCROLL_FINGER, and 261a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_SCROLL_CONTINUOUS. 262a46c0ec8Sopenharmony_ci */ 263a46c0ec8Sopenharmony_cienum libinput_pointer_axis_source { 264a46c0ec8Sopenharmony_ci /** 265a46c0ec8Sopenharmony_ci * The event is caused by the rotation of a wheel. 266a46c0ec8Sopenharmony_ci */ 267a46c0ec8Sopenharmony_ci LIBINPUT_POINTER_AXIS_SOURCE_WHEEL = 1, 268a46c0ec8Sopenharmony_ci /** 269a46c0ec8Sopenharmony_ci * The event is caused by the movement of one or more fingers on a 270a46c0ec8Sopenharmony_ci * device. 271a46c0ec8Sopenharmony_ci */ 272a46c0ec8Sopenharmony_ci LIBINPUT_POINTER_AXIS_SOURCE_FINGER, 273a46c0ec8Sopenharmony_ci /** 274a46c0ec8Sopenharmony_ci * The event is caused by the motion of some device. 275a46c0ec8Sopenharmony_ci */ 276a46c0ec8Sopenharmony_ci LIBINPUT_POINTER_AXIS_SOURCE_CONTINUOUS, 277a46c0ec8Sopenharmony_ci /** 278a46c0ec8Sopenharmony_ci * The event is caused by the tilting of a mouse wheel rather than 279a46c0ec8Sopenharmony_ci * its rotation. This method is commonly used on mice without 280a46c0ec8Sopenharmony_ci * separate horizontal scroll wheels. 281a46c0ec8Sopenharmony_ci * 282a46c0ec8Sopenharmony_ci * @deprecated This axis source is deprecated as of libinput 1.16. 283a46c0ec8Sopenharmony_ci * It was never used by any device before libinput 1.16. All wheel 284a46c0ec8Sopenharmony_ci * tilt devices use @ref LIBINPUT_POINTER_AXIS_SOURCE_WHEEL instead. 285a46c0ec8Sopenharmony_ci */ 286a46c0ec8Sopenharmony_ci LIBINPUT_POINTER_AXIS_SOURCE_WHEEL_TILT, 287a46c0ec8Sopenharmony_ci}; 288a46c0ec8Sopenharmony_ci 289a46c0ec8Sopenharmony_ci/** 290a46c0ec8Sopenharmony_ci * @ingroup event_tablet_pad 291a46c0ec8Sopenharmony_ci * 292a46c0ec8Sopenharmony_ci * The source for a @ref LIBINPUT_EVENT_TABLET_PAD_RING event. See 293a46c0ec8Sopenharmony_ci * libinput_event_tablet_pad_get_ring_source() for details. 294a46c0ec8Sopenharmony_ci * 295a46c0ec8Sopenharmony_ci * @since 1.3 296a46c0ec8Sopenharmony_ci */ 297a46c0ec8Sopenharmony_cienum libinput_tablet_pad_ring_axis_source { 298a46c0ec8Sopenharmony_ci LIBINPUT_TABLET_PAD_RING_SOURCE_UNKNOWN = 1, 299a46c0ec8Sopenharmony_ci /** 300a46c0ec8Sopenharmony_ci * The event is caused by the movement of one or more fingers on 301a46c0ec8Sopenharmony_ci * the ring. 302a46c0ec8Sopenharmony_ci */ 303a46c0ec8Sopenharmony_ci LIBINPUT_TABLET_PAD_RING_SOURCE_FINGER, 304a46c0ec8Sopenharmony_ci}; 305a46c0ec8Sopenharmony_ci 306a46c0ec8Sopenharmony_ci/** 307a46c0ec8Sopenharmony_ci * @ingroup event_tablet_pad 308a46c0ec8Sopenharmony_ci * 309a46c0ec8Sopenharmony_ci * The source for a @ref LIBINPUT_EVENT_TABLET_PAD_STRIP event. See 310a46c0ec8Sopenharmony_ci * libinput_event_tablet_pad_get_strip_source() for details. 311a46c0ec8Sopenharmony_ci * 312a46c0ec8Sopenharmony_ci * @since 1.3 313a46c0ec8Sopenharmony_ci */ 314a46c0ec8Sopenharmony_cienum libinput_tablet_pad_strip_axis_source { 315a46c0ec8Sopenharmony_ci LIBINPUT_TABLET_PAD_STRIP_SOURCE_UNKNOWN = 1, 316a46c0ec8Sopenharmony_ci /** 317a46c0ec8Sopenharmony_ci * The event is caused by the movement of one or more fingers on 318a46c0ec8Sopenharmony_ci * the strip. 319a46c0ec8Sopenharmony_ci */ 320a46c0ec8Sopenharmony_ci LIBINPUT_TABLET_PAD_STRIP_SOURCE_FINGER, 321a46c0ec8Sopenharmony_ci}; 322a46c0ec8Sopenharmony_ci 323a46c0ec8Sopenharmony_ci/** 324a46c0ec8Sopenharmony_ci * @ingroup device 325a46c0ec8Sopenharmony_ci * 326a46c0ec8Sopenharmony_ci * Available tool types for a device with the @ref 327a46c0ec8Sopenharmony_ci * LIBINPUT_DEVICE_CAP_TABLET_TOOL capability. The tool type defines the default 328a46c0ec8Sopenharmony_ci * usage of the tool as advertised by the manufacturer. Multiple different 329a46c0ec8Sopenharmony_ci * physical tools may share the same tool type, e.g. a Wacom Classic Pen, 330a46c0ec8Sopenharmony_ci * Wacom Pro Pen and a Wacom Grip Pen are all of type @ref 331a46c0ec8Sopenharmony_ci * LIBINPUT_TABLET_TOOL_TYPE_PEN. 332a46c0ec8Sopenharmony_ci * Use libinput_tablet_tool_get_tool_id() to get a specific model where applicable. 333a46c0ec8Sopenharmony_ci * 334a46c0ec8Sopenharmony_ci * Note that on some device, the eraser tool is on the tail end of a pen 335a46c0ec8Sopenharmony_ci * device. On other devices, e.g. MS Surface 3, the eraser is the pen tip 336a46c0ec8Sopenharmony_ci * while a button is held down. 337a46c0ec8Sopenharmony_ci * 338a46c0ec8Sopenharmony_ci * @note The @ref libinput_tablet_tool_type can only describe the default physical 339a46c0ec8Sopenharmony_ci * type of the device. For devices with adjustable physical properties 340a46c0ec8Sopenharmony_ci * the tool type remains the same, i.e. putting a Wacom stroke nib into a 341a46c0ec8Sopenharmony_ci * classic pen leaves the tool type as @ref LIBINPUT_TABLET_TOOL_TYPE_PEN. 342a46c0ec8Sopenharmony_ci * 343a46c0ec8Sopenharmony_ci * @since 1.2 344a46c0ec8Sopenharmony_ci */ 345a46c0ec8Sopenharmony_cienum libinput_tablet_tool_type { 346a46c0ec8Sopenharmony_ci LIBINPUT_TABLET_TOOL_TYPE_PEN = 1, /**< A generic pen */ 347a46c0ec8Sopenharmony_ci LIBINPUT_TABLET_TOOL_TYPE_ERASER, /**< Eraser */ 348a46c0ec8Sopenharmony_ci LIBINPUT_TABLET_TOOL_TYPE_BRUSH, /**< A paintbrush-like tool */ 349a46c0ec8Sopenharmony_ci LIBINPUT_TABLET_TOOL_TYPE_PENCIL, /**< Physical drawing tool, e.g. 350a46c0ec8Sopenharmony_ci Wacom Inking Pen */ 351a46c0ec8Sopenharmony_ci LIBINPUT_TABLET_TOOL_TYPE_AIRBRUSH, /**< An airbrush-like tool */ 352a46c0ec8Sopenharmony_ci LIBINPUT_TABLET_TOOL_TYPE_MOUSE, /**< A mouse bound to the tablet */ 353a46c0ec8Sopenharmony_ci LIBINPUT_TABLET_TOOL_TYPE_LENS, /**< A mouse tool with a lens */ 354a46c0ec8Sopenharmony_ci LIBINPUT_TABLET_TOOL_TYPE_TOTEM, /**< A rotary device with 355a46c0ec8Sopenharmony_ci positional and rotation 356a46c0ec8Sopenharmony_ci data */ 357a46c0ec8Sopenharmony_ci}; 358a46c0ec8Sopenharmony_ci 359a46c0ec8Sopenharmony_ci/** 360a46c0ec8Sopenharmony_ci * @ingroup device 361a46c0ec8Sopenharmony_ci * 362a46c0ec8Sopenharmony_ci * The state of proximity for a tool on a device. The device must have the @ref 363a46c0ec8Sopenharmony_ci * LIBINPUT_DEVICE_CAP_TABLET_TOOL capability. 364a46c0ec8Sopenharmony_ci * 365a46c0ec8Sopenharmony_ci * The proximity of a tool is a binary state signalling whether the tool is 366a46c0ec8Sopenharmony_ci * within a detectable distance of the tablet device. A tool that is out of 367a46c0ec8Sopenharmony_ci * proximity cannot generate events. 368a46c0ec8Sopenharmony_ci * 369a46c0ec8Sopenharmony_ci * On some hardware a tool goes out of proximity when it ceases to touch the 370a46c0ec8Sopenharmony_ci * surface. On other hardware, the tool is still detectable within a short 371a46c0ec8Sopenharmony_ci * distance (a few cm) off the surface. 372a46c0ec8Sopenharmony_ci * 373a46c0ec8Sopenharmony_ci * @since 1.2 374a46c0ec8Sopenharmony_ci */ 375a46c0ec8Sopenharmony_cienum libinput_tablet_tool_proximity_state { 376a46c0ec8Sopenharmony_ci LIBINPUT_TABLET_TOOL_PROXIMITY_STATE_OUT = 0, 377a46c0ec8Sopenharmony_ci LIBINPUT_TABLET_TOOL_PROXIMITY_STATE_IN = 1, 378a46c0ec8Sopenharmony_ci}; 379a46c0ec8Sopenharmony_ci 380a46c0ec8Sopenharmony_ci/** 381a46c0ec8Sopenharmony_ci * @ingroup device 382a46c0ec8Sopenharmony_ci * 383a46c0ec8Sopenharmony_ci * The tip contact state for a tool on a device. The device must have 384a46c0ec8Sopenharmony_ci * the @ref LIBINPUT_DEVICE_CAP_TABLET_TOOL capability. 385a46c0ec8Sopenharmony_ci * 386a46c0ec8Sopenharmony_ci * The tip contact state of a tool is a binary state signalling whether the tool is 387a46c0ec8Sopenharmony_ci * touching the surface of the tablet device. 388a46c0ec8Sopenharmony_ci * 389a46c0ec8Sopenharmony_ci * @since 1.2 390a46c0ec8Sopenharmony_ci */ 391a46c0ec8Sopenharmony_cienum libinput_tablet_tool_tip_state { 392a46c0ec8Sopenharmony_ci LIBINPUT_TABLET_TOOL_TIP_UP = 0, 393a46c0ec8Sopenharmony_ci LIBINPUT_TABLET_TOOL_TIP_DOWN = 1, 394a46c0ec8Sopenharmony_ci}; 395a46c0ec8Sopenharmony_ci 396a46c0ec8Sopenharmony_ci/** 397a46c0ec8Sopenharmony_ci * @defgroup tablet_pad_modes Tablet pad modes 398a46c0ec8Sopenharmony_ci * 399a46c0ec8Sopenharmony_ci * Handling the virtual mode groups of buttons, strips and rings on tablet 400a46c0ec8Sopenharmony_ci * pad devices. See the libinput documentation for more details. 401a46c0ec8Sopenharmony_ci */ 402a46c0ec8Sopenharmony_ci 403a46c0ec8Sopenharmony_ci/** 404a46c0ec8Sopenharmony_ci * @ingroup tablet_pad_modes 405a46c0ec8Sopenharmony_ci * @struct libinput_tablet_pad_mode_group 406a46c0ec8Sopenharmony_ci * 407a46c0ec8Sopenharmony_ci * A mode on a tablet pad is a virtual grouping of functionality, usually 408a46c0ec8Sopenharmony_ci * based on some visual feedback like LEDs on the pad. The set of buttons, 409a46c0ec8Sopenharmony_ci * rings and strips that share the same mode are a "mode group". Whenever 410a46c0ec8Sopenharmony_ci * the mode changes, all buttons, rings and strips within this mode group 411a46c0ec8Sopenharmony_ci * are affected. 412a46c0ec8Sopenharmony_ci * 413a46c0ec8Sopenharmony_ci * Most tablets only have a single mode group, some tablets provide multiple 414a46c0ec8Sopenharmony_ci * mode groups through independent banks of LEDs (e.g. the Wacom Cintiq 415a46c0ec8Sopenharmony_ci * 24HD). libinput guarantees that at least one mode group is always 416a46c0ec8Sopenharmony_ci * available. 417a46c0ec8Sopenharmony_ci * 418a46c0ec8Sopenharmony_ci * This struct is refcounted, use libinput_tablet_pad_mode_group_ref() and 419a46c0ec8Sopenharmony_ci * libinput_tablet_pad_mode_group_unref(). 420a46c0ec8Sopenharmony_ci * 421a46c0ec8Sopenharmony_ci * @since 1.4 422a46c0ec8Sopenharmony_ci */ 423a46c0ec8Sopenharmony_cistruct libinput_tablet_pad_mode_group; 424a46c0ec8Sopenharmony_ci 425a46c0ec8Sopenharmony_ci/** 426a46c0ec8Sopenharmony_ci * @ingroup tablet_pad_modes 427a46c0ec8Sopenharmony_ci * 428a46c0ec8Sopenharmony_ci * Most devices only provide a single mode group, however devices such as 429a46c0ec8Sopenharmony_ci * the Wacom Cintiq 22HD provide two mode groups. If multiple mode groups 430a46c0ec8Sopenharmony_ci * are available, a caller should use 431a46c0ec8Sopenharmony_ci * libinput_tablet_pad_mode_group_has_button(), 432a46c0ec8Sopenharmony_ci * libinput_tablet_pad_mode_group_has_ring() and 433a46c0ec8Sopenharmony_ci * libinput_tablet_pad_mode_group_has_strip() to associate each button, 434a46c0ec8Sopenharmony_ci * ring and strip with the correct mode group. 435a46c0ec8Sopenharmony_ci * 436a46c0ec8Sopenharmony_ci * @return the number of mode groups available on this device 437a46c0ec8Sopenharmony_ci * 438a46c0ec8Sopenharmony_ci * @since 1.4 439a46c0ec8Sopenharmony_ci */ 440a46c0ec8Sopenharmony_ciint 441a46c0ec8Sopenharmony_cilibinput_device_tablet_pad_get_num_mode_groups(struct libinput_device *device); 442a46c0ec8Sopenharmony_ci 443a46c0ec8Sopenharmony_ci/** 444a46c0ec8Sopenharmony_ci * @ingroup tablet_pad_modes 445a46c0ec8Sopenharmony_ci * 446a46c0ec8Sopenharmony_ci * The returned mode group is not refcounted and may become invalid after 447a46c0ec8Sopenharmony_ci * the next call to libinput. Use libinput_tablet_pad_mode_group_ref() and 448a46c0ec8Sopenharmony_ci * libinput_tablet_pad_mode_group_unref() to continue using the handle 449a46c0ec8Sopenharmony_ci * outside of the immediate scope. 450a46c0ec8Sopenharmony_ci * 451a46c0ec8Sopenharmony_ci * While at least one reference is kept by the caller, the returned mode 452a46c0ec8Sopenharmony_ci * group will be identical for each subsequent call of this function with 453a46c0ec8Sopenharmony_ci * the same index and that same struct is returned from 454a46c0ec8Sopenharmony_ci * libinput_event_tablet_pad_get_mode_group(), provided the event was 455a46c0ec8Sopenharmony_ci * generated by this mode group. 456a46c0ec8Sopenharmony_ci * 457a46c0ec8Sopenharmony_ci * @param device A device with the @ref LIBINPUT_DEVICE_CAP_TABLET_PAD 458a46c0ec8Sopenharmony_ci * capability 459a46c0ec8Sopenharmony_ci * @param index A mode group index 460a46c0ec8Sopenharmony_ci * @return the mode group with the given index or NULL if an invalid index 461a46c0ec8Sopenharmony_ci * is given. 462a46c0ec8Sopenharmony_ci * 463a46c0ec8Sopenharmony_ci * @since 1.4 464a46c0ec8Sopenharmony_ci */ 465a46c0ec8Sopenharmony_cistruct libinput_tablet_pad_mode_group* 466a46c0ec8Sopenharmony_cilibinput_device_tablet_pad_get_mode_group(struct libinput_device *device, 467a46c0ec8Sopenharmony_ci unsigned int index); 468a46c0ec8Sopenharmony_ci 469a46c0ec8Sopenharmony_ci/** 470a46c0ec8Sopenharmony_ci * @ingroup tablet_pad_modes 471a46c0ec8Sopenharmony_ci * 472a46c0ec8Sopenharmony_ci * The returned number is the same index as passed to 473a46c0ec8Sopenharmony_ci * libinput_device_tablet_pad_get_mode_group(). For tablets with only one 474a46c0ec8Sopenharmony_ci * mode this number is always 0. 475a46c0ec8Sopenharmony_ci * 476a46c0ec8Sopenharmony_ci * @param group A previously obtained mode group 477a46c0ec8Sopenharmony_ci * @return the numeric index this mode group represents, starting at 0 478a46c0ec8Sopenharmony_ci * 479a46c0ec8Sopenharmony_ci * @since 1.4 480a46c0ec8Sopenharmony_ci */ 481a46c0ec8Sopenharmony_ciunsigned int 482a46c0ec8Sopenharmony_cilibinput_tablet_pad_mode_group_get_index(struct libinput_tablet_pad_mode_group *group); 483a46c0ec8Sopenharmony_ci 484a46c0ec8Sopenharmony_ci/** 485a46c0ec8Sopenharmony_ci * @ingroup tablet_pad_modes 486a46c0ec8Sopenharmony_ci * 487a46c0ec8Sopenharmony_ci * Query the mode group for the number of available modes. The number of 488a46c0ec8Sopenharmony_ci * modes is usually decided by the number of physical LEDs available on the 489a46c0ec8Sopenharmony_ci * device. Different mode groups may have a different number of modes. Use 490a46c0ec8Sopenharmony_ci * libinput_tablet_pad_mode_group_get_mode() to get the currently active 491a46c0ec8Sopenharmony_ci * mode. 492a46c0ec8Sopenharmony_ci * 493a46c0ec8Sopenharmony_ci * libinput guarantees that at least one mode is available. A device without 494a46c0ec8Sopenharmony_ci * mode switching capability has a single mode group and a single mode. 495a46c0ec8Sopenharmony_ci * 496a46c0ec8Sopenharmony_ci * @param group A previously obtained mode group 497a46c0ec8Sopenharmony_ci * @return the number of modes available in this mode group 498a46c0ec8Sopenharmony_ci * 499a46c0ec8Sopenharmony_ci * @since 1.4 500a46c0ec8Sopenharmony_ci */ 501a46c0ec8Sopenharmony_ciunsigned int 502a46c0ec8Sopenharmony_cilibinput_tablet_pad_mode_group_get_num_modes(struct libinput_tablet_pad_mode_group *group); 503a46c0ec8Sopenharmony_ci 504a46c0ec8Sopenharmony_ci/** 505a46c0ec8Sopenharmony_ci * @ingroup tablet_pad_modes 506a46c0ec8Sopenharmony_ci * 507a46c0ec8Sopenharmony_ci * Return the current mode this mode group is in. Note that the returned 508a46c0ec8Sopenharmony_ci * mode is the mode valid as of completing the last libinput_dispatch(). 509a46c0ec8Sopenharmony_ci * The returned mode may thus be different than the mode returned by 510a46c0ec8Sopenharmony_ci * libinput_event_tablet_pad_get_mode(). 511a46c0ec8Sopenharmony_ci * 512a46c0ec8Sopenharmony_ci * For example, if the mode was toggled three times between the call to 513a46c0ec8Sopenharmony_ci * libinput_dispatch(), this function returns the third mode but the events 514a46c0ec8Sopenharmony_ci * in the event queue will return the modes 1, 2 and 3, respectively. 515a46c0ec8Sopenharmony_ci * 516a46c0ec8Sopenharmony_ci * @param group A previously obtained mode group 517a46c0ec8Sopenharmony_ci * @return the numeric index of the current mode in this group, starting at 0 518a46c0ec8Sopenharmony_ci * 519a46c0ec8Sopenharmony_ci * @see libinput_event_tablet_pad_get_mode 520a46c0ec8Sopenharmony_ci * 521a46c0ec8Sopenharmony_ci * @since 1.4 522a46c0ec8Sopenharmony_ci */ 523a46c0ec8Sopenharmony_ciunsigned int 524a46c0ec8Sopenharmony_cilibinput_tablet_pad_mode_group_get_mode(struct libinput_tablet_pad_mode_group *group); 525a46c0ec8Sopenharmony_ci 526a46c0ec8Sopenharmony_ci/** 527a46c0ec8Sopenharmony_ci * @ingroup tablet_pad_modes 528a46c0ec8Sopenharmony_ci * 529a46c0ec8Sopenharmony_ci * Devices without mode switching capabilities return true for every button. 530a46c0ec8Sopenharmony_ci * 531a46c0ec8Sopenharmony_ci * @param group A previously obtained mode group 532a46c0ec8Sopenharmony_ci * @param button A button index, starting at 0 533a46c0ec8Sopenharmony_ci * @return true if the given button index is part of this mode group or 534a46c0ec8Sopenharmony_ci * false otherwise 535a46c0ec8Sopenharmony_ci * 536a46c0ec8Sopenharmony_ci * @since 1.4 537a46c0ec8Sopenharmony_ci */ 538a46c0ec8Sopenharmony_ciint 539a46c0ec8Sopenharmony_cilibinput_tablet_pad_mode_group_has_button(struct libinput_tablet_pad_mode_group *group, 540a46c0ec8Sopenharmony_ci unsigned int button); 541a46c0ec8Sopenharmony_ci 542a46c0ec8Sopenharmony_ci/** 543a46c0ec8Sopenharmony_ci * @ingroup tablet_pad_modes 544a46c0ec8Sopenharmony_ci * 545a46c0ec8Sopenharmony_ci * Devices without mode switching capabilities return true for every ring. 546a46c0ec8Sopenharmony_ci * 547a46c0ec8Sopenharmony_ci * @param group A previously obtained mode group 548a46c0ec8Sopenharmony_ci * @param ring A ring index, starting at 0 549a46c0ec8Sopenharmony_ci * @return true if the given ring index is part of this mode group or 550a46c0ec8Sopenharmony_ci * false otherwise 551a46c0ec8Sopenharmony_ci * 552a46c0ec8Sopenharmony_ci * @since 1.4 553a46c0ec8Sopenharmony_ci */ 554a46c0ec8Sopenharmony_ciint 555a46c0ec8Sopenharmony_cilibinput_tablet_pad_mode_group_has_ring(struct libinput_tablet_pad_mode_group *group, 556a46c0ec8Sopenharmony_ci unsigned int ring); 557a46c0ec8Sopenharmony_ci 558a46c0ec8Sopenharmony_ci/** 559a46c0ec8Sopenharmony_ci * @ingroup tablet_pad_modes 560a46c0ec8Sopenharmony_ci * 561a46c0ec8Sopenharmony_ci * Devices without mode switching capabilities return true for every strip. 562a46c0ec8Sopenharmony_ci * 563a46c0ec8Sopenharmony_ci * @param group A previously obtained mode group 564a46c0ec8Sopenharmony_ci * @param strip A strip index, starting at 0 565a46c0ec8Sopenharmony_ci * @return true if the given strip index is part of this mode group or 566a46c0ec8Sopenharmony_ci * false otherwise 567a46c0ec8Sopenharmony_ci * 568a46c0ec8Sopenharmony_ci * @since 1.4 569a46c0ec8Sopenharmony_ci */ 570a46c0ec8Sopenharmony_ciint 571a46c0ec8Sopenharmony_cilibinput_tablet_pad_mode_group_has_strip(struct libinput_tablet_pad_mode_group *group, 572a46c0ec8Sopenharmony_ci unsigned int strip); 573a46c0ec8Sopenharmony_ci 574a46c0ec8Sopenharmony_ci/** 575a46c0ec8Sopenharmony_ci * @ingroup tablet_pad_modes 576a46c0ec8Sopenharmony_ci * 577a46c0ec8Sopenharmony_ci * The toggle button in a mode group is the button assigned to cycle to or 578a46c0ec8Sopenharmony_ci * directly assign a new mode when pressed. Not all devices have a toggle 579a46c0ec8Sopenharmony_ci * button and some devices may have more than one toggle button. For 580a46c0ec8Sopenharmony_ci * example, the Wacom Cintiq 24HD has six toggle buttons in two groups, each 581a46c0ec8Sopenharmony_ci * directly selecting one of the three modes per group. 582a46c0ec8Sopenharmony_ci * 583a46c0ec8Sopenharmony_ci * Devices without mode switching capabilities return false for every button. 584a46c0ec8Sopenharmony_ci * 585a46c0ec8Sopenharmony_ci * @param group A previously obtained mode group 586a46c0ec8Sopenharmony_ci * @param button A button index, starting at 0 587a46c0ec8Sopenharmony_ci * @retval non-zero if the button is a mode toggle button for this group, or 588a46c0ec8Sopenharmony_ci * zero otherwise 589a46c0ec8Sopenharmony_ci * 590a46c0ec8Sopenharmony_ci * @since 1.4 591a46c0ec8Sopenharmony_ci */ 592a46c0ec8Sopenharmony_ciint 593a46c0ec8Sopenharmony_cilibinput_tablet_pad_mode_group_button_is_toggle(struct libinput_tablet_pad_mode_group *group, 594a46c0ec8Sopenharmony_ci unsigned int button); 595a46c0ec8Sopenharmony_ci 596a46c0ec8Sopenharmony_ci/** 597a46c0ec8Sopenharmony_ci * @ingroup tablet_pad_modes 598a46c0ec8Sopenharmony_ci * 599a46c0ec8Sopenharmony_ci * Increase the refcount of the mode group. A mode group will be 600a46c0ec8Sopenharmony_ci * freed whenever the refcount reaches 0. 601a46c0ec8Sopenharmony_ci * 602a46c0ec8Sopenharmony_ci * @param group A previously obtained mode group 603a46c0ec8Sopenharmony_ci * @return The passed mode group 604a46c0ec8Sopenharmony_ci * 605a46c0ec8Sopenharmony_ci * @since 1.4 606a46c0ec8Sopenharmony_ci */ 607a46c0ec8Sopenharmony_cistruct libinput_tablet_pad_mode_group * 608a46c0ec8Sopenharmony_cilibinput_tablet_pad_mode_group_ref( 609a46c0ec8Sopenharmony_ci struct libinput_tablet_pad_mode_group *group); 610a46c0ec8Sopenharmony_ci 611a46c0ec8Sopenharmony_ci/** 612a46c0ec8Sopenharmony_ci * @ingroup tablet_pad_modes 613a46c0ec8Sopenharmony_ci * 614a46c0ec8Sopenharmony_ci * Decrease the refcount of the mode group. A mode group will be 615a46c0ec8Sopenharmony_ci * freed whenever the refcount reaches 0. 616a46c0ec8Sopenharmony_ci * 617a46c0ec8Sopenharmony_ci * @param group A previously obtained mode group 618a46c0ec8Sopenharmony_ci * @return NULL if the group was destroyed, otherwise the passed mode group 619a46c0ec8Sopenharmony_ci * 620a46c0ec8Sopenharmony_ci * @since 1.4 621a46c0ec8Sopenharmony_ci */ 622a46c0ec8Sopenharmony_cistruct libinput_tablet_pad_mode_group * 623a46c0ec8Sopenharmony_cilibinput_tablet_pad_mode_group_unref( 624a46c0ec8Sopenharmony_ci struct libinput_tablet_pad_mode_group *group); 625a46c0ec8Sopenharmony_ci 626a46c0ec8Sopenharmony_ci/** 627a46c0ec8Sopenharmony_ci * @ingroup tablet_pad_modes 628a46c0ec8Sopenharmony_ci * 629a46c0ec8Sopenharmony_ci * Set caller-specific data associated with this mode group. libinput does 630a46c0ec8Sopenharmony_ci * not manage, look at, or modify this data. The caller must ensure the 631a46c0ec8Sopenharmony_ci * data is valid. 632a46c0ec8Sopenharmony_ci * 633a46c0ec8Sopenharmony_ci * @param group A previously obtained mode group 634a46c0ec8Sopenharmony_ci * @param user_data Caller-specific data pointer 635a46c0ec8Sopenharmony_ci * @see libinput_tablet_pad_mode_group_get_user_data 636a46c0ec8Sopenharmony_ci * 637a46c0ec8Sopenharmony_ci * @since 1.4 638a46c0ec8Sopenharmony_ci */ 639a46c0ec8Sopenharmony_civoid 640a46c0ec8Sopenharmony_cilibinput_tablet_pad_mode_group_set_user_data( 641a46c0ec8Sopenharmony_ci struct libinput_tablet_pad_mode_group *group, 642a46c0ec8Sopenharmony_ci void *user_data); 643a46c0ec8Sopenharmony_ci 644a46c0ec8Sopenharmony_ci/** 645a46c0ec8Sopenharmony_ci * @ingroup tablet_pad_modes 646a46c0ec8Sopenharmony_ci * 647a46c0ec8Sopenharmony_ci * Get the caller-specific data associated with this mode group, if any. 648a46c0ec8Sopenharmony_ci * 649a46c0ec8Sopenharmony_ci * @param group A previously obtained mode group 650a46c0ec8Sopenharmony_ci * @return Caller-specific data pointer or NULL if none was set 651a46c0ec8Sopenharmony_ci * @see libinput_tablet_pad_mode_group_set_user_data 652a46c0ec8Sopenharmony_ci * 653a46c0ec8Sopenharmony_ci * @since 1.4 654a46c0ec8Sopenharmony_ci */ 655a46c0ec8Sopenharmony_civoid * 656a46c0ec8Sopenharmony_cilibinput_tablet_pad_mode_group_get_user_data( 657a46c0ec8Sopenharmony_ci struct libinput_tablet_pad_mode_group *group); 658a46c0ec8Sopenharmony_ci 659a46c0ec8Sopenharmony_ci/** 660a46c0ec8Sopenharmony_ci * @ingroup device 661a46c0ec8Sopenharmony_ci * 662a46c0ec8Sopenharmony_ci * The state of a switch. The default state of a switch is @ref 663a46c0ec8Sopenharmony_ci * LIBINPUT_SWITCH_STATE_OFF and no event is sent to confirm a switch in the 664a46c0ec8Sopenharmony_ci * off position. If a switch is logically on during initialization, libinput 665a46c0ec8Sopenharmony_ci * sends an event of type @ref LIBINPUT_EVENT_SWITCH_TOGGLE with a state 666a46c0ec8Sopenharmony_ci * @ref LIBINPUT_SWITCH_STATE_ON. 667a46c0ec8Sopenharmony_ci * 668a46c0ec8Sopenharmony_ci * @since 1.7 669a46c0ec8Sopenharmony_ci */ 670a46c0ec8Sopenharmony_cienum libinput_switch_state { 671a46c0ec8Sopenharmony_ci LIBINPUT_SWITCH_STATE_OFF = 0, 672a46c0ec8Sopenharmony_ci LIBINPUT_SWITCH_STATE_ON = 1, 673a46c0ec8Sopenharmony_ci}; 674a46c0ec8Sopenharmony_ci 675a46c0ec8Sopenharmony_ci/** 676a46c0ec8Sopenharmony_ci * @ingroup device 677a46c0ec8Sopenharmony_ci * 678a46c0ec8Sopenharmony_ci * The type of a switch. 679a46c0ec8Sopenharmony_ci * 680a46c0ec8Sopenharmony_ci * @since 1.7 681a46c0ec8Sopenharmony_ci */ 682a46c0ec8Sopenharmony_cienum libinput_switch { 683a46c0ec8Sopenharmony_ci /** 684a46c0ec8Sopenharmony_ci * The laptop lid was closed when the switch state is @ref 685a46c0ec8Sopenharmony_ci * LIBINPUT_SWITCH_STATE_ON, or was opened when it is @ref 686a46c0ec8Sopenharmony_ci * LIBINPUT_SWITCH_STATE_OFF. 687a46c0ec8Sopenharmony_ci */ 688a46c0ec8Sopenharmony_ci LIBINPUT_SWITCH_LID = 1, 689a46c0ec8Sopenharmony_ci 690a46c0ec8Sopenharmony_ci /** 691a46c0ec8Sopenharmony_ci * This switch indicates whether the device is in normal laptop mode 692a46c0ec8Sopenharmony_ci * or behaves like a tablet-like device where the primary 693a46c0ec8Sopenharmony_ci * interaction is usually a touch screen. When in tablet mode, the 694a46c0ec8Sopenharmony_ci * keyboard and touchpad are usually inaccessible. 695a46c0ec8Sopenharmony_ci * 696a46c0ec8Sopenharmony_ci * If the switch is in state @ref LIBINPUT_SWITCH_STATE_OFF, the 697a46c0ec8Sopenharmony_ci * device is in laptop mode. If the switch is in state @ref 698a46c0ec8Sopenharmony_ci * LIBINPUT_SWITCH_STATE_ON, the device is in tablet mode and the 699a46c0ec8Sopenharmony_ci * keyboard or touchpad may not be accessible. 700a46c0ec8Sopenharmony_ci * 701a46c0ec8Sopenharmony_ci * It is up to the caller to identify which devices are inaccessible 702a46c0ec8Sopenharmony_ci * in tablet mode. 703a46c0ec8Sopenharmony_ci */ 704a46c0ec8Sopenharmony_ci LIBINPUT_SWITCH_TABLET_MODE, 705a46c0ec8Sopenharmony_ci}; 706a46c0ec8Sopenharmony_ci 707a46c0ec8Sopenharmony_ci/** 708a46c0ec8Sopenharmony_ci * @ingroup event_switch 709a46c0ec8Sopenharmony_ci * @struct libinput_event_switch 710a46c0ec8Sopenharmony_ci * 711a46c0ec8Sopenharmony_ci * A switch event representing a changed state in a switch. 712a46c0ec8Sopenharmony_ci * 713a46c0ec8Sopenharmony_ci * @since 1.7 714a46c0ec8Sopenharmony_ci */ 715a46c0ec8Sopenharmony_cistruct libinput_event_switch; 716a46c0ec8Sopenharmony_ci 717a46c0ec8Sopenharmony_ci/** 718a46c0ec8Sopenharmony_ci * @ingroup base 719a46c0ec8Sopenharmony_ci * 720a46c0ec8Sopenharmony_ci * Event type for events returned by libinput_get_event(). 721a46c0ec8Sopenharmony_ci */ 722a46c0ec8Sopenharmony_cienum libinput_event_type { 723a46c0ec8Sopenharmony_ci /** 724a46c0ec8Sopenharmony_ci * This is not a real event type, and is only used to tell the user that 725a46c0ec8Sopenharmony_ci * no new event is available in the queue. See 726a46c0ec8Sopenharmony_ci * libinput_next_event_type(). 727a46c0ec8Sopenharmony_ci */ 728a46c0ec8Sopenharmony_ci LIBINPUT_EVENT_NONE = 0, 729a46c0ec8Sopenharmony_ci 730a46c0ec8Sopenharmony_ci /** 731a46c0ec8Sopenharmony_ci * Signals that a device has been added to the context. The device will 732a46c0ec8Sopenharmony_ci * not be read until the next time the user calls libinput_dispatch() 733a46c0ec8Sopenharmony_ci * and data is available. 734a46c0ec8Sopenharmony_ci * 735a46c0ec8Sopenharmony_ci * This allows setting up initial device configuration before any events 736a46c0ec8Sopenharmony_ci * are created. 737a46c0ec8Sopenharmony_ci */ 738a46c0ec8Sopenharmony_ci LIBINPUT_EVENT_DEVICE_ADDED, 739a46c0ec8Sopenharmony_ci 740a46c0ec8Sopenharmony_ci /** 741a46c0ec8Sopenharmony_ci * Signals that a device has been removed. No more events from the 742a46c0ec8Sopenharmony_ci * associated device will be in the queue or be queued after this event. 743a46c0ec8Sopenharmony_ci */ 744a46c0ec8Sopenharmony_ci LIBINPUT_EVENT_DEVICE_REMOVED, 745a46c0ec8Sopenharmony_ci 746a46c0ec8Sopenharmony_ci LIBINPUT_EVENT_KEYBOARD_KEY = 300, 747a46c0ec8Sopenharmony_ci 748a46c0ec8Sopenharmony_ci LIBINPUT_EVENT_POINTER_MOTION = 400, 749a46c0ec8Sopenharmony_ci LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE, 750a46c0ec8Sopenharmony_ci LIBINPUT_EVENT_POINTER_BUTTON, 751a46c0ec8Sopenharmony_ci /** 752a46c0ec8Sopenharmony_ci * A scroll event from various sources. 753a46c0ec8Sopenharmony_ci * 754a46c0ec8Sopenharmony_ci * This event is deprecated as of libinput 1.19. Use 755a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_SCROLL_WHEEL, 756a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_SCROLL_FINGER, and 757a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_SCROLL_CONTINUOUS instead. 758a46c0ec8Sopenharmony_ci * 759a46c0ec8Sopenharmony_ci * Use libinput_event_pointer_get_axis_source() to determine the 760a46c0ec8Sopenharmony_ci * source of a scroll event. For libinput versions 1.19 and later, 761a46c0ec8Sopenharmony_ci * the source is encoded in the event type. 762a46c0ec8Sopenharmony_ci * 763a46c0ec8Sopenharmony_ci * This event is sent **in addition** to events of type 764a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_SCROLL_WHEEL, 765a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_SCROLL_FINGER, and 766a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_SCROLL_CONTINUOUS. 767a46c0ec8Sopenharmony_ci * Do not mix and match, either use the old event or the new events. 768a46c0ec8Sopenharmony_ci * libinput makes no guarantee about the relation between 769a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_AXIS and the new event types 770a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_SCROLL_WHEEL, 771a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_SCROLL_FINGER, and 772a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_SCROLL_CONTINUOUS. You may receive 773a46c0ec8Sopenharmony_ci * multiple zero, one or more new events per legacy event. 774a46c0ec8Sopenharmony_ci * 775a46c0ec8Sopenharmony_ci * @warning Ignore this event if you are processing 776a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_SCROLL_WHEEL, 777a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_SCROLL_FINGER, and 778a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_SCROLL_CONTINUOUS. 779a46c0ec8Sopenharmony_ci */ 780a46c0ec8Sopenharmony_ci LIBINPUT_EVENT_POINTER_AXIS, 781a46c0ec8Sopenharmony_ci 782a46c0ec8Sopenharmony_ci /** 783a46c0ec8Sopenharmony_ci * A scroll event from a wheel. This event is sent is sent **in 784a46c0ec8Sopenharmony_ci * addition** to the @ref LIBINPUT_EVENT_POINTER_AXIS 785a46c0ec8Sopenharmony_ci * event for all events with a 786a46c0ec8Sopenharmony_ci * libinput_event_pointer_get_axis_source() of @ref 787a46c0ec8Sopenharmony_ci * LIBINPUT_POINTER_AXIS_SOURCE_WHEEL. Ignore @ref 788a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_POINTER_AXIS if you are processing this event. 789a46c0ec8Sopenharmony_ci * 790a46c0ec8Sopenharmony_ci * See the libinput documentation for details. 791a46c0ec8Sopenharmony_ci * 792a46c0ec8Sopenharmony_ci * @since 1.19 793a46c0ec8Sopenharmony_ci */ 794a46c0ec8Sopenharmony_ci LIBINPUT_EVENT_POINTER_SCROLL_WHEEL, 795a46c0ec8Sopenharmony_ci 796a46c0ec8Sopenharmony_ci /** 797a46c0ec8Sopenharmony_ci * A scroll event caused by the movement of one or more fingers on a 798a46c0ec8Sopenharmony_ci * device. This event is sent is sent **in addition** to the @ref 799a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_POINTER_AXIS event for all events with a 800a46c0ec8Sopenharmony_ci * libinput_event_pointer_get_axis_source() of @ref 801a46c0ec8Sopenharmony_ci * LIBINPUT_POINTER_AXIS_SOURCE_FINGER. Ignore @ref 802a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_POINTER_AXIS if you are processing this event. 803a46c0ec8Sopenharmony_ci * 804a46c0ec8Sopenharmony_ci * See the libinput documentation for details. 805a46c0ec8Sopenharmony_ci * 806a46c0ec8Sopenharmony_ci * @since 1.19 807a46c0ec8Sopenharmony_ci */ 808a46c0ec8Sopenharmony_ci LIBINPUT_EVENT_POINTER_SCROLL_FINGER, 809a46c0ec8Sopenharmony_ci 810a46c0ec8Sopenharmony_ci /** 811a46c0ec8Sopenharmony_ci * A scroll event from a continuous scroll source, e.g. button 812a46c0ec8Sopenharmony_ci * scrolling. This event is sent is sent **in 813a46c0ec8Sopenharmony_ci * addition** to the @ref LIBINPUT_EVENT_POINTER_AXIS 814a46c0ec8Sopenharmony_ci * event for all events with a 815a46c0ec8Sopenharmony_ci * libinput_event_pointer_get_axis_source() of @ref 816a46c0ec8Sopenharmony_ci * LIBINPUT_POINTER_AXIS_SOURCE_CONTINUOUS. Ignore @ref 817a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_POINTER_AXIS if you are processing this event. 818a46c0ec8Sopenharmony_ci * 819a46c0ec8Sopenharmony_ci * See the libinput documentation for details. 820a46c0ec8Sopenharmony_ci * 821a46c0ec8Sopenharmony_ci * @since 1.19 822a46c0ec8Sopenharmony_ci */ 823a46c0ec8Sopenharmony_ci LIBINPUT_EVENT_POINTER_SCROLL_CONTINUOUS, 824a46c0ec8Sopenharmony_ci 825a46c0ec8Sopenharmony_ci LIBINPUT_EVENT_TOUCH_DOWN = 500, 826a46c0ec8Sopenharmony_ci LIBINPUT_EVENT_TOUCH_UP, 827a46c0ec8Sopenharmony_ci LIBINPUT_EVENT_TOUCH_MOTION, 828a46c0ec8Sopenharmony_ci LIBINPUT_EVENT_TOUCH_CANCEL, 829a46c0ec8Sopenharmony_ci /** 830a46c0ec8Sopenharmony_ci * Signals the end of a set of touchpoints at one device sample 831a46c0ec8Sopenharmony_ci * time. This event has no coordinate information attached. 832a46c0ec8Sopenharmony_ci */ 833a46c0ec8Sopenharmony_ci LIBINPUT_EVENT_TOUCH_FRAME, 834a46c0ec8Sopenharmony_ci 835a46c0ec8Sopenharmony_ci /** 836a46c0ec8Sopenharmony_ci * One or more axes have changed state on a device with the @ref 837a46c0ec8Sopenharmony_ci * LIBINPUT_DEVICE_CAP_TABLET_TOOL capability. This event is only sent 838a46c0ec8Sopenharmony_ci * when the tool is in proximity, see @ref 839a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY for details. 840a46c0ec8Sopenharmony_ci * 841a46c0ec8Sopenharmony_ci * The proximity event contains the initial state of the axis as the 842a46c0ec8Sopenharmony_ci * tool comes into proximity. An event of type @ref 843a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_AXIS is only sent when an axis value 844a46c0ec8Sopenharmony_ci * changes from this initial state. It is possible for a tool to 845a46c0ec8Sopenharmony_ci * enter and leave proximity without sending an event of type @ref 846a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_AXIS. 847a46c0ec8Sopenharmony_ci * 848a46c0ec8Sopenharmony_ci * An event of type @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS is sent 849a46c0ec8Sopenharmony_ci * when the tip state does not change. See the documentation for 850a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_TOOL_TIP for more details. 851a46c0ec8Sopenharmony_ci * 852a46c0ec8Sopenharmony_ci * @since 1.2 853a46c0ec8Sopenharmony_ci */ 854a46c0ec8Sopenharmony_ci LIBINPUT_EVENT_TABLET_TOOL_AXIS = 600, 855a46c0ec8Sopenharmony_ci /** 856a46c0ec8Sopenharmony_ci * Signals that a tool has come in or out of proximity of a device with 857a46c0ec8Sopenharmony_ci * the @ref LIBINPUT_DEVICE_CAP_TABLET_TOOL capability. 858a46c0ec8Sopenharmony_ci * 859a46c0ec8Sopenharmony_ci * Proximity events contain each of the current values for each axis, 860a46c0ec8Sopenharmony_ci * and these values may be extracted from them in the same way they are 861a46c0ec8Sopenharmony_ci * with @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS events. 862a46c0ec8Sopenharmony_ci * 863a46c0ec8Sopenharmony_ci * Some tools may always be in proximity. For these tools, events of 864a46c0ec8Sopenharmony_ci * type @ref LIBINPUT_TABLET_TOOL_PROXIMITY_STATE_IN are sent only once after @ref 865a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_DEVICE_ADDED, and events of type @ref 866a46c0ec8Sopenharmony_ci * LIBINPUT_TABLET_TOOL_PROXIMITY_STATE_OUT are sent only once before @ref 867a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_DEVICE_REMOVED. 868a46c0ec8Sopenharmony_ci * 869a46c0ec8Sopenharmony_ci * If the tool that comes into proximity supports x/y coordinates, 870a46c0ec8Sopenharmony_ci * libinput guarantees that both x and y are set in the proximity 871a46c0ec8Sopenharmony_ci * event. 872a46c0ec8Sopenharmony_ci * 873a46c0ec8Sopenharmony_ci * When a tool goes out of proximity, the value of every axis should be 874a46c0ec8Sopenharmony_ci * assumed to have an undefined state and any buttons that are currently held 875a46c0ec8Sopenharmony_ci * down on the stylus are marked as released. Button release events for 876a46c0ec8Sopenharmony_ci * each button that was held down on the stylus are sent before the 877a46c0ec8Sopenharmony_ci * proximity out event. 878a46c0ec8Sopenharmony_ci * 879a46c0ec8Sopenharmony_ci * @since 1.2 880a46c0ec8Sopenharmony_ci */ 881a46c0ec8Sopenharmony_ci LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, 882a46c0ec8Sopenharmony_ci /** 883a46c0ec8Sopenharmony_ci * Signals that a tool has come in contact with the surface of a 884a46c0ec8Sopenharmony_ci * device with the @ref LIBINPUT_DEVICE_CAP_TABLET_TOOL capability. 885a46c0ec8Sopenharmony_ci * 886a46c0ec8Sopenharmony_ci * On devices without distance proximity detection, the @ref 887a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_TIP is sent immediately after @ref 888a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY for the tip down event, and 889a46c0ec8Sopenharmony_ci * immediately before for the tip up event. 890a46c0ec8Sopenharmony_ci * 891a46c0ec8Sopenharmony_ci * The decision when a tip touches the surface is device-dependent 892a46c0ec8Sopenharmony_ci * and may be derived from pressure data or other means. If the tip 893a46c0ec8Sopenharmony_ci * state is changed by axes changing state, the 894a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_TOOL_TIP event includes the changed 895a46c0ec8Sopenharmony_ci * axes and no additional axis event is sent for this state change. 896a46c0ec8Sopenharmony_ci * In other words, a caller must look at both @ref 897a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_AXIS and @ref 898a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_TIP events to know the current state 899a46c0ec8Sopenharmony_ci * of the axes. 900a46c0ec8Sopenharmony_ci * 901a46c0ec8Sopenharmony_ci * If a button state change occurs at the same time as a tip state 902a46c0ec8Sopenharmony_ci * change, the order of events is device-dependent. 903a46c0ec8Sopenharmony_ci * 904a46c0ec8Sopenharmony_ci * @since 1.2 905a46c0ec8Sopenharmony_ci */ 906a46c0ec8Sopenharmony_ci LIBINPUT_EVENT_TABLET_TOOL_TIP, 907a46c0ec8Sopenharmony_ci /** 908a46c0ec8Sopenharmony_ci * Signals that a tool has changed a logical button state on a 909a46c0ec8Sopenharmony_ci * device with the @ref LIBINPUT_DEVICE_CAP_TABLET_TOOL capability. 910a46c0ec8Sopenharmony_ci * 911a46c0ec8Sopenharmony_ci * Button state changes occur on their own and do not include axis 912a46c0ec8Sopenharmony_ci * state changes. If button and axis state changes occur within the 913a46c0ec8Sopenharmony_ci * same logical hardware event, the order of the @ref 914a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_BUTTON and @ref 915a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_AXIS event is device-specific. 916a46c0ec8Sopenharmony_ci * 917a46c0ec8Sopenharmony_ci * This event is not to be confused with the button events emitted 918a46c0ec8Sopenharmony_ci * by the tablet pad. See @ref LIBINPUT_EVENT_TABLET_PAD_BUTTON. 919a46c0ec8Sopenharmony_ci * 920a46c0ec8Sopenharmony_ci * @see LIBINPUT_EVENT_TABLET_PAD_BUTTON 921a46c0ec8Sopenharmony_ci * 922a46c0ec8Sopenharmony_ci * @since 1.2 923a46c0ec8Sopenharmony_ci */ 924a46c0ec8Sopenharmony_ci LIBINPUT_EVENT_TABLET_TOOL_BUTTON, 925a46c0ec8Sopenharmony_ci 926a46c0ec8Sopenharmony_ci /** 927a46c0ec8Sopenharmony_ci * A button pressed on a device with the @ref 928a46c0ec8Sopenharmony_ci * LIBINPUT_DEVICE_CAP_TABLET_PAD capability. 929a46c0ec8Sopenharmony_ci * 930a46c0ec8Sopenharmony_ci * A button differs from @ref LIBINPUT_EVENT_TABLET_PAD_KEY in that 931a46c0ec8Sopenharmony_ci * buttons are sequentially indexed from 0 and do not carry any 932a46c0ec8Sopenharmony_ci * other information. Keys have a specific functionality assigned 933a46c0ec8Sopenharmony_ci * to them. The key code thus carries a semantic meaning, a button 934a46c0ec8Sopenharmony_ci * number does not. 935a46c0ec8Sopenharmony_ci * 936a46c0ec8Sopenharmony_ci * This event is not to be confused with the button events emitted 937a46c0ec8Sopenharmony_ci * by tools on a tablet (@ref LIBINPUT_EVENT_TABLET_TOOL_BUTTON). 938a46c0ec8Sopenharmony_ci * 939a46c0ec8Sopenharmony_ci * @since 1.3 940a46c0ec8Sopenharmony_ci */ 941a46c0ec8Sopenharmony_ci LIBINPUT_EVENT_TABLET_PAD_BUTTON = 700, 942a46c0ec8Sopenharmony_ci /** 943a46c0ec8Sopenharmony_ci * A status change on a tablet ring with the @ref 944a46c0ec8Sopenharmony_ci * LIBINPUT_DEVICE_CAP_TABLET_PAD capability. 945a46c0ec8Sopenharmony_ci * 946a46c0ec8Sopenharmony_ci * @since 1.3 947a46c0ec8Sopenharmony_ci */ 948a46c0ec8Sopenharmony_ci LIBINPUT_EVENT_TABLET_PAD_RING, 949a46c0ec8Sopenharmony_ci 950a46c0ec8Sopenharmony_ci /** 951a46c0ec8Sopenharmony_ci * A status change on a strip on a device with the @ref 952a46c0ec8Sopenharmony_ci * LIBINPUT_DEVICE_CAP_TABLET_PAD capability. 953a46c0ec8Sopenharmony_ci * 954a46c0ec8Sopenharmony_ci * @since 1.3 955a46c0ec8Sopenharmony_ci */ 956a46c0ec8Sopenharmony_ci LIBINPUT_EVENT_TABLET_PAD_STRIP, 957a46c0ec8Sopenharmony_ci 958a46c0ec8Sopenharmony_ci /** 959a46c0ec8Sopenharmony_ci * A key pressed on a device with the @ref 960a46c0ec8Sopenharmony_ci * LIBINPUT_DEVICE_CAP_TABLET_PAD capability. 961a46c0ec8Sopenharmony_ci * 962a46c0ec8Sopenharmony_ci * A key differs from @ref LIBINPUT_EVENT_TABLET_PAD_BUTTON in that 963a46c0ec8Sopenharmony_ci * keys have a specific functionality assigned to them (buttons are 964a46c0ec8Sopenharmony_ci * sequentially ordered). The key code thus carries a semantic 965a46c0ec8Sopenharmony_ci * meaning, a button number does not. 966a46c0ec8Sopenharmony_ci * 967a46c0ec8Sopenharmony_ci * @since 1.15 968a46c0ec8Sopenharmony_ci */ 969a46c0ec8Sopenharmony_ci LIBINPUT_EVENT_TABLET_PAD_KEY, 970a46c0ec8Sopenharmony_ci 971a46c0ec8Sopenharmony_ci LIBINPUT_EVENT_GESTURE_SWIPE_BEGIN = 800, 972a46c0ec8Sopenharmony_ci LIBINPUT_EVENT_GESTURE_SWIPE_UPDATE, 973a46c0ec8Sopenharmony_ci LIBINPUT_EVENT_GESTURE_SWIPE_END, 974a46c0ec8Sopenharmony_ci LIBINPUT_EVENT_GESTURE_PINCH_BEGIN, 975a46c0ec8Sopenharmony_ci LIBINPUT_EVENT_GESTURE_PINCH_UPDATE, 976a46c0ec8Sopenharmony_ci LIBINPUT_EVENT_GESTURE_PINCH_END, 977a46c0ec8Sopenharmony_ci /** 978a46c0ec8Sopenharmony_ci * @since 1.19 979a46c0ec8Sopenharmony_ci */ 980a46c0ec8Sopenharmony_ci LIBINPUT_EVENT_GESTURE_HOLD_BEGIN, 981a46c0ec8Sopenharmony_ci LIBINPUT_EVENT_GESTURE_HOLD_END, 982a46c0ec8Sopenharmony_ci 983a46c0ec8Sopenharmony_ci /** 984a46c0ec8Sopenharmony_ci * @since 1.7 985a46c0ec8Sopenharmony_ci */ 986a46c0ec8Sopenharmony_ci LIBINPUT_EVENT_SWITCH_TOGGLE = 900, 987a46c0ec8Sopenharmony_ci}; 988a46c0ec8Sopenharmony_ci 989a46c0ec8Sopenharmony_ci/** 990a46c0ec8Sopenharmony_ci * @defgroup event Accessing and destruction of events 991a46c0ec8Sopenharmony_ci */ 992a46c0ec8Sopenharmony_ci 993a46c0ec8Sopenharmony_ci/** 994a46c0ec8Sopenharmony_ci * @ingroup event 995a46c0ec8Sopenharmony_ci * 996a46c0ec8Sopenharmony_ci * Destroy the event, freeing all associated resources. Resources obtained 997a46c0ec8Sopenharmony_ci * from this event must be considered invalid after this call. 998a46c0ec8Sopenharmony_ci * 999a46c0ec8Sopenharmony_ci * @warning Unlike other structs events are considered transient and 1000a46c0ec8Sopenharmony_ci * <b>not</b> refcounted. Calling libinput_event_destroy() <b>will</b> 1001a46c0ec8Sopenharmony_ci * destroy the event. 1002a46c0ec8Sopenharmony_ci * 1003a46c0ec8Sopenharmony_ci * @param event An event retrieved by libinput_get_event(). 1004a46c0ec8Sopenharmony_ci */ 1005a46c0ec8Sopenharmony_civoid 1006a46c0ec8Sopenharmony_cilibinput_event_destroy(struct libinput_event *event); 1007a46c0ec8Sopenharmony_ci 1008a46c0ec8Sopenharmony_ci/** 1009a46c0ec8Sopenharmony_ci * @ingroup event 1010a46c0ec8Sopenharmony_ci * 1011a46c0ec8Sopenharmony_ci * Get the type of the event. 1012a46c0ec8Sopenharmony_ci * 1013a46c0ec8Sopenharmony_ci * @param event An event retrieved by libinput_get_event(). 1014a46c0ec8Sopenharmony_ci */ 1015a46c0ec8Sopenharmony_cienum libinput_event_type 1016a46c0ec8Sopenharmony_cilibinput_event_get_type(struct libinput_event *event); 1017a46c0ec8Sopenharmony_ci 1018a46c0ec8Sopenharmony_ci/** 1019a46c0ec8Sopenharmony_ci * @ingroup event 1020a46c0ec8Sopenharmony_ci * 1021a46c0ec8Sopenharmony_ci * Get the libinput context from the event. 1022a46c0ec8Sopenharmony_ci * 1023a46c0ec8Sopenharmony_ci * @param event The libinput event 1024a46c0ec8Sopenharmony_ci * @return The libinput context for this event. 1025a46c0ec8Sopenharmony_ci */ 1026a46c0ec8Sopenharmony_cistruct libinput * 1027a46c0ec8Sopenharmony_cilibinput_event_get_context(struct libinput_event *event); 1028a46c0ec8Sopenharmony_ci 1029a46c0ec8Sopenharmony_ci/** 1030a46c0ec8Sopenharmony_ci * @ingroup event 1031a46c0ec8Sopenharmony_ci * 1032a46c0ec8Sopenharmony_ci * Return the device associated with this event. For device added/removed 1033a46c0ec8Sopenharmony_ci * events this is the device added or removed. For all other device events, 1034a46c0ec8Sopenharmony_ci * this is the device that generated the event. 1035a46c0ec8Sopenharmony_ci * 1036a46c0ec8Sopenharmony_ci * This device is not refcounted and its lifetime is that of the event. Use 1037a46c0ec8Sopenharmony_ci * libinput_device_ref() before using the device outside of this scope. 1038a46c0ec8Sopenharmony_ci * 1039a46c0ec8Sopenharmony_ci * @return The device associated with this event 1040a46c0ec8Sopenharmony_ci */ 1041a46c0ec8Sopenharmony_ci 1042a46c0ec8Sopenharmony_cistruct libinput_device * 1043a46c0ec8Sopenharmony_cilibinput_event_get_device(struct libinput_event *event); 1044a46c0ec8Sopenharmony_ci 1045a46c0ec8Sopenharmony_ci/** 1046a46c0ec8Sopenharmony_ci * @ingroup event 1047a46c0ec8Sopenharmony_ci * 1048a46c0ec8Sopenharmony_ci * Return the pointer event that is this input event. If the event type does 1049a46c0ec8Sopenharmony_ci * not match the pointer event types, this function returns NULL. 1050a46c0ec8Sopenharmony_ci * 1051a46c0ec8Sopenharmony_ci * The inverse of this function is libinput_event_pointer_get_base_event(). 1052a46c0ec8Sopenharmony_ci * 1053a46c0ec8Sopenharmony_ci * @return A pointer event, or NULL for other events 1054a46c0ec8Sopenharmony_ci */ 1055a46c0ec8Sopenharmony_cistruct libinput_event_pointer * 1056a46c0ec8Sopenharmony_cilibinput_event_get_pointer_event(struct libinput_event *event); 1057a46c0ec8Sopenharmony_ci 1058a46c0ec8Sopenharmony_ci/** 1059a46c0ec8Sopenharmony_ci * @ingroup event 1060a46c0ec8Sopenharmony_ci * 1061a46c0ec8Sopenharmony_ci * Return the keyboard event that is this input event. If the event type does 1062a46c0ec8Sopenharmony_ci * not match the keyboard event types, this function returns NULL. 1063a46c0ec8Sopenharmony_ci * 1064a46c0ec8Sopenharmony_ci * The inverse of this function is libinput_event_keyboard_get_base_event(). 1065a46c0ec8Sopenharmony_ci * 1066a46c0ec8Sopenharmony_ci * @return A keyboard event, or NULL for other events 1067a46c0ec8Sopenharmony_ci */ 1068a46c0ec8Sopenharmony_cistruct libinput_event_keyboard * 1069a46c0ec8Sopenharmony_cilibinput_event_get_keyboard_event(struct libinput_event *event); 1070a46c0ec8Sopenharmony_ci 1071a46c0ec8Sopenharmony_ci/** 1072a46c0ec8Sopenharmony_ci * @ingroup event 1073a46c0ec8Sopenharmony_ci * 1074a46c0ec8Sopenharmony_ci * Return the touch event that is this input event. If the event type does 1075a46c0ec8Sopenharmony_ci * not match the touch event types, this function returns NULL. 1076a46c0ec8Sopenharmony_ci * 1077a46c0ec8Sopenharmony_ci * The inverse of this function is libinput_event_touch_get_base_event(). 1078a46c0ec8Sopenharmony_ci * 1079a46c0ec8Sopenharmony_ci * @return A touch event, or NULL for other events 1080a46c0ec8Sopenharmony_ci */ 1081a46c0ec8Sopenharmony_cistruct libinput_event_touch * 1082a46c0ec8Sopenharmony_cilibinput_event_get_touch_event(struct libinput_event *event); 1083a46c0ec8Sopenharmony_ci 1084a46c0ec8Sopenharmony_ci/** 1085a46c0ec8Sopenharmony_ci * @ingroup event 1086a46c0ec8Sopenharmony_ci * 1087a46c0ec8Sopenharmony_ci * Return the gesture event that is this input event. If the event type does 1088a46c0ec8Sopenharmony_ci * not match the gesture event types, this function returns NULL. 1089a46c0ec8Sopenharmony_ci * 1090a46c0ec8Sopenharmony_ci * A gesture's lifetime has three distinct stages: begin, update and end, each 1091a46c0ec8Sopenharmony_ci * with their own event types. Begin is sent when the fingers are first set 1092a46c0ec8Sopenharmony_ci * down or libinput decides that the gesture begins. For @ref 1093a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_GESTURE_PINCH_BEGIN this sets the initial scale. Any 1094a46c0ec8Sopenharmony_ci * events changing properties of the gesture are sent as update events. On 1095a46c0ec8Sopenharmony_ci * termination of the gesture, an end event is sent. 1096a46c0ec8Sopenharmony_ci * 1097a46c0ec8Sopenharmony_ci * The inverse of this function is libinput_event_gesture_get_base_event(). 1098a46c0ec8Sopenharmony_ci * 1099a46c0ec8Sopenharmony_ci * @return A gesture event, or NULL for other events 1100a46c0ec8Sopenharmony_ci */ 1101a46c0ec8Sopenharmony_cistruct libinput_event_gesture * 1102a46c0ec8Sopenharmony_cilibinput_event_get_gesture_event(struct libinput_event *event); 1103a46c0ec8Sopenharmony_ci 1104a46c0ec8Sopenharmony_ci/** 1105a46c0ec8Sopenharmony_ci * @ingroup event 1106a46c0ec8Sopenharmony_ci * 1107a46c0ec8Sopenharmony_ci * Return the tablet tool event that is this input event. If the event type 1108a46c0ec8Sopenharmony_ci * does not match the tablet tool event types, this function returns NULL. 1109a46c0ec8Sopenharmony_ci * 1110a46c0ec8Sopenharmony_ci * The inverse of this function is libinput_event_tablet_tool_get_base_event(). 1111a46c0ec8Sopenharmony_ci * 1112a46c0ec8Sopenharmony_ci * @return A tablet tool event, or NULL for other events 1113a46c0ec8Sopenharmony_ci * 1114a46c0ec8Sopenharmony_ci * @since 1.2 1115a46c0ec8Sopenharmony_ci */ 1116a46c0ec8Sopenharmony_cistruct libinput_event_tablet_tool * 1117a46c0ec8Sopenharmony_cilibinput_event_get_tablet_tool_event(struct libinput_event *event); 1118a46c0ec8Sopenharmony_ci 1119a46c0ec8Sopenharmony_ci/** 1120a46c0ec8Sopenharmony_ci * @ingroup event 1121a46c0ec8Sopenharmony_ci * 1122a46c0ec8Sopenharmony_ci * Return the tablet pad event that is this input event. If the event type does not 1123a46c0ec8Sopenharmony_ci * match the tablet pad event types, this function returns NULL. 1124a46c0ec8Sopenharmony_ci * 1125a46c0ec8Sopenharmony_ci * The inverse of this function is libinput_event_tablet_pad_get_base_event(). 1126a46c0ec8Sopenharmony_ci * 1127a46c0ec8Sopenharmony_ci * @return A tablet pad event, or NULL for other events 1128a46c0ec8Sopenharmony_ci */ 1129a46c0ec8Sopenharmony_cistruct libinput_event_tablet_pad * 1130a46c0ec8Sopenharmony_cilibinput_event_get_tablet_pad_event(struct libinput_event *event); 1131a46c0ec8Sopenharmony_ci 1132a46c0ec8Sopenharmony_ci/** 1133a46c0ec8Sopenharmony_ci * @ingroup event 1134a46c0ec8Sopenharmony_ci * 1135a46c0ec8Sopenharmony_ci * Return the switch event that is this input event. If the event type does 1136a46c0ec8Sopenharmony_ci * not match the switch event types, this function returns NULL. 1137a46c0ec8Sopenharmony_ci * 1138a46c0ec8Sopenharmony_ci * The inverse of this function is libinput_event_switch_get_base_event(). 1139a46c0ec8Sopenharmony_ci * 1140a46c0ec8Sopenharmony_ci * @return A switch event, or NULL for other events 1141a46c0ec8Sopenharmony_ci * 1142a46c0ec8Sopenharmony_ci * @since 1.7 1143a46c0ec8Sopenharmony_ci */ 1144a46c0ec8Sopenharmony_cistruct libinput_event_switch * 1145a46c0ec8Sopenharmony_cilibinput_event_get_switch_event(struct libinput_event *event); 1146a46c0ec8Sopenharmony_ci 1147a46c0ec8Sopenharmony_ci/** 1148a46c0ec8Sopenharmony_ci * @ingroup event 1149a46c0ec8Sopenharmony_ci * 1150a46c0ec8Sopenharmony_ci * Return the device event that is this input event. If the event type does 1151a46c0ec8Sopenharmony_ci * not match the device event types, this function returns NULL. 1152a46c0ec8Sopenharmony_ci * 1153a46c0ec8Sopenharmony_ci * The inverse of this function is 1154a46c0ec8Sopenharmony_ci * libinput_event_device_notify_get_base_event(). 1155a46c0ec8Sopenharmony_ci * 1156a46c0ec8Sopenharmony_ci * @return A device event, or NULL for other events 1157a46c0ec8Sopenharmony_ci */ 1158a46c0ec8Sopenharmony_cistruct libinput_event_device_notify * 1159a46c0ec8Sopenharmony_cilibinput_event_get_device_notify_event(struct libinput_event *event); 1160a46c0ec8Sopenharmony_ci 1161a46c0ec8Sopenharmony_ci/** 1162a46c0ec8Sopenharmony_ci * @ingroup event 1163a46c0ec8Sopenharmony_ci * 1164a46c0ec8Sopenharmony_ci * @return The generic libinput_event of this event 1165a46c0ec8Sopenharmony_ci */ 1166a46c0ec8Sopenharmony_cistruct libinput_event * 1167a46c0ec8Sopenharmony_cilibinput_event_device_notify_get_base_event(struct libinput_event_device_notify *event); 1168a46c0ec8Sopenharmony_ci 1169a46c0ec8Sopenharmony_ci/** 1170a46c0ec8Sopenharmony_ci * @defgroup event_keyboard Keyboard events 1171a46c0ec8Sopenharmony_ci * 1172a46c0ec8Sopenharmony_ci * Key events are generated when a key changes its logical state, usually by 1173a46c0ec8Sopenharmony_ci * being pressed or released. 1174a46c0ec8Sopenharmony_ci */ 1175a46c0ec8Sopenharmony_ci 1176a46c0ec8Sopenharmony_ci/** 1177a46c0ec8Sopenharmony_ci * @ingroup event_keyboard 1178a46c0ec8Sopenharmony_ci * 1179a46c0ec8Sopenharmony_ci * @note Timestamps may not always increase. See the libinput documentation 1180a46c0ec8Sopenharmony_ci * for more details. 1181a46c0ec8Sopenharmony_ci * 1182a46c0ec8Sopenharmony_ci * @return The event time for this event 1183a46c0ec8Sopenharmony_ci */ 1184a46c0ec8Sopenharmony_ciuint32_t 1185a46c0ec8Sopenharmony_cilibinput_event_keyboard_get_time(struct libinput_event_keyboard *event); 1186a46c0ec8Sopenharmony_ci 1187a46c0ec8Sopenharmony_ci/** 1188a46c0ec8Sopenharmony_ci * @ingroup event_keyboard 1189a46c0ec8Sopenharmony_ci * 1190a46c0ec8Sopenharmony_ci * @note Timestamps may not always increase. See the libinput documentation 1191a46c0ec8Sopenharmony_ci * for more details. 1192a46c0ec8Sopenharmony_ci * 1193a46c0ec8Sopenharmony_ci * @return The event time for this event in microseconds 1194a46c0ec8Sopenharmony_ci */ 1195a46c0ec8Sopenharmony_ciuint64_t 1196a46c0ec8Sopenharmony_cilibinput_event_keyboard_get_time_usec(struct libinput_event_keyboard *event); 1197a46c0ec8Sopenharmony_ci 1198a46c0ec8Sopenharmony_ci/** 1199a46c0ec8Sopenharmony_ci * @ingroup event_keyboard 1200a46c0ec8Sopenharmony_ci * 1201a46c0ec8Sopenharmony_ci * @return The keycode that triggered this key event 1202a46c0ec8Sopenharmony_ci */ 1203a46c0ec8Sopenharmony_ciuint32_t 1204a46c0ec8Sopenharmony_cilibinput_event_keyboard_get_key(struct libinput_event_keyboard *event); 1205a46c0ec8Sopenharmony_ci 1206a46c0ec8Sopenharmony_ci/** 1207a46c0ec8Sopenharmony_ci * @ingroup event_keyboard 1208a46c0ec8Sopenharmony_ci * 1209a46c0ec8Sopenharmony_ci * @return The state change of the key 1210a46c0ec8Sopenharmony_ci */ 1211a46c0ec8Sopenharmony_cienum libinput_key_state 1212a46c0ec8Sopenharmony_cilibinput_event_keyboard_get_key_state(struct libinput_event_keyboard *event); 1213a46c0ec8Sopenharmony_ci 1214a46c0ec8Sopenharmony_ci/** 1215a46c0ec8Sopenharmony_ci * @ingroup event_keyboard 1216a46c0ec8Sopenharmony_ci * 1217a46c0ec8Sopenharmony_ci * @return The generic libinput_event of this event 1218a46c0ec8Sopenharmony_ci */ 1219a46c0ec8Sopenharmony_cistruct libinput_event * 1220a46c0ec8Sopenharmony_cilibinput_event_keyboard_get_base_event(struct libinput_event_keyboard *event); 1221a46c0ec8Sopenharmony_ci 1222a46c0ec8Sopenharmony_ci/** 1223a46c0ec8Sopenharmony_ci * @ingroup event_keyboard 1224a46c0ec8Sopenharmony_ci * 1225a46c0ec8Sopenharmony_ci * For the key of a @ref LIBINPUT_EVENT_KEYBOARD_KEY event, return the total number 1226a46c0ec8Sopenharmony_ci * of keys pressed on all devices on the associated seat after the event was 1227a46c0ec8Sopenharmony_ci * triggered. 1228a46c0ec8Sopenharmony_ci * 1229a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other than 1230a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_KEYBOARD_KEY. For other events, this function returns 0. 1231a46c0ec8Sopenharmony_ci * 1232a46c0ec8Sopenharmony_ci * @return The seat wide pressed key count for the key of this event 1233a46c0ec8Sopenharmony_ci */ 1234a46c0ec8Sopenharmony_ciuint32_t 1235a46c0ec8Sopenharmony_cilibinput_event_keyboard_get_seat_key_count( 1236a46c0ec8Sopenharmony_ci struct libinput_event_keyboard *event); 1237a46c0ec8Sopenharmony_ci 1238a46c0ec8Sopenharmony_ci/** 1239a46c0ec8Sopenharmony_ci * @defgroup event_pointer Pointer events 1240a46c0ec8Sopenharmony_ci * 1241a46c0ec8Sopenharmony_ci * Pointer events reflect motion, button and scroll events, as well as 1242a46c0ec8Sopenharmony_ci * events from other axes. 1243a46c0ec8Sopenharmony_ci */ 1244a46c0ec8Sopenharmony_ci 1245a46c0ec8Sopenharmony_ci/** 1246a46c0ec8Sopenharmony_ci * @ingroup event_pointer 1247a46c0ec8Sopenharmony_ci * 1248a46c0ec8Sopenharmony_ci * @note Timestamps may not always increase. See the libinput documentation 1249a46c0ec8Sopenharmony_ci * for more details. 1250a46c0ec8Sopenharmony_ci * 1251a46c0ec8Sopenharmony_ci * @return The event time for this event 1252a46c0ec8Sopenharmony_ci */ 1253a46c0ec8Sopenharmony_ciuint32_t 1254a46c0ec8Sopenharmony_cilibinput_event_pointer_get_time(struct libinput_event_pointer *event); 1255a46c0ec8Sopenharmony_ci 1256a46c0ec8Sopenharmony_ci/** 1257a46c0ec8Sopenharmony_ci * @ingroup event_pointer 1258a46c0ec8Sopenharmony_ci * 1259a46c0ec8Sopenharmony_ci * @note Timestamps may not always increase. See the libinput documentation 1260a46c0ec8Sopenharmony_ci * for more details. 1261a46c0ec8Sopenharmony_ci * 1262a46c0ec8Sopenharmony_ci * @return The event time for this event in microseconds 1263a46c0ec8Sopenharmony_ci */ 1264a46c0ec8Sopenharmony_ciuint64_t 1265a46c0ec8Sopenharmony_cilibinput_event_pointer_get_time_usec(struct libinput_event_pointer *event); 1266a46c0ec8Sopenharmony_ci 1267a46c0ec8Sopenharmony_ci/** 1268a46c0ec8Sopenharmony_ci * @ingroup event_pointer 1269a46c0ec8Sopenharmony_ci * 1270a46c0ec8Sopenharmony_ci * Return the delta between the last event and the current event. For pointer 1271a46c0ec8Sopenharmony_ci * events that are not of type @ref LIBINPUT_EVENT_POINTER_MOTION, this 1272a46c0ec8Sopenharmony_ci * function returns 0. 1273a46c0ec8Sopenharmony_ci * 1274a46c0ec8Sopenharmony_ci * If a device employs pointer acceleration, the delta returned by this 1275a46c0ec8Sopenharmony_ci * function is the accelerated delta. 1276a46c0ec8Sopenharmony_ci * 1277a46c0ec8Sopenharmony_ci * Relative motion deltas are to be interpreted as pixel movement of a 1278a46c0ec8Sopenharmony_ci * standardized mouse. See the libinput documentation for more details. 1279a46c0ec8Sopenharmony_ci * 1280a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other than 1281a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_MOTION. 1282a46c0ec8Sopenharmony_ci * 1283a46c0ec8Sopenharmony_ci * @return The relative x movement since the last event 1284a46c0ec8Sopenharmony_ci */ 1285a46c0ec8Sopenharmony_cidouble 1286a46c0ec8Sopenharmony_cilibinput_event_pointer_get_dx(struct libinput_event_pointer *event); 1287a46c0ec8Sopenharmony_ci 1288a46c0ec8Sopenharmony_ci/** 1289a46c0ec8Sopenharmony_ci * @ingroup event_pointer 1290a46c0ec8Sopenharmony_ci * 1291a46c0ec8Sopenharmony_ci * Return the delta between the last event and the current event. For pointer 1292a46c0ec8Sopenharmony_ci * events that are not of type @ref LIBINPUT_EVENT_POINTER_MOTION, this 1293a46c0ec8Sopenharmony_ci * function returns 0. 1294a46c0ec8Sopenharmony_ci * 1295a46c0ec8Sopenharmony_ci * If a device employs pointer acceleration, the delta returned by this 1296a46c0ec8Sopenharmony_ci * function is the accelerated delta. 1297a46c0ec8Sopenharmony_ci * 1298a46c0ec8Sopenharmony_ci * Relative motion deltas are to be interpreted as pixel movement of a 1299a46c0ec8Sopenharmony_ci * standardized mouse. See the libinput documentation for more details. 1300a46c0ec8Sopenharmony_ci * 1301a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other than 1302a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_MOTION. 1303a46c0ec8Sopenharmony_ci * 1304a46c0ec8Sopenharmony_ci * @return The relative y movement since the last event 1305a46c0ec8Sopenharmony_ci */ 1306a46c0ec8Sopenharmony_cidouble 1307a46c0ec8Sopenharmony_cilibinput_event_pointer_get_dy(struct libinput_event_pointer *event); 1308a46c0ec8Sopenharmony_ci 1309a46c0ec8Sopenharmony_ci/** 1310a46c0ec8Sopenharmony_ci * @ingroup event_pointer 1311a46c0ec8Sopenharmony_ci * 1312a46c0ec8Sopenharmony_ci * Return the relative delta of the unaccelerated motion vector of the 1313a46c0ec8Sopenharmony_ci * current event. For pointer events that are not of type @ref 1314a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_POINTER_MOTION, this function returns 0. 1315a46c0ec8Sopenharmony_ci * 1316a46c0ec8Sopenharmony_ci * Relative unaccelerated motion deltas are raw device coordinates. 1317a46c0ec8Sopenharmony_ci * Note that these coordinates are subject to the device's native 1318a46c0ec8Sopenharmony_ci * resolution. Touchpad coordinates represent raw device coordinates in the 1319a46c0ec8Sopenharmony_ci * X resolution of the touchpad. See the libinput documentation for more 1320a46c0ec8Sopenharmony_ci * details. 1321a46c0ec8Sopenharmony_ci * 1322a46c0ec8Sopenharmony_ci * Any rotation applied to the device also applies to unaccelerated motion 1323a46c0ec8Sopenharmony_ci * (see libinput_device_config_rotation_set_angle()). 1324a46c0ec8Sopenharmony_ci * 1325a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other than 1326a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_MOTION. 1327a46c0ec8Sopenharmony_ci * 1328a46c0ec8Sopenharmony_ci * @return The unaccelerated relative x movement since the last event 1329a46c0ec8Sopenharmony_ci */ 1330a46c0ec8Sopenharmony_cidouble 1331a46c0ec8Sopenharmony_cilibinput_event_pointer_get_dx_unaccelerated( 1332a46c0ec8Sopenharmony_ci struct libinput_event_pointer *event); 1333a46c0ec8Sopenharmony_ci 1334a46c0ec8Sopenharmony_ci/** 1335a46c0ec8Sopenharmony_ci * @ingroup event_pointer 1336a46c0ec8Sopenharmony_ci * 1337a46c0ec8Sopenharmony_ci * Return the relative delta of the unaccelerated motion vector of the 1338a46c0ec8Sopenharmony_ci * current event. For pointer events that are not of type @ref 1339a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_POINTER_MOTION, this function returns 0. 1340a46c0ec8Sopenharmony_ci * 1341a46c0ec8Sopenharmony_ci * Relative unaccelerated motion deltas are raw device coordinates. 1342a46c0ec8Sopenharmony_ci * Note that these coordinates are subject to the device's native 1343a46c0ec8Sopenharmony_ci * resolution. Touchpad coordinates represent raw device coordinates in the 1344a46c0ec8Sopenharmony_ci * X resolution of the touchpad. See the libinput documentation for more 1345a46c0ec8Sopenharmony_ci * details. 1346a46c0ec8Sopenharmony_ci * 1347a46c0ec8Sopenharmony_ci * Any rotation applied to the device also applies to unaccelerated motion 1348a46c0ec8Sopenharmony_ci * (see libinput_device_config_rotation_set_angle()). 1349a46c0ec8Sopenharmony_ci * 1350a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other than 1351a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_MOTION. 1352a46c0ec8Sopenharmony_ci * 1353a46c0ec8Sopenharmony_ci * @return The unaccelerated relative y movement since the last event 1354a46c0ec8Sopenharmony_ci */ 1355a46c0ec8Sopenharmony_cidouble 1356a46c0ec8Sopenharmony_cilibinput_event_pointer_get_dy_unaccelerated( 1357a46c0ec8Sopenharmony_ci struct libinput_event_pointer *event); 1358a46c0ec8Sopenharmony_ci 1359a46c0ec8Sopenharmony_ci/** 1360a46c0ec8Sopenharmony_ci * @ingroup event_pointer 1361a46c0ec8Sopenharmony_ci * 1362a46c0ec8Sopenharmony_ci * Return the current absolute x coordinate of the pointer event, in mm from 1363a46c0ec8Sopenharmony_ci * the top left corner of the device. To get the corresponding output screen 1364a46c0ec8Sopenharmony_ci * coordinate, use libinput_event_pointer_get_absolute_x_transformed(). 1365a46c0ec8Sopenharmony_ci * 1366a46c0ec8Sopenharmony_ci * For pointer events that are not of type 1367a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE, this function returns 0. 1368a46c0ec8Sopenharmony_ci * 1369a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other than 1370a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE. 1371a46c0ec8Sopenharmony_ci * 1372a46c0ec8Sopenharmony_ci * @return The current absolute x coordinate 1373a46c0ec8Sopenharmony_ci */ 1374a46c0ec8Sopenharmony_cidouble 1375a46c0ec8Sopenharmony_cilibinput_event_pointer_get_absolute_x(struct libinput_event_pointer *event); 1376a46c0ec8Sopenharmony_ci 1377a46c0ec8Sopenharmony_ci/** 1378a46c0ec8Sopenharmony_ci * @ingroup event_pointer 1379a46c0ec8Sopenharmony_ci * 1380a46c0ec8Sopenharmony_ci * Return the current absolute y coordinate of the pointer event, in mm from 1381a46c0ec8Sopenharmony_ci * the top left corner of the device. To get the corresponding output screen 1382a46c0ec8Sopenharmony_ci * coordinate, use libinput_event_pointer_get_absolute_y_transformed(). 1383a46c0ec8Sopenharmony_ci * 1384a46c0ec8Sopenharmony_ci * For pointer events that are not of type 1385a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE, this function returns 0. 1386a46c0ec8Sopenharmony_ci * 1387a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other than 1388a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE. 1389a46c0ec8Sopenharmony_ci * 1390a46c0ec8Sopenharmony_ci * @return The current absolute y coordinate 1391a46c0ec8Sopenharmony_ci */ 1392a46c0ec8Sopenharmony_cidouble 1393a46c0ec8Sopenharmony_cilibinput_event_pointer_get_absolute_y(struct libinput_event_pointer *event); 1394a46c0ec8Sopenharmony_ci 1395a46c0ec8Sopenharmony_ci/** 1396a46c0ec8Sopenharmony_ci * @ingroup event_pointer 1397a46c0ec8Sopenharmony_ci * 1398a46c0ec8Sopenharmony_ci * Return the current absolute x coordinate of the pointer event, transformed to 1399a46c0ec8Sopenharmony_ci * screen coordinates. 1400a46c0ec8Sopenharmony_ci * 1401a46c0ec8Sopenharmony_ci * For pointer events that are not of type 1402a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE, the return value of this 1403a46c0ec8Sopenharmony_ci * function is undefined. 1404a46c0ec8Sopenharmony_ci * 1405a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other than 1406a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE. 1407a46c0ec8Sopenharmony_ci * 1408a46c0ec8Sopenharmony_ci * @param event The libinput pointer event 1409a46c0ec8Sopenharmony_ci * @param width The current output screen width 1410a46c0ec8Sopenharmony_ci * @return The current absolute x coordinate transformed to a screen coordinate 1411a46c0ec8Sopenharmony_ci */ 1412a46c0ec8Sopenharmony_cidouble 1413a46c0ec8Sopenharmony_cilibinput_event_pointer_get_absolute_x_transformed( 1414a46c0ec8Sopenharmony_ci struct libinput_event_pointer *event, 1415a46c0ec8Sopenharmony_ci uint32_t width); 1416a46c0ec8Sopenharmony_ci 1417a46c0ec8Sopenharmony_ci/** 1418a46c0ec8Sopenharmony_ci * @ingroup event_pointer 1419a46c0ec8Sopenharmony_ci * 1420a46c0ec8Sopenharmony_ci * Return the current absolute y coordinate of the pointer event, transformed to 1421a46c0ec8Sopenharmony_ci * screen coordinates. 1422a46c0ec8Sopenharmony_ci * 1423a46c0ec8Sopenharmony_ci * For pointer events that are not of type 1424a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE, the return value of this function is 1425a46c0ec8Sopenharmony_ci * undefined. 1426a46c0ec8Sopenharmony_ci * 1427a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other than 1428a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE. 1429a46c0ec8Sopenharmony_ci * 1430a46c0ec8Sopenharmony_ci * @param event The libinput pointer event 1431a46c0ec8Sopenharmony_ci * @param height The current output screen height 1432a46c0ec8Sopenharmony_ci * @return The current absolute y coordinate transformed to a screen coordinate 1433a46c0ec8Sopenharmony_ci */ 1434a46c0ec8Sopenharmony_cidouble 1435a46c0ec8Sopenharmony_cilibinput_event_pointer_get_absolute_y_transformed( 1436a46c0ec8Sopenharmony_ci struct libinput_event_pointer *event, 1437a46c0ec8Sopenharmony_ci uint32_t height); 1438a46c0ec8Sopenharmony_ci 1439a46c0ec8Sopenharmony_ci/** 1440a46c0ec8Sopenharmony_ci * @ingroup event_pointer 1441a46c0ec8Sopenharmony_ci * 1442a46c0ec8Sopenharmony_ci * Return the button that triggered this event. 1443a46c0ec8Sopenharmony_ci * For pointer events that are not of type @ref 1444a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_POINTER_BUTTON, this function returns 0. 1445a46c0ec8Sopenharmony_ci * 1446a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other than 1447a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_BUTTON. 1448a46c0ec8Sopenharmony_ci * 1449a46c0ec8Sopenharmony_ci * @return The button triggering this event 1450a46c0ec8Sopenharmony_ci */ 1451a46c0ec8Sopenharmony_ciuint32_t 1452a46c0ec8Sopenharmony_cilibinput_event_pointer_get_button(struct libinput_event_pointer *event); 1453a46c0ec8Sopenharmony_ci 1454a46c0ec8Sopenharmony_ci/** 1455a46c0ec8Sopenharmony_ci * @ingroup event_pointer 1456a46c0ec8Sopenharmony_ci * 1457a46c0ec8Sopenharmony_ci * Return the button state that triggered this event. 1458a46c0ec8Sopenharmony_ci * For pointer events that are not of type @ref 1459a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_POINTER_BUTTON, this function returns 0. 1460a46c0ec8Sopenharmony_ci * 1461a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other than 1462a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_BUTTON. 1463a46c0ec8Sopenharmony_ci * 1464a46c0ec8Sopenharmony_ci * @return The button state triggering this event 1465a46c0ec8Sopenharmony_ci */ 1466a46c0ec8Sopenharmony_cienum libinput_button_state 1467a46c0ec8Sopenharmony_cilibinput_event_pointer_get_button_state(struct libinput_event_pointer *event); 1468a46c0ec8Sopenharmony_ci 1469a46c0ec8Sopenharmony_ci/** 1470a46c0ec8Sopenharmony_ci * @ingroup event_pointer 1471a46c0ec8Sopenharmony_ci * 1472a46c0ec8Sopenharmony_ci * For the button of a @ref LIBINPUT_EVENT_POINTER_BUTTON event, return the 1473a46c0ec8Sopenharmony_ci * total number of buttons pressed on all devices on the associated seat 1474a46c0ec8Sopenharmony_ci * after the event was triggered. 1475a46c0ec8Sopenharmony_ci * 1476a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other than 1477a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_BUTTON. For other events, this function 1478a46c0ec8Sopenharmony_ci * returns 0. 1479a46c0ec8Sopenharmony_ci * 1480a46c0ec8Sopenharmony_ci * @return The seat wide pressed button count for the key of this event 1481a46c0ec8Sopenharmony_ci */ 1482a46c0ec8Sopenharmony_ciuint32_t 1483a46c0ec8Sopenharmony_cilibinput_event_pointer_get_seat_button_count( 1484a46c0ec8Sopenharmony_ci struct libinput_event_pointer *event); 1485a46c0ec8Sopenharmony_ci 1486a46c0ec8Sopenharmony_ci/** 1487a46c0ec8Sopenharmony_ci * @ingroup event_pointer 1488a46c0ec8Sopenharmony_ci * 1489a46c0ec8Sopenharmony_ci * Check if the event has a valid value for the given axis. 1490a46c0ec8Sopenharmony_ci * 1491a46c0ec8Sopenharmony_ci * If this function returns non-zero for an axis and 1492a46c0ec8Sopenharmony_ci * libinput_event_pointer_get_axis_value() returns a value of 0, the event 1493a46c0ec8Sopenharmony_ci * is a scroll stop event. 1494a46c0ec8Sopenharmony_ci * 1495a46c0ec8Sopenharmony_ci * For pointer events that are not of type @ref LIBINPUT_EVENT_POINTER_AXIS, 1496a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_SCROLL_WHEEL, @ref 1497a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_POINTER_SCROLL_FINGER, or @ref 1498a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_POINTER_SCROLL_CONTINUOUS this function returns 0. 1499a46c0ec8Sopenharmony_ci * 1500a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other than 1501a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_AXIS, 1502a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_SCROLL_WHEEL, 1503a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_SCROLL_FINGER, or 1504a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_SCROLL_CONTINUOUS. 1505a46c0ec8Sopenharmony_ci * 1506a46c0ec8Sopenharmony_ci * @return Non-zero if this event contains a value for this axis 1507a46c0ec8Sopenharmony_ci */ 1508a46c0ec8Sopenharmony_ciint 1509a46c0ec8Sopenharmony_cilibinput_event_pointer_has_axis(struct libinput_event_pointer *event, 1510a46c0ec8Sopenharmony_ci enum libinput_pointer_axis axis); 1511a46c0ec8Sopenharmony_ci 1512a46c0ec8Sopenharmony_ci/** 1513a46c0ec8Sopenharmony_ci * @ingroup event_pointer 1514a46c0ec8Sopenharmony_ci * 1515a46c0ec8Sopenharmony_ci * Return the axis value of the given axis. The interpretation of the value 1516a46c0ec8Sopenharmony_ci * depends on the axis. For the two scrolling axes 1517a46c0ec8Sopenharmony_ci * @ref LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL and 1518a46c0ec8Sopenharmony_ci * @ref LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL, the value of the event is in 1519a46c0ec8Sopenharmony_ci * relative scroll units, with the positive direction being down or right, 1520a46c0ec8Sopenharmony_ci * respectively. For the interpretation of the value, see 1521a46c0ec8Sopenharmony_ci * libinput_event_pointer_get_axis_source(). 1522a46c0ec8Sopenharmony_ci * 1523a46c0ec8Sopenharmony_ci * If libinput_event_pointer_has_axis() returns 0 for an axis, this function 1524a46c0ec8Sopenharmony_ci * returns 0 for that axis. 1525a46c0ec8Sopenharmony_ci * 1526a46c0ec8Sopenharmony_ci * For pointer events that are not of type @ref LIBINPUT_EVENT_POINTER_AXIS, 1527a46c0ec8Sopenharmony_ci * this function returns 0. 1528a46c0ec8Sopenharmony_ci * 1529a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other than 1530a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_AXIS. 1531a46c0ec8Sopenharmony_ci * 1532a46c0ec8Sopenharmony_ci * @return The axis value of this event 1533a46c0ec8Sopenharmony_ci * 1534a46c0ec8Sopenharmony_ci * @see libinput_event_pointer_get_axis_value_discrete 1535a46c0ec8Sopenharmony_ci */ 1536a46c0ec8Sopenharmony_cidouble 1537a46c0ec8Sopenharmony_cilibinput_event_pointer_get_axis_value(struct libinput_event_pointer *event, 1538a46c0ec8Sopenharmony_ci enum libinput_pointer_axis axis); 1539a46c0ec8Sopenharmony_ci 1540a46c0ec8Sopenharmony_ci/** 1541a46c0ec8Sopenharmony_ci * @ingroup event_pointer 1542a46c0ec8Sopenharmony_ci * 1543a46c0ec8Sopenharmony_ci * Return the source for a given axis event. Axis events (scroll events) can 1544a46c0ec8Sopenharmony_ci * be caused by a hardware item such as a scroll wheel or emulated from 1545a46c0ec8Sopenharmony_ci * other input sources, such as two-finger or edge scrolling on a 1546a46c0ec8Sopenharmony_ci * touchpad. 1547a46c0ec8Sopenharmony_ci * 1548a46c0ec8Sopenharmony_ci * If the source is @ref LIBINPUT_POINTER_AXIS_SOURCE_FINGER, libinput 1549a46c0ec8Sopenharmony_ci * guarantees that a scroll sequence is terminated with a scroll value of 0. 1550a46c0ec8Sopenharmony_ci * A caller may use this information to decide on whether kinetic scrolling 1551a46c0ec8Sopenharmony_ci * should be triggered on this scroll sequence. 1552a46c0ec8Sopenharmony_ci * The coordinate system is identical to the cursor movement, i.e. a 1553a46c0ec8Sopenharmony_ci * scroll value of 1 represents the equivalent relative motion of 1. 1554a46c0ec8Sopenharmony_ci * 1555a46c0ec8Sopenharmony_ci * If the source is @ref LIBINPUT_POINTER_AXIS_SOURCE_WHEEL, no terminating 1556a46c0ec8Sopenharmony_ci * event is guaranteed (though it may happen). 1557a46c0ec8Sopenharmony_ci * Scrolling is in discrete steps, the value is the angle the wheel moved 1558a46c0ec8Sopenharmony_ci * in degrees. The default is 15 degrees per wheel click, but some mice may 1559a46c0ec8Sopenharmony_ci * have differently grained wheels. It is up to the caller how to interpret 1560a46c0ec8Sopenharmony_ci * such different step sizes. Callers should use 1561a46c0ec8Sopenharmony_ci * libinput_event_pointer_get_scroll_value_v120() for a simpler API of 1562a46c0ec8Sopenharmony_ci * handling scroll wheel events of different step sizes. 1563a46c0ec8Sopenharmony_ci * 1564a46c0ec8Sopenharmony_ci * If the source is @ref LIBINPUT_POINTER_AXIS_SOURCE_CONTINUOUS, libinput 1565a46c0ec8Sopenharmony_ci * guarantees that a scroll sequence is terminated with a scroll value of 0. 1566a46c0ec8Sopenharmony_ci * The coordinate system is identical to the cursor movement, i.e. a 1567a46c0ec8Sopenharmony_ci * scroll value of 1 represents the equivalent relative motion of 1. 1568a46c0ec8Sopenharmony_ci * 1569a46c0ec8Sopenharmony_ci * @deprecated The source @ref LIBINPUT_POINTER_AXIS_SOURCE_WHEEL_TILT is 1570a46c0ec8Sopenharmony_ci * deprecated as of libinput 1.16. No device has ever sent this source. 1571a46c0ec8Sopenharmony_ci * 1572a46c0ec8Sopenharmony_ci * For pointer events that are not of type @ref LIBINPUT_EVENT_POINTER_AXIS, 1573a46c0ec8Sopenharmony_ci * this function returns 0. 1574a46c0ec8Sopenharmony_ci * 1575a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other than 1576a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_AXIS. 1577a46c0ec8Sopenharmony_ci * 1578a46c0ec8Sopenharmony_ci * @note This function is superfluous as of libinput 1.19. The event 1579a46c0ec8Sopenharmony_ci * codes for @ref LIBINPUT_EVENT_POINTER_SCROLL_WHEEL, @ref 1580a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_POINTER_SCROLL_FINGER and @ref 1581a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_POINTER_SCROLL_CONTINUOUS have the axis source encoded in 1582a46c0ec8Sopenharmony_ci * the event type. 1583a46c0ec8Sopenharmony_ci * 1584a46c0ec8Sopenharmony_ci * @return The source for this axis event 1585a46c0ec8Sopenharmony_ci */ 1586a46c0ec8Sopenharmony_cienum libinput_pointer_axis_source 1587a46c0ec8Sopenharmony_cilibinput_event_pointer_get_axis_source(struct libinput_event_pointer *event); 1588a46c0ec8Sopenharmony_ci 1589a46c0ec8Sopenharmony_ci/** 1590a46c0ec8Sopenharmony_ci * @ingroup event_pointer 1591a46c0ec8Sopenharmony_ci * 1592a46c0ec8Sopenharmony_ci * Return the axis value in discrete steps for a given axis event. How a 1593a46c0ec8Sopenharmony_ci * value translates into a discrete step depends on the source. 1594a46c0ec8Sopenharmony_ci * 1595a46c0ec8Sopenharmony_ci * @note This function does not support high-resolution mouse wheels and 1596a46c0ec8Sopenharmony_ci * should be considered deprecated as of libinput 1.19. Callers should use 1597a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_SCROLL_WHEEL and 1598a46c0ec8Sopenharmony_ci * libinput_event_pointer_get_scroll_value_v120() instead. 1599a46c0ec8Sopenharmony_ci * 1600a46c0ec8Sopenharmony_ci * If the event is not of type @ref LIBINPUT_EVENT_POINTER_AXIS, this 1601a46c0ec8Sopenharmony_ci * function returns 0. 1602a46c0ec8Sopenharmony_ci * 1603a46c0ec8Sopenharmony_ci * If the source is @ref LIBINPUT_POINTER_AXIS_SOURCE_WHEEL, the discrete 1604a46c0ec8Sopenharmony_ci * value correspond to the number of physical mouse wheel clicks. 1605a46c0ec8Sopenharmony_ci * 1606a46c0ec8Sopenharmony_ci * If the source is @ref LIBINPUT_POINTER_AXIS_SOURCE_CONTINUOUS or @ref 1607a46c0ec8Sopenharmony_ci * LIBINPUT_POINTER_AXIS_SOURCE_FINGER, the discrete value is always 0. 1608a46c0ec8Sopenharmony_ci * 1609a46c0ec8Sopenharmony_ci * @return The discrete value for the given event. 1610a46c0ec8Sopenharmony_ci * 1611a46c0ec8Sopenharmony_ci * @see libinput_event_pointer_get_axis_value 1612a46c0ec8Sopenharmony_ci * @see libinput_event_pointer_get_scroll_value_v120 1613a46c0ec8Sopenharmony_ci */ 1614a46c0ec8Sopenharmony_cidouble 1615a46c0ec8Sopenharmony_cilibinput_event_pointer_get_axis_value_discrete(struct libinput_event_pointer *event, 1616a46c0ec8Sopenharmony_ci enum libinput_pointer_axis axis); 1617a46c0ec8Sopenharmony_ci 1618a46c0ec8Sopenharmony_ci/** 1619a46c0ec8Sopenharmony_ci * @ingroup event_pointer 1620a46c0ec8Sopenharmony_ci * 1621a46c0ec8Sopenharmony_ci * Return the axis value of the given axis. The interpretation of the value 1622a46c0ec8Sopenharmony_ci * depends on the axis. For the two scrolling axes 1623a46c0ec8Sopenharmony_ci * @ref LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL and 1624a46c0ec8Sopenharmony_ci * @ref LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL, the value of the event is in 1625a46c0ec8Sopenharmony_ci * relative scroll units, with the positive direction being down or right, 1626a46c0ec8Sopenharmony_ci * respectively. If libinput_event_pointer_has_axis() returns 0 for an axis, 1627a46c0ec8Sopenharmony_ci * this function returns 0 for that axis. 1628a46c0ec8Sopenharmony_ci * 1629a46c0ec8Sopenharmony_ci * If the event is @ref LIBINPUT_EVENT_POINTER_SCROLL_FINGER, libinput 1630a46c0ec8Sopenharmony_ci * guarantees that a scroll sequence is terminated with a scroll value of 0. 1631a46c0ec8Sopenharmony_ci * A caller may use this information to decide on whether kinetic scrolling 1632a46c0ec8Sopenharmony_ci * should be triggered on this scroll sequence. 1633a46c0ec8Sopenharmony_ci * The coordinate system is identical to the cursor movement, i.e. a 1634a46c0ec8Sopenharmony_ci * scroll value of 1 represents the equivalent relative motion of 1. 1635a46c0ec8Sopenharmony_ci * 1636a46c0ec8Sopenharmony_ci * If the event is @ref LIBINPUT_EVENT_POINTER_SCROLL_WHEEL, no terminating 1637a46c0ec8Sopenharmony_ci * event is guaranteed (though it may happen). 1638a46c0ec8Sopenharmony_ci * Scrolling is in discrete steps, the value is the angle the wheel moved 1639a46c0ec8Sopenharmony_ci * in degrees. The default is 15 degrees per wheel click, but some mice may 1640a46c0ec8Sopenharmony_ci * have differently grained wheels. It is up to the caller how to interpret 1641a46c0ec8Sopenharmony_ci * such different step sizes. Callers should use 1642a46c0ec8Sopenharmony_ci * libinput_event_pointer_get_scroll_value_v120() for a simpler API of 1643a46c0ec8Sopenharmony_ci * handling scroll wheel events of different step sizes. 1644a46c0ec8Sopenharmony_ci * 1645a46c0ec8Sopenharmony_ci * If the event is @ref LIBINPUT_EVENT_POINTER_SCROLL_CONTINUOUS, libinput 1646a46c0ec8Sopenharmony_ci * guarantees that a scroll sequence is terminated with a scroll value of 0. 1647a46c0ec8Sopenharmony_ci * The coordinate system is identical to the cursor movement, i.e. a 1648a46c0ec8Sopenharmony_ci * scroll value of 1 represents the equivalent relative motion of 1. 1649a46c0ec8Sopenharmony_ci * 1650a46c0ec8Sopenharmony_ci * For pointer events that are not of type 1651a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_SCROLL_WHEEL, 1652a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_SCROLL_FINGER, or 1653a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_SCROLL_CONTINUOUS, this function returns zero. 1654a46c0ec8Sopenharmony_ci * 1655a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other than 1656a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_SCROLL_WHEEL, 1657a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_SCROLL_FINGER, or 1658a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_SCROLL_CONTINUOUS. 1659a46c0ec8Sopenharmony_ci * 1660a46c0ec8Sopenharmony_ci * @return The axis value of this event 1661a46c0ec8Sopenharmony_ci * 1662a46c0ec8Sopenharmony_ci * @see libinput_event_pointer_get_scroll_value_v120 1663a46c0ec8Sopenharmony_ci * 1664a46c0ec8Sopenharmony_ci * @since 1.19 1665a46c0ec8Sopenharmony_ci */ 1666a46c0ec8Sopenharmony_cidouble 1667a46c0ec8Sopenharmony_cilibinput_event_pointer_get_scroll_value(struct libinput_event_pointer *event, 1668a46c0ec8Sopenharmony_ci enum libinput_pointer_axis axis); 1669a46c0ec8Sopenharmony_ci 1670a46c0ec8Sopenharmony_ci/** 1671a46c0ec8Sopenharmony_ci * @ingroup event_pointer 1672a46c0ec8Sopenharmony_ci * 1673a46c0ec8Sopenharmony_ci * For events of type @ref LIBINPUT_EVENT_POINTER_SCROLL_WHEEL 1674a46c0ec8Sopenharmony_ci * the v120-normalized value represents the movement in logical mouse wheel 1675a46c0ec8Sopenharmony_ci * clicks, normalized to the -120..+120 range. 1676a46c0ec8Sopenharmony_ci * 1677a46c0ec8Sopenharmony_ci * A value that is a fraction of ±120 indicates a wheel movement less than 1678a46c0ec8Sopenharmony_ci * one logical click, a caller should either scroll by the respective 1679a46c0ec8Sopenharmony_ci * fraction of the normal scroll distance or accumulate that value until a 1680a46c0ec8Sopenharmony_ci * multiple of 120 is reached. 1681a46c0ec8Sopenharmony_ci * 1682a46c0ec8Sopenharmony_ci * For most callers, this is the preferred way of handling high-resolution 1683a46c0ec8Sopenharmony_ci * scroll events. 1684a46c0ec8Sopenharmony_ci * 1685a46c0ec8Sopenharmony_ci * The normalized v120 value does not take device-specific physical angles 1686a46c0ec8Sopenharmony_ci * or distances into account, i.e. a wheel with a click angle of 20 degrees 1687a46c0ec8Sopenharmony_ci * produces only 18 logical clicks per 360 degree rotation, a wheel with a 1688a46c0ec8Sopenharmony_ci * click angle of 15 degrees produces 24 logical clicks per 360 degree 1689a46c0ec8Sopenharmony_ci * rotation. Where the physical angle matters, use 1690a46c0ec8Sopenharmony_ci * libinput_event_pointer_get_axis_value() instead. 1691a46c0ec8Sopenharmony_ci * 1692a46c0ec8Sopenharmony_ci * The magic number 120 originates from the <a 1693a46c0ec8Sopenharmony_ci * href="http://download.microsoft.com/download/b/d/1/bd1f7ef4-7d72-419e-bc5c-9f79ad7bb66e/wheel.docx"> 1694a46c0ec8Sopenharmony_ci * Windows Vista Mouse Wheel design document</a>. 1695a46c0ec8Sopenharmony_ci * 1696a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other than 1697a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_POINTER_SCROLL_WHEEL. 1698a46c0ec8Sopenharmony_ci * 1699a46c0ec8Sopenharmony_ci * @return A value normalized to the 0-±120 range 1700a46c0ec8Sopenharmony_ci * 1701a46c0ec8Sopenharmony_ci * @see libinput_event_pointer_get_axis_value 1702a46c0ec8Sopenharmony_ci * @see libinput_event_pointer_get_axis_value_discrete 1703a46c0ec8Sopenharmony_ci * 1704a46c0ec8Sopenharmony_ci * @since 1.19 1705a46c0ec8Sopenharmony_ci */ 1706a46c0ec8Sopenharmony_cidouble 1707a46c0ec8Sopenharmony_cilibinput_event_pointer_get_scroll_value_v120(struct libinput_event_pointer *event, 1708a46c0ec8Sopenharmony_ci enum libinput_pointer_axis axis); 1709a46c0ec8Sopenharmony_ci 1710a46c0ec8Sopenharmony_ci/** 1711a46c0ec8Sopenharmony_ci * @ingroup event_pointer 1712a46c0ec8Sopenharmony_ci * 1713a46c0ec8Sopenharmony_ci * @return The generic libinput_event of this event 1714a46c0ec8Sopenharmony_ci */ 1715a46c0ec8Sopenharmony_cistruct libinput_event * 1716a46c0ec8Sopenharmony_cilibinput_event_pointer_get_base_event(struct libinput_event_pointer *event); 1717a46c0ec8Sopenharmony_ci 1718a46c0ec8Sopenharmony_ci/** 1719a46c0ec8Sopenharmony_ci * @defgroup event_touch Touch events 1720a46c0ec8Sopenharmony_ci * 1721a46c0ec8Sopenharmony_ci * Events from absolute touch devices. 1722a46c0ec8Sopenharmony_ci */ 1723a46c0ec8Sopenharmony_ci 1724a46c0ec8Sopenharmony_ci/** 1725a46c0ec8Sopenharmony_ci * @ingroup event_touch 1726a46c0ec8Sopenharmony_ci * 1727a46c0ec8Sopenharmony_ci * @note Timestamps may not always increase. See the libinput documentation 1728a46c0ec8Sopenharmony_ci * for more details. 1729a46c0ec8Sopenharmony_ci * 1730a46c0ec8Sopenharmony_ci * @return The event time for this event 1731a46c0ec8Sopenharmony_ci */ 1732a46c0ec8Sopenharmony_ciuint32_t 1733a46c0ec8Sopenharmony_cilibinput_event_touch_get_time(struct libinput_event_touch *event); 1734a46c0ec8Sopenharmony_ci 1735a46c0ec8Sopenharmony_ci/** 1736a46c0ec8Sopenharmony_ci * @ingroup event_touch 1737a46c0ec8Sopenharmony_ci * 1738a46c0ec8Sopenharmony_ci * @note Timestamps may not always increase. See the libinput documentation 1739a46c0ec8Sopenharmony_ci * for more details. 1740a46c0ec8Sopenharmony_ci * 1741a46c0ec8Sopenharmony_ci * @return The event time for this event in microseconds 1742a46c0ec8Sopenharmony_ci */ 1743a46c0ec8Sopenharmony_ciuint64_t 1744a46c0ec8Sopenharmony_cilibinput_event_touch_get_time_usec(struct libinput_event_touch *event); 1745a46c0ec8Sopenharmony_ci 1746a46c0ec8Sopenharmony_ci/** 1747a46c0ec8Sopenharmony_ci * @ingroup event_touch 1748a46c0ec8Sopenharmony_ci * 1749a46c0ec8Sopenharmony_ci * Get the slot of this touch event. See the kernel's multitouch 1750a46c0ec8Sopenharmony_ci * protocol B documentation for more information. 1751a46c0ec8Sopenharmony_ci * 1752a46c0ec8Sopenharmony_ci * If the touch event has no assigned slot, for example if it is from a 1753a46c0ec8Sopenharmony_ci * single touch device, this function returns -1. 1754a46c0ec8Sopenharmony_ci * 1755a46c0ec8Sopenharmony_ci * For events not of type @ref LIBINPUT_EVENT_TOUCH_DOWN, @ref 1756a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TOUCH_UP, @ref LIBINPUT_EVENT_TOUCH_MOTION or @ref 1757a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TOUCH_CANCEL, this function returns 0. 1758a46c0ec8Sopenharmony_ci * 1759a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events of type 1760a46c0ec8Sopenharmony_ci * other than @ref LIBINPUT_EVENT_TOUCH_DOWN, @ref LIBINPUT_EVENT_TOUCH_UP, 1761a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TOUCH_MOTION or @ref LIBINPUT_EVENT_TOUCH_CANCEL. 1762a46c0ec8Sopenharmony_ci * 1763a46c0ec8Sopenharmony_ci * @return The slot of this touch event 1764a46c0ec8Sopenharmony_ci */ 1765a46c0ec8Sopenharmony_ciint32_t 1766a46c0ec8Sopenharmony_cilibinput_event_touch_get_slot(struct libinput_event_touch *event); 1767a46c0ec8Sopenharmony_ci 1768a46c0ec8Sopenharmony_ci/** 1769a46c0ec8Sopenharmony_ci * @ingroup event_touch 1770a46c0ec8Sopenharmony_ci * 1771a46c0ec8Sopenharmony_ci * Get the seat slot of the touch event. A seat slot is a non-negative seat 1772a46c0ec8Sopenharmony_ci * wide unique identifier of an active touch point. 1773a46c0ec8Sopenharmony_ci * 1774a46c0ec8Sopenharmony_ci * Events from single touch devices will be represented as one individual 1775a46c0ec8Sopenharmony_ci * touch point per device. 1776a46c0ec8Sopenharmony_ci * 1777a46c0ec8Sopenharmony_ci * For events not of type @ref LIBINPUT_EVENT_TOUCH_DOWN, @ref 1778a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TOUCH_UP, @ref LIBINPUT_EVENT_TOUCH_MOTION or @ref 1779a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TOUCH_CANCEL, this function returns 0. 1780a46c0ec8Sopenharmony_ci * 1781a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events of type 1782a46c0ec8Sopenharmony_ci * other than @ref LIBINPUT_EVENT_TOUCH_DOWN, @ref LIBINPUT_EVENT_TOUCH_UP, 1783a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TOUCH_MOTION or @ref LIBINPUT_EVENT_TOUCH_CANCEL. 1784a46c0ec8Sopenharmony_ci * 1785a46c0ec8Sopenharmony_ci * @return The seat slot of the touch event 1786a46c0ec8Sopenharmony_ci */ 1787a46c0ec8Sopenharmony_ciint32_t 1788a46c0ec8Sopenharmony_cilibinput_event_touch_get_seat_slot(struct libinput_event_touch *event); 1789a46c0ec8Sopenharmony_ci 1790a46c0ec8Sopenharmony_ci/** 1791a46c0ec8Sopenharmony_ci * @ingroup event_touch 1792a46c0ec8Sopenharmony_ci * 1793a46c0ec8Sopenharmony_ci * Return the current absolute x coordinate of the touch event, in mm from 1794a46c0ec8Sopenharmony_ci * the top left corner of the device. To get the corresponding output screen 1795a46c0ec8Sopenharmony_ci * coordinate, use libinput_event_touch_get_x_transformed(). 1796a46c0ec8Sopenharmony_ci * 1797a46c0ec8Sopenharmony_ci * For events not of type @ref LIBINPUT_EVENT_TOUCH_DOWN, @ref 1798a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TOUCH_MOTION, this function returns 0. 1799a46c0ec8Sopenharmony_ci * 1800a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events of type 1801a46c0ec8Sopenharmony_ci * other than @ref LIBINPUT_EVENT_TOUCH_DOWN or @ref 1802a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TOUCH_MOTION. 1803a46c0ec8Sopenharmony_ci * 1804a46c0ec8Sopenharmony_ci * @param event The libinput touch event 1805a46c0ec8Sopenharmony_ci * @return The current absolute x coordinate 1806a46c0ec8Sopenharmony_ci */ 1807a46c0ec8Sopenharmony_cidouble 1808a46c0ec8Sopenharmony_cilibinput_event_touch_get_x(struct libinput_event_touch *event); 1809a46c0ec8Sopenharmony_ci 1810a46c0ec8Sopenharmony_ci/** 1811a46c0ec8Sopenharmony_ci * @ingroup event_touch 1812a46c0ec8Sopenharmony_ci * 1813a46c0ec8Sopenharmony_ci * Return the current absolute y coordinate of the touch event, in mm from 1814a46c0ec8Sopenharmony_ci * the top left corner of the device. To get the corresponding output screen 1815a46c0ec8Sopenharmony_ci * coordinate, use libinput_event_touch_get_y_transformed(). 1816a46c0ec8Sopenharmony_ci * 1817a46c0ec8Sopenharmony_ci * For events not of type @ref LIBINPUT_EVENT_TOUCH_DOWN, @ref 1818a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TOUCH_MOTION, this function returns 0. 1819a46c0ec8Sopenharmony_ci * 1820a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events of type 1821a46c0ec8Sopenharmony_ci * other than @ref LIBINPUT_EVENT_TOUCH_DOWN or @ref 1822a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TOUCH_MOTION. 1823a46c0ec8Sopenharmony_ci * 1824a46c0ec8Sopenharmony_ci * @param event The libinput touch event 1825a46c0ec8Sopenharmony_ci * @return The current absolute y coordinate 1826a46c0ec8Sopenharmony_ci */ 1827a46c0ec8Sopenharmony_cidouble 1828a46c0ec8Sopenharmony_cilibinput_event_touch_get_y(struct libinput_event_touch *event); 1829a46c0ec8Sopenharmony_ci 1830a46c0ec8Sopenharmony_ci/** 1831a46c0ec8Sopenharmony_ci * @ingroup event_touch 1832a46c0ec8Sopenharmony_ci * 1833a46c0ec8Sopenharmony_ci * Return the current absolute x coordinate of the touch event, transformed to 1834a46c0ec8Sopenharmony_ci * screen coordinates. 1835a46c0ec8Sopenharmony_ci * 1836a46c0ec8Sopenharmony_ci * For events not of type @ref LIBINPUT_EVENT_TOUCH_DOWN, @ref 1837a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TOUCH_MOTION, this function returns 0. 1838a46c0ec8Sopenharmony_ci * 1839a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events of type 1840a46c0ec8Sopenharmony_ci * other than @ref LIBINPUT_EVENT_TOUCH_DOWN or @ref 1841a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TOUCH_MOTION. 1842a46c0ec8Sopenharmony_ci * 1843a46c0ec8Sopenharmony_ci * @param event The libinput touch event 1844a46c0ec8Sopenharmony_ci * @param width The current output screen width 1845a46c0ec8Sopenharmony_ci * @return The current absolute x coordinate transformed to a screen coordinate 1846a46c0ec8Sopenharmony_ci */ 1847a46c0ec8Sopenharmony_cidouble 1848a46c0ec8Sopenharmony_cilibinput_event_touch_get_x_transformed(struct libinput_event_touch *event, 1849a46c0ec8Sopenharmony_ci uint32_t width); 1850a46c0ec8Sopenharmony_ci 1851a46c0ec8Sopenharmony_ci/** 1852a46c0ec8Sopenharmony_ci * @ingroup event_touch 1853a46c0ec8Sopenharmony_ci * 1854a46c0ec8Sopenharmony_ci * Return the current absolute y coordinate of the touch event, transformed to 1855a46c0ec8Sopenharmony_ci * screen coordinates. 1856a46c0ec8Sopenharmony_ci * 1857a46c0ec8Sopenharmony_ci * For events not of type @ref LIBINPUT_EVENT_TOUCH_DOWN, @ref 1858a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TOUCH_MOTION, this function returns 0. 1859a46c0ec8Sopenharmony_ci * 1860a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events of type 1861a46c0ec8Sopenharmony_ci * other than @ref LIBINPUT_EVENT_TOUCH_DOWN or @ref 1862a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TOUCH_MOTION. 1863a46c0ec8Sopenharmony_ci * 1864a46c0ec8Sopenharmony_ci * @param event The libinput touch event 1865a46c0ec8Sopenharmony_ci * @param height The current output screen height 1866a46c0ec8Sopenharmony_ci * @return The current absolute y coordinate transformed to a screen coordinate 1867a46c0ec8Sopenharmony_ci */ 1868a46c0ec8Sopenharmony_cidouble 1869a46c0ec8Sopenharmony_cilibinput_event_touch_get_y_transformed(struct libinput_event_touch *event, 1870a46c0ec8Sopenharmony_ci uint32_t height); 1871a46c0ec8Sopenharmony_ci 1872a46c0ec8Sopenharmony_ci/** 1873a46c0ec8Sopenharmony_ci * @ingroup event_touch 1874a46c0ec8Sopenharmony_ci * 1875a46c0ec8Sopenharmony_ci * @return The generic libinput_event of this event 1876a46c0ec8Sopenharmony_ci */ 1877a46c0ec8Sopenharmony_cistruct libinput_event * 1878a46c0ec8Sopenharmony_cilibinput_event_touch_get_base_event(struct libinput_event_touch *event); 1879a46c0ec8Sopenharmony_ci 1880a46c0ec8Sopenharmony_ci/** 1881a46c0ec8Sopenharmony_ci * @defgroup event_gesture Gesture events 1882a46c0ec8Sopenharmony_ci * 1883a46c0ec8Sopenharmony_ci * Gesture events are generated when a gesture is recognized on a touchpad. 1884a46c0ec8Sopenharmony_ci * 1885a46c0ec8Sopenharmony_ci * Gesture sequences always start with a LIBINPUT_EVENT_GESTURE_FOO_START 1886a46c0ec8Sopenharmony_ci * event. All following gesture events will be of the 1887a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_GESTURE_FOO_UPDATE type until a 1888a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_GESTURE_FOO_END is generated which signals the end of the 1889a46c0ec8Sopenharmony_ci * gesture. 1890a46c0ec8Sopenharmony_ci * 1891a46c0ec8Sopenharmony_ci * See the libinput documentation for details on gesture handling. 1892a46c0ec8Sopenharmony_ci */ 1893a46c0ec8Sopenharmony_ci 1894a46c0ec8Sopenharmony_ci/** 1895a46c0ec8Sopenharmony_ci * @ingroup event_gesture 1896a46c0ec8Sopenharmony_ci * 1897a46c0ec8Sopenharmony_ci * @note Timestamps may not always increase. See the libinput documentation 1898a46c0ec8Sopenharmony_ci * for more details. 1899a46c0ec8Sopenharmony_ci * 1900a46c0ec8Sopenharmony_ci * @return The event time for this event 1901a46c0ec8Sopenharmony_ci */ 1902a46c0ec8Sopenharmony_ciuint32_t 1903a46c0ec8Sopenharmony_cilibinput_event_gesture_get_time(struct libinput_event_gesture *event); 1904a46c0ec8Sopenharmony_ci 1905a46c0ec8Sopenharmony_ci/** 1906a46c0ec8Sopenharmony_ci * @ingroup event_gesture 1907a46c0ec8Sopenharmony_ci * 1908a46c0ec8Sopenharmony_ci * @note Timestamps may not always increase. See the libinput documentation 1909a46c0ec8Sopenharmony_ci * for more details. 1910a46c0ec8Sopenharmony_ci * 1911a46c0ec8Sopenharmony_ci * @return The event time for this event in microseconds 1912a46c0ec8Sopenharmony_ci */ 1913a46c0ec8Sopenharmony_ciuint64_t 1914a46c0ec8Sopenharmony_cilibinput_event_gesture_get_time_usec(struct libinput_event_gesture *event); 1915a46c0ec8Sopenharmony_ci 1916a46c0ec8Sopenharmony_ci/** 1917a46c0ec8Sopenharmony_ci * @ingroup event_gesture 1918a46c0ec8Sopenharmony_ci * 1919a46c0ec8Sopenharmony_ci * @return The generic libinput_event of this event 1920a46c0ec8Sopenharmony_ci */ 1921a46c0ec8Sopenharmony_cistruct libinput_event * 1922a46c0ec8Sopenharmony_cilibinput_event_gesture_get_base_event(struct libinput_event_gesture *event); 1923a46c0ec8Sopenharmony_ci 1924a46c0ec8Sopenharmony_ci/** 1925a46c0ec8Sopenharmony_ci * @ingroup event_gesture 1926a46c0ec8Sopenharmony_ci * 1927a46c0ec8Sopenharmony_ci * Return the number of fingers used for a gesture. This can be used e.g. 1928a46c0ec8Sopenharmony_ci * to differentiate between 3 or 4 finger swipes. 1929a46c0ec8Sopenharmony_ci * 1930a46c0ec8Sopenharmony_ci * This function can be called on all gesture events and the returned finger 1931a46c0ec8Sopenharmony_ci * count value remains the same for the lifetime of a gesture. Thus, if a 1932a46c0ec8Sopenharmony_ci * user puts down a fourth finger during a three-finger swipe gesture, 1933a46c0ec8Sopenharmony_ci * libinput will end the three-finger gesture and, if applicable, start a 1934a46c0ec8Sopenharmony_ci * four-finger swipe gesture. A caller may decide that those gestures are 1935a46c0ec8Sopenharmony_ci * semantically identical and continue the two gestures as one single gesture. 1936a46c0ec8Sopenharmony_ci * 1937a46c0ec8Sopenharmony_ci * @return the number of fingers used for a gesture 1938a46c0ec8Sopenharmony_ci */ 1939a46c0ec8Sopenharmony_ciint 1940a46c0ec8Sopenharmony_cilibinput_event_gesture_get_finger_count(struct libinput_event_gesture *event); 1941a46c0ec8Sopenharmony_ci 1942a46c0ec8Sopenharmony_ci/** 1943a46c0ec8Sopenharmony_ci * @ingroup event_gesture 1944a46c0ec8Sopenharmony_ci * 1945a46c0ec8Sopenharmony_ci * Return if the gesture ended normally, or if it was cancelled. 1946a46c0ec8Sopenharmony_ci * For gesture events that are not of type 1947a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_GESTURE_SWIPE_END or 1948a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_GESTURE_PINCH_END, this function returns 0. 1949a46c0ec8Sopenharmony_ci * 1950a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other than 1951a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_GESTURE_SWIPE_END or 1952a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_GESTURE_PINCH_END. 1953a46c0ec8Sopenharmony_ci * 1954a46c0ec8Sopenharmony_ci * @return 0 or 1, with 1 indicating that the gesture was cancelled. 1955a46c0ec8Sopenharmony_ci */ 1956a46c0ec8Sopenharmony_ciint 1957a46c0ec8Sopenharmony_cilibinput_event_gesture_get_cancelled(struct libinput_event_gesture *event); 1958a46c0ec8Sopenharmony_ci 1959a46c0ec8Sopenharmony_ci/** 1960a46c0ec8Sopenharmony_ci * @ingroup event_gesture 1961a46c0ec8Sopenharmony_ci * 1962a46c0ec8Sopenharmony_ci * Return the delta between the last event and the current event. For gesture 1963a46c0ec8Sopenharmony_ci * events that are not of type @ref LIBINPUT_EVENT_GESTURE_SWIPE_UPDATE or 1964a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_GESTURE_PINCH_UPDATE, this function returns 0. 1965a46c0ec8Sopenharmony_ci * 1966a46c0ec8Sopenharmony_ci * If a device employs pointer acceleration, the delta returned by this 1967a46c0ec8Sopenharmony_ci * function is the accelerated delta. 1968a46c0ec8Sopenharmony_ci * 1969a46c0ec8Sopenharmony_ci * Relative motion deltas are normalized to represent those of a device with 1970a46c0ec8Sopenharmony_ci * 1000dpi resolution. See the libinput documentation for more details. 1971a46c0ec8Sopenharmony_ci * 1972a46c0ec8Sopenharmony_ci * @return the relative x movement since the last event 1973a46c0ec8Sopenharmony_ci */ 1974a46c0ec8Sopenharmony_cidouble 1975a46c0ec8Sopenharmony_cilibinput_event_gesture_get_dx(struct libinput_event_gesture *event); 1976a46c0ec8Sopenharmony_ci 1977a46c0ec8Sopenharmony_ci/** 1978a46c0ec8Sopenharmony_ci * @ingroup event_gesture 1979a46c0ec8Sopenharmony_ci * 1980a46c0ec8Sopenharmony_ci * Return the delta between the last event and the current event. For gesture 1981a46c0ec8Sopenharmony_ci * events that are not of type @ref LIBINPUT_EVENT_GESTURE_SWIPE_UPDATE or 1982a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_GESTURE_PINCH_UPDATE, this function returns 0. 1983a46c0ec8Sopenharmony_ci * 1984a46c0ec8Sopenharmony_ci * If a device employs pointer acceleration, the delta returned by this 1985a46c0ec8Sopenharmony_ci * function is the accelerated delta. 1986a46c0ec8Sopenharmony_ci * 1987a46c0ec8Sopenharmony_ci * Relative motion deltas are normalized to represent those of a device with 1988a46c0ec8Sopenharmony_ci * 1000dpi resolution. See the libinput documentation for more details. 1989a46c0ec8Sopenharmony_ci * 1990a46c0ec8Sopenharmony_ci * @return the relative y movement since the last event 1991a46c0ec8Sopenharmony_ci */ 1992a46c0ec8Sopenharmony_cidouble 1993a46c0ec8Sopenharmony_cilibinput_event_gesture_get_dy(struct libinput_event_gesture *event); 1994a46c0ec8Sopenharmony_ci 1995a46c0ec8Sopenharmony_ci/** 1996a46c0ec8Sopenharmony_ci * @ingroup event_gesture 1997a46c0ec8Sopenharmony_ci * 1998a46c0ec8Sopenharmony_ci * Return the relative delta of the unaccelerated motion vector of the 1999a46c0ec8Sopenharmony_ci * current event. For gesture events that are not of type 2000a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_GESTURE_SWIPE_UPDATE or 2001a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_GESTURE_PINCH_UPDATE, this function returns 0. 2002a46c0ec8Sopenharmony_ci * 2003a46c0ec8Sopenharmony_ci * Relative unaccelerated motion deltas are normalized to represent those of a 2004a46c0ec8Sopenharmony_ci * device with 1000dpi resolution. See the libinput documentation for more 2005a46c0ec8Sopenharmony_ci * details. Note that unaccelerated events are not equivalent to 'raw' events 2006a46c0ec8Sopenharmony_ci * as read from the device. 2007a46c0ec8Sopenharmony_ci * 2008a46c0ec8Sopenharmony_ci * Any rotation applied to the device also applies to gesture motion 2009a46c0ec8Sopenharmony_ci * (see libinput_device_config_rotation_set_angle()). 2010a46c0ec8Sopenharmony_ci * 2011a46c0ec8Sopenharmony_ci * @return the unaccelerated relative x movement since the last event 2012a46c0ec8Sopenharmony_ci */ 2013a46c0ec8Sopenharmony_cidouble 2014a46c0ec8Sopenharmony_cilibinput_event_gesture_get_dx_unaccelerated( 2015a46c0ec8Sopenharmony_ci struct libinput_event_gesture *event); 2016a46c0ec8Sopenharmony_ci 2017a46c0ec8Sopenharmony_ci/** 2018a46c0ec8Sopenharmony_ci * @ingroup event_gesture 2019a46c0ec8Sopenharmony_ci * 2020a46c0ec8Sopenharmony_ci * Return the relative delta of the unaccelerated motion vector of the 2021a46c0ec8Sopenharmony_ci * current event. For gesture events that are not of type 2022a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_GESTURE_SWIPE_UPDATE or 2023a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_GESTURE_PINCH_UPDATE, this function returns 0. 2024a46c0ec8Sopenharmony_ci * 2025a46c0ec8Sopenharmony_ci * Relative unaccelerated motion deltas are normalized to represent those of a 2026a46c0ec8Sopenharmony_ci * device with 1000dpi resolution. See the libinput documentation for more 2027a46c0ec8Sopenharmony_ci * details. Note that unaccelerated events are not equivalent to 'raw' events 2028a46c0ec8Sopenharmony_ci * as read from the device. 2029a46c0ec8Sopenharmony_ci * 2030a46c0ec8Sopenharmony_ci * Any rotation applied to the device also applies to gesture motion 2031a46c0ec8Sopenharmony_ci * (see libinput_device_config_rotation_set_angle()). 2032a46c0ec8Sopenharmony_ci * 2033a46c0ec8Sopenharmony_ci * @return the unaccelerated relative y movement since the last event 2034a46c0ec8Sopenharmony_ci */ 2035a46c0ec8Sopenharmony_cidouble 2036a46c0ec8Sopenharmony_cilibinput_event_gesture_get_dy_unaccelerated( 2037a46c0ec8Sopenharmony_ci struct libinput_event_gesture *event); 2038a46c0ec8Sopenharmony_ci 2039a46c0ec8Sopenharmony_ci/** 2040a46c0ec8Sopenharmony_ci * @ingroup event_gesture 2041a46c0ec8Sopenharmony_ci * 2042a46c0ec8Sopenharmony_ci * Return the absolute scale of a pinch gesture, the scale is the division 2043a46c0ec8Sopenharmony_ci * of the current distance between the fingers and the distance at the start 2044a46c0ec8Sopenharmony_ci * of the gesture. The scale begins at 1.0, and if e.g. the fingers moved 2045a46c0ec8Sopenharmony_ci * together by 50% then the scale will become 0.5, if they move twice as far 2046a46c0ec8Sopenharmony_ci * apart as initially the scale becomes 2.0, etc. 2047a46c0ec8Sopenharmony_ci * 2048a46c0ec8Sopenharmony_ci * For gesture events that are of type @ref 2049a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_GESTURE_PINCH_BEGIN, this function returns 1.0. 2050a46c0ec8Sopenharmony_ci * 2051a46c0ec8Sopenharmony_ci * For gesture events that are of type @ref 2052a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_GESTURE_PINCH_END, this function returns the scale value 2053a46c0ec8Sopenharmony_ci * of the most recent @ref LIBINPUT_EVENT_GESTURE_PINCH_UPDATE event (if 2054a46c0ec8Sopenharmony_ci * any) or 1.0 otherwise. 2055a46c0ec8Sopenharmony_ci * 2056a46c0ec8Sopenharmony_ci * For all other events this function returns 0. 2057a46c0ec8Sopenharmony_ci * 2058a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other than 2059a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_GESTURE_PINCH_BEGIN, @ref 2060a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_GESTURE_PINCH_END or 2061a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_GESTURE_PINCH_UPDATE. 2062a46c0ec8Sopenharmony_ci * 2063a46c0ec8Sopenharmony_ci * @return the absolute scale of a pinch gesture 2064a46c0ec8Sopenharmony_ci */ 2065a46c0ec8Sopenharmony_cidouble 2066a46c0ec8Sopenharmony_cilibinput_event_gesture_get_scale(struct libinput_event_gesture *event); 2067a46c0ec8Sopenharmony_ci 2068a46c0ec8Sopenharmony_ci/** 2069a46c0ec8Sopenharmony_ci * @ingroup event_gesture 2070a46c0ec8Sopenharmony_ci * 2071a46c0ec8Sopenharmony_ci * Return the angle delta in degrees between the last and the current @ref 2072a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_GESTURE_PINCH_UPDATE event. For gesture events that 2073a46c0ec8Sopenharmony_ci * are not of type @ref LIBINPUT_EVENT_GESTURE_PINCH_UPDATE, this 2074a46c0ec8Sopenharmony_ci * function returns 0. 2075a46c0ec8Sopenharmony_ci * 2076a46c0ec8Sopenharmony_ci * The angle delta is defined as the change in angle of the line formed by 2077a46c0ec8Sopenharmony_ci * the 2 fingers of a pinch gesture. Clockwise rotation is represented 2078a46c0ec8Sopenharmony_ci * by a positive delta, counter-clockwise by a negative delta. If e.g. the 2079a46c0ec8Sopenharmony_ci * fingers are on the 12 and 6 location of a clock face plate and they move 2080a46c0ec8Sopenharmony_ci * to the 1 resp. 7 location in a single event then the angle delta is 2081a46c0ec8Sopenharmony_ci * 30 degrees. 2082a46c0ec8Sopenharmony_ci * 2083a46c0ec8Sopenharmony_ci * If more than two fingers are present, the angle represents the rotation 2084a46c0ec8Sopenharmony_ci * around the center of gravity. The calculation of the center of gravity is 2085a46c0ec8Sopenharmony_ci * implementation-dependent. 2086a46c0ec8Sopenharmony_ci * 2087a46c0ec8Sopenharmony_ci * @return the angle delta since the last event 2088a46c0ec8Sopenharmony_ci */ 2089a46c0ec8Sopenharmony_cidouble 2090a46c0ec8Sopenharmony_cilibinput_event_gesture_get_angle_delta(struct libinput_event_gesture *event); 2091a46c0ec8Sopenharmony_ci 2092a46c0ec8Sopenharmony_ci/** 2093a46c0ec8Sopenharmony_ci * @defgroup event_tablet Tablet events 2094a46c0ec8Sopenharmony_ci * 2095a46c0ec8Sopenharmony_ci * Events that come from tools on tablet devices. For events from the pad, 2096a46c0ec8Sopenharmony_ci * see @ref event_tablet_pad. 2097a46c0ec8Sopenharmony_ci * 2098a46c0ec8Sopenharmony_ci * Events from tablet devices are exposed by two interfaces, tools and pads. 2099a46c0ec8Sopenharmony_ci * Tool events originate (usually) from a stylus-like device, pad events 2100a46c0ec8Sopenharmony_ci * reflect any events originating from the physical tablet itself. 2101a46c0ec8Sopenharmony_ci * 2102a46c0ec8Sopenharmony_ci * Note that many tablets support touch events. These are exposed through 2103a46c0ec8Sopenharmony_ci * the @ref LIBINPUT_DEVICE_CAP_POINTER interface (for external touchpad-like 2104a46c0ec8Sopenharmony_ci * devices such as the Wacom Intuos series) or @ref 2105a46c0ec8Sopenharmony_ci * LIBINPUT_DEVICE_CAP_TOUCH interface (for built-in touchscreen-like 2106a46c0ec8Sopenharmony_ci * devices such as the Wacom Cintiq series). 2107a46c0ec8Sopenharmony_ci */ 2108a46c0ec8Sopenharmony_ci 2109a46c0ec8Sopenharmony_ci/** 2110a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2111a46c0ec8Sopenharmony_ci * 2112a46c0ec8Sopenharmony_ci * @return The generic libinput_event of this event 2113a46c0ec8Sopenharmony_ci * 2114a46c0ec8Sopenharmony_ci * @since 1.2 2115a46c0ec8Sopenharmony_ci */ 2116a46c0ec8Sopenharmony_cistruct libinput_event * 2117a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_get_base_event(struct libinput_event_tablet_tool *event); 2118a46c0ec8Sopenharmony_ci 2119a46c0ec8Sopenharmony_ci/** 2120a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2121a46c0ec8Sopenharmony_ci * 2122a46c0ec8Sopenharmony_ci * Check if the x axis was updated in this event. 2123a46c0ec8Sopenharmony_ci * For events that are not of type @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS, 2124a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_TOOL_TIP, or 2125a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, this function returns 0. 2126a46c0ec8Sopenharmony_ci * 2127a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other 2128a46c0ec8Sopenharmony_ci * than @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS, @ref 2129a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_TIP, or @ref 2130a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, or @ref 2131a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_BUTTON. 2132a46c0ec8Sopenharmony_ci * 2133a46c0ec8Sopenharmony_ci * @param event The libinput tablet tool event 2134a46c0ec8Sopenharmony_ci * @return 1 if the axis was updated or 0 otherwise 2135a46c0ec8Sopenharmony_ci * 2136a46c0ec8Sopenharmony_ci * @since 1.2 2137a46c0ec8Sopenharmony_ci */ 2138a46c0ec8Sopenharmony_ciint 2139a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_x_has_changed( 2140a46c0ec8Sopenharmony_ci struct libinput_event_tablet_tool *event); 2141a46c0ec8Sopenharmony_ci 2142a46c0ec8Sopenharmony_ci/** 2143a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2144a46c0ec8Sopenharmony_ci * 2145a46c0ec8Sopenharmony_ci * Check if the y axis was updated in this event. 2146a46c0ec8Sopenharmony_ci * For events that are not of type @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS, 2147a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_TOOL_TIP, or 2148a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, this function returns 0. 2149a46c0ec8Sopenharmony_ci * 2150a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other 2151a46c0ec8Sopenharmony_ci * than @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS, @ref 2152a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_TIP, or @ref 2153a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, or @ref 2154a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_BUTTON. 2155a46c0ec8Sopenharmony_ci * 2156a46c0ec8Sopenharmony_ci * @param event The libinput tablet tool event 2157a46c0ec8Sopenharmony_ci * @return 1 if the axis was updated or 0 otherwise 2158a46c0ec8Sopenharmony_ci * 2159a46c0ec8Sopenharmony_ci * @since 1.2 2160a46c0ec8Sopenharmony_ci */ 2161a46c0ec8Sopenharmony_ciint 2162a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_y_has_changed( 2163a46c0ec8Sopenharmony_ci struct libinput_event_tablet_tool *event); 2164a46c0ec8Sopenharmony_ci 2165a46c0ec8Sopenharmony_ci/** 2166a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2167a46c0ec8Sopenharmony_ci * 2168a46c0ec8Sopenharmony_ci * Check if the pressure axis was updated in this event. 2169a46c0ec8Sopenharmony_ci * For events that are not of type @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS, 2170a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_TOOL_TIP, or 2171a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, this function returns 0. 2172a46c0ec8Sopenharmony_ci * 2173a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other 2174a46c0ec8Sopenharmony_ci * than @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS, @ref 2175a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_TIP, or @ref 2176a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, or @ref 2177a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_BUTTON. 2178a46c0ec8Sopenharmony_ci * 2179a46c0ec8Sopenharmony_ci * @param event The libinput tablet tool event 2180a46c0ec8Sopenharmony_ci * @return 1 if the axis was updated or 0 otherwise 2181a46c0ec8Sopenharmony_ci * 2182a46c0ec8Sopenharmony_ci * @since 1.2 2183a46c0ec8Sopenharmony_ci */ 2184a46c0ec8Sopenharmony_ciint 2185a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_pressure_has_changed( 2186a46c0ec8Sopenharmony_ci struct libinput_event_tablet_tool *event); 2187a46c0ec8Sopenharmony_ci 2188a46c0ec8Sopenharmony_ci/** 2189a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2190a46c0ec8Sopenharmony_ci * 2191a46c0ec8Sopenharmony_ci * Check if the distance axis was updated in this event. 2192a46c0ec8Sopenharmony_ci * For events that are not of type @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS, 2193a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_TOOL_TIP, or 2194a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, this function returns 0. 2195a46c0ec8Sopenharmony_ci * For tablet tool events of type @ref LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, 2196a46c0ec8Sopenharmony_ci * this function always returns 1. 2197a46c0ec8Sopenharmony_ci * 2198a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other 2199a46c0ec8Sopenharmony_ci * than @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS, @ref 2200a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_TIP, or @ref 2201a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, or @ref 2202a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_BUTTON. 2203a46c0ec8Sopenharmony_ci * 2204a46c0ec8Sopenharmony_ci * @param event The libinput tablet tool event 2205a46c0ec8Sopenharmony_ci * @return 1 if the axis was updated or 0 otherwise 2206a46c0ec8Sopenharmony_ci * 2207a46c0ec8Sopenharmony_ci * @since 1.2 2208a46c0ec8Sopenharmony_ci */ 2209a46c0ec8Sopenharmony_ciint 2210a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_distance_has_changed( 2211a46c0ec8Sopenharmony_ci struct libinput_event_tablet_tool *event); 2212a46c0ec8Sopenharmony_ci 2213a46c0ec8Sopenharmony_ci/** 2214a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2215a46c0ec8Sopenharmony_ci * 2216a46c0ec8Sopenharmony_ci * Check if the tilt x axis was updated in this event. 2217a46c0ec8Sopenharmony_ci * For events that are not of type @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS, 2218a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_TOOL_TIP, or 2219a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, this function returns 0. 2220a46c0ec8Sopenharmony_ci * 2221a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other 2222a46c0ec8Sopenharmony_ci * than @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS, @ref 2223a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_TIP, or @ref 2224a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, or @ref 2225a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_BUTTON. 2226a46c0ec8Sopenharmony_ci * 2227a46c0ec8Sopenharmony_ci * @param event The libinput tablet tool event 2228a46c0ec8Sopenharmony_ci * @return 1 if the axis was updated or 0 otherwise 2229a46c0ec8Sopenharmony_ci * 2230a46c0ec8Sopenharmony_ci * @since 1.2 2231a46c0ec8Sopenharmony_ci */ 2232a46c0ec8Sopenharmony_ciint 2233a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_tilt_x_has_changed( 2234a46c0ec8Sopenharmony_ci struct libinput_event_tablet_tool *event); 2235a46c0ec8Sopenharmony_ci 2236a46c0ec8Sopenharmony_ci/** 2237a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2238a46c0ec8Sopenharmony_ci * 2239a46c0ec8Sopenharmony_ci * Check if the tilt y axis was updated in this event. 2240a46c0ec8Sopenharmony_ci * For events that are not of type @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS, 2241a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_TOOL_TIP, or 2242a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, this function returns 0. 2243a46c0ec8Sopenharmony_ci * 2244a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other 2245a46c0ec8Sopenharmony_ci * than @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS, @ref 2246a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_TIP, or @ref 2247a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, or @ref 2248a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_BUTTON. 2249a46c0ec8Sopenharmony_ci * 2250a46c0ec8Sopenharmony_ci * @param event The libinput tablet tool event 2251a46c0ec8Sopenharmony_ci * @return 1 if the axis was updated or 0 otherwise 2252a46c0ec8Sopenharmony_ci * 2253a46c0ec8Sopenharmony_ci * @since 1.2 2254a46c0ec8Sopenharmony_ci */ 2255a46c0ec8Sopenharmony_ciint 2256a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_tilt_y_has_changed( 2257a46c0ec8Sopenharmony_ci struct libinput_event_tablet_tool *event); 2258a46c0ec8Sopenharmony_ci/** 2259a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2260a46c0ec8Sopenharmony_ci * 2261a46c0ec8Sopenharmony_ci * Check if the z-rotation axis was updated in this event. 2262a46c0ec8Sopenharmony_ci * For events that are not of type @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS, 2263a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_TOOL_TIP, or 2264a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, this function returns 0. 2265a46c0ec8Sopenharmony_ci * 2266a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other 2267a46c0ec8Sopenharmony_ci * than @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS, @ref 2268a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_TIP, or @ref 2269a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, or @ref 2270a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_BUTTON. 2271a46c0ec8Sopenharmony_ci * 2272a46c0ec8Sopenharmony_ci * @param event The libinput tablet tool event 2273a46c0ec8Sopenharmony_ci * @return 1 if the axis was updated or 0 otherwise 2274a46c0ec8Sopenharmony_ci * 2275a46c0ec8Sopenharmony_ci * @since 1.2 2276a46c0ec8Sopenharmony_ci */ 2277a46c0ec8Sopenharmony_ciint 2278a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_rotation_has_changed( 2279a46c0ec8Sopenharmony_ci struct libinput_event_tablet_tool *event); 2280a46c0ec8Sopenharmony_ci/** 2281a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2282a46c0ec8Sopenharmony_ci * 2283a46c0ec8Sopenharmony_ci * Check if the slider axis was updated in this event. 2284a46c0ec8Sopenharmony_ci * For events that are not of type @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS, 2285a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_TOOL_TIP, or 2286a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, this function returns 0. 2287a46c0ec8Sopenharmony_ci * 2288a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other 2289a46c0ec8Sopenharmony_ci * than @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS, @ref 2290a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_TIP, or @ref 2291a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, or @ref 2292a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_BUTTON. 2293a46c0ec8Sopenharmony_ci * 2294a46c0ec8Sopenharmony_ci * @param event The libinput tablet tool event 2295a46c0ec8Sopenharmony_ci * @return 1 if the axis was updated or 0 otherwise 2296a46c0ec8Sopenharmony_ci * 2297a46c0ec8Sopenharmony_ci * @since 1.2 2298a46c0ec8Sopenharmony_ci */ 2299a46c0ec8Sopenharmony_ciint 2300a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_slider_has_changed( 2301a46c0ec8Sopenharmony_ci struct libinput_event_tablet_tool *event); 2302a46c0ec8Sopenharmony_ci 2303a46c0ec8Sopenharmony_ci/** 2304a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2305a46c0ec8Sopenharmony_ci * 2306a46c0ec8Sopenharmony_ci * Check if the size major axis was updated in this event. 2307a46c0ec8Sopenharmony_ci * For events that are not of type @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS, 2308a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_TOOL_TIP, or 2309a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, this function returns 0. 2310a46c0ec8Sopenharmony_ci * 2311a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other 2312a46c0ec8Sopenharmony_ci * than @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS, @ref 2313a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_TIP, or @ref 2314a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, or @ref 2315a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_BUTTON. 2316a46c0ec8Sopenharmony_ci * 2317a46c0ec8Sopenharmony_ci * @param event The libinput tablet tool event 2318a46c0ec8Sopenharmony_ci * @return 1 if the axis was updated or 0 otherwise 2319a46c0ec8Sopenharmony_ci */ 2320a46c0ec8Sopenharmony_ciint 2321a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_size_major_has_changed( 2322a46c0ec8Sopenharmony_ci struct libinput_event_tablet_tool *event); 2323a46c0ec8Sopenharmony_ci 2324a46c0ec8Sopenharmony_ci/** 2325a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2326a46c0ec8Sopenharmony_ci * 2327a46c0ec8Sopenharmony_ci * Check if the size minor axis was updated in this event. 2328a46c0ec8Sopenharmony_ci * For events that are not of type @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS, 2329a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_TOOL_TIP, or 2330a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, this function returns 0. 2331a46c0ec8Sopenharmony_ci * 2332a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other 2333a46c0ec8Sopenharmony_ci * than @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS, @ref 2334a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_TIP, or @ref 2335a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, or @ref 2336a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_BUTTON. 2337a46c0ec8Sopenharmony_ci * 2338a46c0ec8Sopenharmony_ci * @param event The libinput tablet tool event 2339a46c0ec8Sopenharmony_ci * @return 1 if the axis was updated or 0 otherwise 2340a46c0ec8Sopenharmony_ci */ 2341a46c0ec8Sopenharmony_ciint 2342a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_size_minor_has_changed( 2343a46c0ec8Sopenharmony_ci struct libinput_event_tablet_tool *event); 2344a46c0ec8Sopenharmony_ci 2345a46c0ec8Sopenharmony_ci/** 2346a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2347a46c0ec8Sopenharmony_ci * 2348a46c0ec8Sopenharmony_ci * Check if the wheel axis was updated in this event. 2349a46c0ec8Sopenharmony_ci * For events that are not of type @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS, 2350a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_TOOL_TIP, or 2351a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, this function returns 0. 2352a46c0ec8Sopenharmony_ci * 2353a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other 2354a46c0ec8Sopenharmony_ci * than @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS, @ref 2355a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_TIP, or @ref 2356a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, or @ref 2357a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_TABLET_TOOL_BUTTON. 2358a46c0ec8Sopenharmony_ci * 2359a46c0ec8Sopenharmony_ci * @param event The libinput tablet tool event 2360a46c0ec8Sopenharmony_ci * @return 1 if the axis was updated or 0 otherwise 2361a46c0ec8Sopenharmony_ci * 2362a46c0ec8Sopenharmony_ci * @since 1.2 2363a46c0ec8Sopenharmony_ci */ 2364a46c0ec8Sopenharmony_ciint 2365a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_wheel_has_changed( 2366a46c0ec8Sopenharmony_ci struct libinput_event_tablet_tool *event); 2367a46c0ec8Sopenharmony_ci 2368a46c0ec8Sopenharmony_ci/** 2369a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2370a46c0ec8Sopenharmony_ci * 2371a46c0ec8Sopenharmony_ci * Returns the X coordinate of the tablet tool, in mm from the top left 2372a46c0ec8Sopenharmony_ci * corner of the tablet in its current logical orientation. Use 2373a46c0ec8Sopenharmony_ci * libinput_event_tablet_tool_get_x_transformed() for transforming the axis 2374a46c0ec8Sopenharmony_ci * value into a different coordinate space. 2375a46c0ec8Sopenharmony_ci * 2376a46c0ec8Sopenharmony_ci * @note On some devices, returned value may be negative or larger than the 2377a46c0ec8Sopenharmony_ci * width of the device. See the libinput documentation for more details. 2378a46c0ec8Sopenharmony_ci * 2379a46c0ec8Sopenharmony_ci * @param event The libinput tablet tool event 2380a46c0ec8Sopenharmony_ci * @return The current value of the the axis 2381a46c0ec8Sopenharmony_ci * 2382a46c0ec8Sopenharmony_ci * @since 1.2 2383a46c0ec8Sopenharmony_ci */ 2384a46c0ec8Sopenharmony_cidouble 2385a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_get_x(struct libinput_event_tablet_tool *event); 2386a46c0ec8Sopenharmony_ci 2387a46c0ec8Sopenharmony_ci/** 2388a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2389a46c0ec8Sopenharmony_ci * 2390a46c0ec8Sopenharmony_ci * Returns the Y coordinate of the tablet tool, in mm from the top left 2391a46c0ec8Sopenharmony_ci * corner of the tablet in its current logical orientation. Use 2392a46c0ec8Sopenharmony_ci * libinput_event_tablet_tool_get_y_transformed() for transforming the axis 2393a46c0ec8Sopenharmony_ci * value into a different coordinate space. 2394a46c0ec8Sopenharmony_ci * 2395a46c0ec8Sopenharmony_ci * @note On some devices, returned value may be negative or larger than the 2396a46c0ec8Sopenharmony_ci * width of the device. See the libinput documentation for more details. 2397a46c0ec8Sopenharmony_ci * 2398a46c0ec8Sopenharmony_ci * @param event The libinput tablet tool event 2399a46c0ec8Sopenharmony_ci * @return The current value of the the axis 2400a46c0ec8Sopenharmony_ci * 2401a46c0ec8Sopenharmony_ci * @since 1.2 2402a46c0ec8Sopenharmony_ci */ 2403a46c0ec8Sopenharmony_cidouble 2404a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_get_y(struct libinput_event_tablet_tool *event); 2405a46c0ec8Sopenharmony_ci 2406a46c0ec8Sopenharmony_ci/** 2407a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2408a46c0ec8Sopenharmony_ci * 2409a46c0ec8Sopenharmony_ci * Return the delta between the last event and the current event. 2410a46c0ec8Sopenharmony_ci * If the tool employs pointer acceleration, the delta returned by this 2411a46c0ec8Sopenharmony_ci * function is the accelerated delta. 2412a46c0ec8Sopenharmony_ci * 2413a46c0ec8Sopenharmony_ci * This value is in screen coordinate space, the delta is to be interpreted 2414a46c0ec8Sopenharmony_ci * like the return value of libinput_event_pointer_get_dx(). 2415a46c0ec8Sopenharmony_ci * See the libinput documentation for more details. 2416a46c0ec8Sopenharmony_ci * 2417a46c0ec8Sopenharmony_ci * @param event The libinput tablet event 2418a46c0ec8Sopenharmony_ci * @return The relative x movement since the last event 2419a46c0ec8Sopenharmony_ci * 2420a46c0ec8Sopenharmony_ci * @since 1.2 2421a46c0ec8Sopenharmony_ci */ 2422a46c0ec8Sopenharmony_cidouble 2423a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_get_dx(struct libinput_event_tablet_tool *event); 2424a46c0ec8Sopenharmony_ci 2425a46c0ec8Sopenharmony_ci/** 2426a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2427a46c0ec8Sopenharmony_ci * 2428a46c0ec8Sopenharmony_ci * Return the delta between the last event and the current event. 2429a46c0ec8Sopenharmony_ci * If the tool employs pointer acceleration, the delta returned by this 2430a46c0ec8Sopenharmony_ci * function is the accelerated delta. 2431a46c0ec8Sopenharmony_ci * 2432a46c0ec8Sopenharmony_ci * This value is in screen coordinate space, the delta is to be interpreted 2433a46c0ec8Sopenharmony_ci * like the return value of libinput_event_pointer_get_dx(). 2434a46c0ec8Sopenharmony_ci * See the libinput documentation for more details. 2435a46c0ec8Sopenharmony_ci * 2436a46c0ec8Sopenharmony_ci * @param event The libinput tablet event 2437a46c0ec8Sopenharmony_ci * @return The relative y movement since the last event 2438a46c0ec8Sopenharmony_ci * 2439a46c0ec8Sopenharmony_ci * @since 1.2 2440a46c0ec8Sopenharmony_ci */ 2441a46c0ec8Sopenharmony_cidouble 2442a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_get_dy(struct libinput_event_tablet_tool *event); 2443a46c0ec8Sopenharmony_ci 2444a46c0ec8Sopenharmony_ci/** 2445a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2446a46c0ec8Sopenharmony_ci * 2447a46c0ec8Sopenharmony_ci * Returns the current pressure being applied on the tool in use, normalized 2448a46c0ec8Sopenharmony_ci * to the range [0, 1]. 2449a46c0ec8Sopenharmony_ci * 2450a46c0ec8Sopenharmony_ci * If this axis does not exist on the current tool, this function returns 0. 2451a46c0ec8Sopenharmony_ci * 2452a46c0ec8Sopenharmony_ci * @param event The libinput tablet tool event 2453a46c0ec8Sopenharmony_ci * @return The current value of the the axis 2454a46c0ec8Sopenharmony_ci * 2455a46c0ec8Sopenharmony_ci * @since 1.2 2456a46c0ec8Sopenharmony_ci */ 2457a46c0ec8Sopenharmony_cidouble 2458a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_get_pressure(struct libinput_event_tablet_tool *event); 2459a46c0ec8Sopenharmony_ci 2460a46c0ec8Sopenharmony_ci/** 2461a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2462a46c0ec8Sopenharmony_ci * 2463a46c0ec8Sopenharmony_ci * Returns the current distance from the tablet's sensor, normalized to the 2464a46c0ec8Sopenharmony_ci * range [0, 1]. 2465a46c0ec8Sopenharmony_ci * 2466a46c0ec8Sopenharmony_ci * If this axis does not exist on the current tool, this function returns 0. 2467a46c0ec8Sopenharmony_ci * 2468a46c0ec8Sopenharmony_ci * @param event The libinput tablet tool event 2469a46c0ec8Sopenharmony_ci * @return The current value of the the axis 2470a46c0ec8Sopenharmony_ci * 2471a46c0ec8Sopenharmony_ci * @since 1.2 2472a46c0ec8Sopenharmony_ci */ 2473a46c0ec8Sopenharmony_cidouble 2474a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_get_distance(struct libinput_event_tablet_tool *event); 2475a46c0ec8Sopenharmony_ci 2476a46c0ec8Sopenharmony_ci/** 2477a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2478a46c0ec8Sopenharmony_ci * 2479a46c0ec8Sopenharmony_ci * Returns the current tilt along the X axis of the tablet's current logical 2480a46c0ec8Sopenharmony_ci * orientation, in degrees off the tablet's z axis. That is, if the tool is 2481a46c0ec8Sopenharmony_ci * perfectly orthogonal to the tablet, the tilt angle is 0. When the top 2482a46c0ec8Sopenharmony_ci * tilts towards the logical top/left of the tablet, the x/y tilt angles are 2483a46c0ec8Sopenharmony_ci * negative, if the top tilts towards the logical bottom/right of the 2484a46c0ec8Sopenharmony_ci * tablet, the x/y tilt angles are positive. 2485a46c0ec8Sopenharmony_ci * 2486a46c0ec8Sopenharmony_ci * If this axis does not exist on the current tool, this function returns 0. 2487a46c0ec8Sopenharmony_ci * 2488a46c0ec8Sopenharmony_ci * @param event The libinput tablet tool event 2489a46c0ec8Sopenharmony_ci * @return The current value of the axis in degrees 2490a46c0ec8Sopenharmony_ci * 2491a46c0ec8Sopenharmony_ci * @since 1.2 2492a46c0ec8Sopenharmony_ci */ 2493a46c0ec8Sopenharmony_cidouble 2494a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_get_tilt_x(struct libinput_event_tablet_tool *event); 2495a46c0ec8Sopenharmony_ci 2496a46c0ec8Sopenharmony_ci/** 2497a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2498a46c0ec8Sopenharmony_ci * 2499a46c0ec8Sopenharmony_ci * Returns the current tilt along the Y axis of the tablet's current logical 2500a46c0ec8Sopenharmony_ci * orientation, in degrees off the tablet's z axis. That is, if the tool is 2501a46c0ec8Sopenharmony_ci * perfectly orthogonal to the tablet, the tilt angle is 0. When the top 2502a46c0ec8Sopenharmony_ci * tilts towards the logical top/left of the tablet, the x/y tilt angles are 2503a46c0ec8Sopenharmony_ci * negative, if the top tilts towards the logical bottom/right of the 2504a46c0ec8Sopenharmony_ci * tablet, the x/y tilt angles are positive. 2505a46c0ec8Sopenharmony_ci * 2506a46c0ec8Sopenharmony_ci * If this axis does not exist on the current tool, this function returns 0. 2507a46c0ec8Sopenharmony_ci * 2508a46c0ec8Sopenharmony_ci * @param event The libinput tablet tool event 2509a46c0ec8Sopenharmony_ci * @return The current value of the the axis in degrees 2510a46c0ec8Sopenharmony_ci * 2511a46c0ec8Sopenharmony_ci * @since 1.2 2512a46c0ec8Sopenharmony_ci */ 2513a46c0ec8Sopenharmony_cidouble 2514a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_get_tilt_y(struct libinput_event_tablet_tool *event); 2515a46c0ec8Sopenharmony_ci 2516a46c0ec8Sopenharmony_ci/** 2517a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2518a46c0ec8Sopenharmony_ci * 2519a46c0ec8Sopenharmony_ci * Returns the current z rotation of the tool in degrees, clockwise from the 2520a46c0ec8Sopenharmony_ci * tool's logical neutral position. 2521a46c0ec8Sopenharmony_ci * 2522a46c0ec8Sopenharmony_ci * For tools of type @ref LIBINPUT_TABLET_TOOL_TYPE_MOUSE and @ref 2523a46c0ec8Sopenharmony_ci * LIBINPUT_TABLET_TOOL_TYPE_LENS the logical neutral position is 2524a46c0ec8Sopenharmony_ci * pointing to the current logical north of the tablet. For tools of type @ref 2525a46c0ec8Sopenharmony_ci * LIBINPUT_TABLET_TOOL_TYPE_BRUSH, the logical neutral position is with the 2526a46c0ec8Sopenharmony_ci * buttons pointing up. 2527a46c0ec8Sopenharmony_ci * 2528a46c0ec8Sopenharmony_ci * If this axis does not exist on the current tool, this function returns 0. 2529a46c0ec8Sopenharmony_ci * 2530a46c0ec8Sopenharmony_ci * @param event The libinput tablet tool event 2531a46c0ec8Sopenharmony_ci * @return The current value of the the axis 2532a46c0ec8Sopenharmony_ci * 2533a46c0ec8Sopenharmony_ci * @since 1.2 2534a46c0ec8Sopenharmony_ci */ 2535a46c0ec8Sopenharmony_cidouble 2536a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_get_rotation(struct libinput_event_tablet_tool *event); 2537a46c0ec8Sopenharmony_ci 2538a46c0ec8Sopenharmony_ci/** 2539a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2540a46c0ec8Sopenharmony_ci * 2541a46c0ec8Sopenharmony_ci * Returns the current position of the slider on the tool, normalized to the 2542a46c0ec8Sopenharmony_ci * range [-1, 1]. The logical zero is the neutral position of the slider, or 2543a46c0ec8Sopenharmony_ci * the logical center of the axis. This axis is available on e.g. the Wacom 2544a46c0ec8Sopenharmony_ci * Airbrush. 2545a46c0ec8Sopenharmony_ci * 2546a46c0ec8Sopenharmony_ci * If this axis does not exist on the current tool, this function returns 0. 2547a46c0ec8Sopenharmony_ci * 2548a46c0ec8Sopenharmony_ci * @param event The libinput tablet tool event 2549a46c0ec8Sopenharmony_ci * @return The current value of the the axis 2550a46c0ec8Sopenharmony_ci * 2551a46c0ec8Sopenharmony_ci * @since 1.2 2552a46c0ec8Sopenharmony_ci */ 2553a46c0ec8Sopenharmony_cidouble 2554a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_get_slider_position(struct libinput_event_tablet_tool *event); 2555a46c0ec8Sopenharmony_ci 2556a46c0ec8Sopenharmony_ci/** 2557a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2558a46c0ec8Sopenharmony_ci * 2559a46c0ec8Sopenharmony_ci * Returns the current size in mm along the major axis of the touching 2560a46c0ec8Sopenharmony_ci * ellipse. This axis is not necessarily aligned with either x or y, the 2561a46c0ec8Sopenharmony_ci * rotation must be taken into account. 2562a46c0ec8Sopenharmony_ci * 2563a46c0ec8Sopenharmony_ci * Where no rotation is available on a tool, or where rotation is zero, the 2564a46c0ec8Sopenharmony_ci * major axis aligns with the y axis and the minor axis with the x axis. 2565a46c0ec8Sopenharmony_ci * 2566a46c0ec8Sopenharmony_ci * If this axis does not exist on the current tool, this function returns 0. 2567a46c0ec8Sopenharmony_ci * 2568a46c0ec8Sopenharmony_ci * @param event The libinput tablet tool event 2569a46c0ec8Sopenharmony_ci * @return The current value of the axis major in mm 2570a46c0ec8Sopenharmony_ci */ 2571a46c0ec8Sopenharmony_cidouble 2572a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_get_size_major(struct libinput_event_tablet_tool *event); 2573a46c0ec8Sopenharmony_ci 2574a46c0ec8Sopenharmony_ci/** 2575a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2576a46c0ec8Sopenharmony_ci * 2577a46c0ec8Sopenharmony_ci * Returns the current size in mm along the minor axis of the touching 2578a46c0ec8Sopenharmony_ci * ellipse. This axis is not necessarily aligned with either x or y, the 2579a46c0ec8Sopenharmony_ci * rotation must be taken into account. 2580a46c0ec8Sopenharmony_ci * 2581a46c0ec8Sopenharmony_ci * Where no rotation is available on a tool, or where rotation is zero, the 2582a46c0ec8Sopenharmony_ci * minor axis aligns with the y axis and the minor axis with the x axis. 2583a46c0ec8Sopenharmony_ci * 2584a46c0ec8Sopenharmony_ci * If this axis does not exist on the current tool, this function returns 0. 2585a46c0ec8Sopenharmony_ci * 2586a46c0ec8Sopenharmony_ci * @param event The libinput tablet tool event 2587a46c0ec8Sopenharmony_ci * @return The current value of the axis minor in mm 2588a46c0ec8Sopenharmony_ci */ 2589a46c0ec8Sopenharmony_cidouble 2590a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_get_size_minor(struct libinput_event_tablet_tool *event); 2591a46c0ec8Sopenharmony_ci 2592a46c0ec8Sopenharmony_ci/** 2593a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2594a46c0ec8Sopenharmony_ci * 2595a46c0ec8Sopenharmony_ci * Return the delta for the wheel in degrees. 2596a46c0ec8Sopenharmony_ci * 2597a46c0ec8Sopenharmony_ci * @param event The libinput tablet tool event 2598a46c0ec8Sopenharmony_ci * @return The delta of the wheel, in degrees, compared to the last event 2599a46c0ec8Sopenharmony_ci * 2600a46c0ec8Sopenharmony_ci * @see libinput_event_tablet_tool_get_wheel_delta_discrete 2601a46c0ec8Sopenharmony_ci */ 2602a46c0ec8Sopenharmony_cidouble 2603a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_get_wheel_delta( 2604a46c0ec8Sopenharmony_ci struct libinput_event_tablet_tool *event); 2605a46c0ec8Sopenharmony_ci 2606a46c0ec8Sopenharmony_ci/** 2607a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2608a46c0ec8Sopenharmony_ci * 2609a46c0ec8Sopenharmony_ci * Return the delta for the wheel in discrete steps (e.g. wheel clicks). 2610a46c0ec8Sopenharmony_ci 2611a46c0ec8Sopenharmony_ci * @param event The libinput tablet tool event 2612a46c0ec8Sopenharmony_ci * @return The delta of the wheel, in discrete steps, compared to the last event 2613a46c0ec8Sopenharmony_ci * 2614a46c0ec8Sopenharmony_ci * @see libinput_event_tablet_tool_get_wheel_delta_discrete 2615a46c0ec8Sopenharmony_ci * 2616a46c0ec8Sopenharmony_ci * @since 1.2 2617a46c0ec8Sopenharmony_ci */ 2618a46c0ec8Sopenharmony_ciint 2619a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_get_wheel_delta_discrete( 2620a46c0ec8Sopenharmony_ci struct libinput_event_tablet_tool *event); 2621a46c0ec8Sopenharmony_ci 2622a46c0ec8Sopenharmony_ci/** 2623a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2624a46c0ec8Sopenharmony_ci * 2625a46c0ec8Sopenharmony_ci * Return the current absolute x coordinate of the tablet tool event, 2626a46c0ec8Sopenharmony_ci * transformed to screen coordinates. 2627a46c0ec8Sopenharmony_ci * 2628a46c0ec8Sopenharmony_ci * @note This function may be called for a specific axis even if 2629a46c0ec8Sopenharmony_ci * libinput_event_tablet_tool_*_has_changed() returns 0 for that axis. 2630a46c0ec8Sopenharmony_ci * libinput always includes all device axes in the event. 2631a46c0ec8Sopenharmony_ci * 2632a46c0ec8Sopenharmony_ci * @note On some devices, returned value may be negative or larger than the 2633a46c0ec8Sopenharmony_ci * width of the device. See the libinput documentation for more details. 2634a46c0ec8Sopenharmony_ci * 2635a46c0ec8Sopenharmony_ci * @param event The libinput tablet tool event 2636a46c0ec8Sopenharmony_ci * @param width The current output screen width 2637a46c0ec8Sopenharmony_ci * @return the current absolute x coordinate transformed to a screen coordinate 2638a46c0ec8Sopenharmony_ci * 2639a46c0ec8Sopenharmony_ci * @since 1.2 2640a46c0ec8Sopenharmony_ci */ 2641a46c0ec8Sopenharmony_cidouble 2642a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_get_x_transformed(struct libinput_event_tablet_tool *event, 2643a46c0ec8Sopenharmony_ci uint32_t width); 2644a46c0ec8Sopenharmony_ci 2645a46c0ec8Sopenharmony_ci/** 2646a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2647a46c0ec8Sopenharmony_ci * 2648a46c0ec8Sopenharmony_ci * Return the current absolute y coordinate of the tablet tool event, 2649a46c0ec8Sopenharmony_ci * transformed to screen coordinates. 2650a46c0ec8Sopenharmony_ci * 2651a46c0ec8Sopenharmony_ci * @note This function may be called for a specific axis even if 2652a46c0ec8Sopenharmony_ci * libinput_event_tablet_tool_*_has_changed() returns 0 for that axis. 2653a46c0ec8Sopenharmony_ci * libinput always includes all device axes in the event. 2654a46c0ec8Sopenharmony_ci * 2655a46c0ec8Sopenharmony_ci * @note On some devices, returned value may be negative or larger than the 2656a46c0ec8Sopenharmony_ci * width of the device. See the libinput documentation for more details. 2657a46c0ec8Sopenharmony_ci * 2658a46c0ec8Sopenharmony_ci * @param event The libinput tablet tool event 2659a46c0ec8Sopenharmony_ci * @param height The current output screen height 2660a46c0ec8Sopenharmony_ci * @return the current absolute y coordinate transformed to a screen coordinate 2661a46c0ec8Sopenharmony_ci * 2662a46c0ec8Sopenharmony_ci * @since 1.2 2663a46c0ec8Sopenharmony_ci */ 2664a46c0ec8Sopenharmony_cidouble 2665a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_get_y_transformed(struct libinput_event_tablet_tool *event, 2666a46c0ec8Sopenharmony_ci uint32_t height); 2667a46c0ec8Sopenharmony_ci 2668a46c0ec8Sopenharmony_ci/** 2669a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2670a46c0ec8Sopenharmony_ci * 2671a46c0ec8Sopenharmony_ci * Returns the tool that was in use during this event. 2672a46c0ec8Sopenharmony_ci * 2673a46c0ec8Sopenharmony_ci * The returned tablet tool is not refcounted and may become invalid after 2674a46c0ec8Sopenharmony_ci * the next call to libinput. Use libinput_tablet_tool_ref() and 2675a46c0ec8Sopenharmony_ci * libinput_tablet_tool_unref() to continue using the handle outside of the 2676a46c0ec8Sopenharmony_ci * immediate scope. 2677a46c0ec8Sopenharmony_ci * 2678a46c0ec8Sopenharmony_ci * If the caller holds at least one reference, this struct is used 2679a46c0ec8Sopenharmony_ci * whenever the tools enters proximity again. 2680a46c0ec8Sopenharmony_ci * 2681a46c0ec8Sopenharmony_ci * @note Physical tool tracking requires hardware support. If unavailable, 2682a46c0ec8Sopenharmony_ci * libinput creates one tool per type per tablet. See 2683a46c0ec8Sopenharmony_ci * libinput_tablet_tool_get_serial() for more details. 2684a46c0ec8Sopenharmony_ci * 2685a46c0ec8Sopenharmony_ci * @param event The libinput tablet tool event 2686a46c0ec8Sopenharmony_ci * @return The new tool triggering this event 2687a46c0ec8Sopenharmony_ci * 2688a46c0ec8Sopenharmony_ci * @since 1.2 2689a46c0ec8Sopenharmony_ci */ 2690a46c0ec8Sopenharmony_cistruct libinput_tablet_tool * 2691a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_get_tool(struct libinput_event_tablet_tool *event); 2692a46c0ec8Sopenharmony_ci 2693a46c0ec8Sopenharmony_ci/** 2694a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2695a46c0ec8Sopenharmony_ci * 2696a46c0ec8Sopenharmony_ci * Returns the new proximity state of a tool from a proximity event. 2697a46c0ec8Sopenharmony_ci * Used to check whether or not a tool came in or out of proximity during an 2698a46c0ec8Sopenharmony_ci * event of type @ref LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY. 2699a46c0ec8Sopenharmony_ci * 2700a46c0ec8Sopenharmony_ci * The proximity state represents the logical proximity state which does not 2701a46c0ec8Sopenharmony_ci * necessarily match when a tool comes into sensor range or leaves the 2702a46c0ec8Sopenharmony_ci * sensor range. On some tools this range does not represent the physical 2703a46c0ec8Sopenharmony_ci * range but a reduced tool-specific logical range. If the range is reduced, 2704a46c0ec8Sopenharmony_ci * this is done transparent to the caller. 2705a46c0ec8Sopenharmony_ci * 2706a46c0ec8Sopenharmony_ci * For example, the Wacom mouse and lens cursor tools are usually 2707a46c0ec8Sopenharmony_ci * used in relative mode, lying flat on the tablet. Movement typically follows 2708a46c0ec8Sopenharmony_ci * the interaction normal mouse movements have, i.e. slightly lift the tool and 2709a46c0ec8Sopenharmony_ci * place it in a separate location. The proximity detection on Wacom 2710a46c0ec8Sopenharmony_ci * tablets however extends further than the user may lift the mouse, i.e. the 2711a46c0ec8Sopenharmony_ci * tool may not be lifted out of physical proximity. For such tools, libinput 2712a46c0ec8Sopenharmony_ci * provides software-emulated proximity. 2713a46c0ec8Sopenharmony_ci * 2714a46c0ec8Sopenharmony_ci * @param event The libinput tablet tool event 2715a46c0ec8Sopenharmony_ci * @return The new proximity state of the tool from the event. 2716a46c0ec8Sopenharmony_ci * 2717a46c0ec8Sopenharmony_ci * @since 1.2 2718a46c0ec8Sopenharmony_ci */ 2719a46c0ec8Sopenharmony_cienum libinput_tablet_tool_proximity_state 2720a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_get_proximity_state(struct libinput_event_tablet_tool *event); 2721a46c0ec8Sopenharmony_ci 2722a46c0ec8Sopenharmony_ci/** 2723a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2724a46c0ec8Sopenharmony_ci * 2725a46c0ec8Sopenharmony_ci * Returns the new tip state of a tool from a tip event. 2726a46c0ec8Sopenharmony_ci * Used to check whether or not a tool came in contact with the tablet 2727a46c0ec8Sopenharmony_ci * surface or left contact with the tablet surface during an 2728a46c0ec8Sopenharmony_ci * event of type @ref LIBINPUT_EVENT_TABLET_TOOL_TIP. 2729a46c0ec8Sopenharmony_ci * 2730a46c0ec8Sopenharmony_ci * @param event The libinput tablet tool event 2731a46c0ec8Sopenharmony_ci * @return The new tip state of the tool from the event. 2732a46c0ec8Sopenharmony_ci * 2733a46c0ec8Sopenharmony_ci * @since 1.2 2734a46c0ec8Sopenharmony_ci */ 2735a46c0ec8Sopenharmony_cienum libinput_tablet_tool_tip_state 2736a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_get_tip_state(struct libinput_event_tablet_tool *event); 2737a46c0ec8Sopenharmony_ci 2738a46c0ec8Sopenharmony_ci/** 2739a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2740a46c0ec8Sopenharmony_ci * 2741a46c0ec8Sopenharmony_ci * Return the button that triggered this event. For events that are not of 2742a46c0ec8Sopenharmony_ci * type @ref LIBINPUT_EVENT_TABLET_TOOL_BUTTON, this function returns 0. 2743a46c0ec8Sopenharmony_ci * 2744a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other than 2745a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_TOOL_BUTTON. 2746a46c0ec8Sopenharmony_ci * 2747a46c0ec8Sopenharmony_ci * @param event The libinput tablet tool event 2748a46c0ec8Sopenharmony_ci * @return the button triggering this event 2749a46c0ec8Sopenharmony_ci * 2750a46c0ec8Sopenharmony_ci * @since 1.2 2751a46c0ec8Sopenharmony_ci */ 2752a46c0ec8Sopenharmony_ciuint32_t 2753a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_get_button(struct libinput_event_tablet_tool *event); 2754a46c0ec8Sopenharmony_ci 2755a46c0ec8Sopenharmony_ci/** 2756a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2757a46c0ec8Sopenharmony_ci * 2758a46c0ec8Sopenharmony_ci * Return the button state of the event. 2759a46c0ec8Sopenharmony_ci * 2760a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other than 2761a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_TOOL_BUTTON. 2762a46c0ec8Sopenharmony_ci * 2763a46c0ec8Sopenharmony_ci * @param event The libinput tablet tool event 2764a46c0ec8Sopenharmony_ci * @return the button state triggering this event 2765a46c0ec8Sopenharmony_ci * 2766a46c0ec8Sopenharmony_ci * @since 1.2 2767a46c0ec8Sopenharmony_ci */ 2768a46c0ec8Sopenharmony_cienum libinput_button_state 2769a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_get_button_state(struct libinput_event_tablet_tool *event); 2770a46c0ec8Sopenharmony_ci 2771a46c0ec8Sopenharmony_ci/** 2772a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2773a46c0ec8Sopenharmony_ci * 2774a46c0ec8Sopenharmony_ci * For the button of a @ref LIBINPUT_EVENT_TABLET_TOOL_BUTTON event, return the total 2775a46c0ec8Sopenharmony_ci * number of buttons pressed on all devices on the associated seat after the 2776a46c0ec8Sopenharmony_ci * the event was triggered. 2777a46c0ec8Sopenharmony_ci * 2778a46c0ec8Sopenharmony_ci " @note It is an application bug to call this function for events other than 2779a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_TOOL_BUTTON. For other events, this function returns 0. 2780a46c0ec8Sopenharmony_ci * 2781a46c0ec8Sopenharmony_ci * @param event The libinput tablet tool event 2782a46c0ec8Sopenharmony_ci * @return the seat wide pressed button count for the key of this event 2783a46c0ec8Sopenharmony_ci * 2784a46c0ec8Sopenharmony_ci * @since 1.2 2785a46c0ec8Sopenharmony_ci */ 2786a46c0ec8Sopenharmony_ciuint32_t 2787a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_get_seat_button_count(struct libinput_event_tablet_tool *event); 2788a46c0ec8Sopenharmony_ci 2789a46c0ec8Sopenharmony_ci/** 2790a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2791a46c0ec8Sopenharmony_ci * 2792a46c0ec8Sopenharmony_ci * @note Timestamps may not always increase. See the libinput documentation 2793a46c0ec8Sopenharmony_ci * for more details. 2794a46c0ec8Sopenharmony_ci * 2795a46c0ec8Sopenharmony_ci * @param event The libinput tablet tool event 2796a46c0ec8Sopenharmony_ci * @return The event time for this event 2797a46c0ec8Sopenharmony_ci * 2798a46c0ec8Sopenharmony_ci * @since 1.2 2799a46c0ec8Sopenharmony_ci */ 2800a46c0ec8Sopenharmony_ciuint32_t 2801a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_get_time(struct libinput_event_tablet_tool *event); 2802a46c0ec8Sopenharmony_ci 2803a46c0ec8Sopenharmony_ci/** 2804a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2805a46c0ec8Sopenharmony_ci * 2806a46c0ec8Sopenharmony_ci * @note Timestamps may not always increase. See the libinput documentation 2807a46c0ec8Sopenharmony_ci * for more details. 2808a46c0ec8Sopenharmony_ci * 2809a46c0ec8Sopenharmony_ci * @param event The libinput tablet tool event 2810a46c0ec8Sopenharmony_ci * @return The event time for this event in microseconds 2811a46c0ec8Sopenharmony_ci * 2812a46c0ec8Sopenharmony_ci * @since 1.2 2813a46c0ec8Sopenharmony_ci */ 2814a46c0ec8Sopenharmony_ciuint64_t 2815a46c0ec8Sopenharmony_cilibinput_event_tablet_tool_get_time_usec(struct libinput_event_tablet_tool *event); 2816a46c0ec8Sopenharmony_ci 2817a46c0ec8Sopenharmony_ci/** 2818a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2819a46c0ec8Sopenharmony_ci * 2820a46c0ec8Sopenharmony_ci * Return the high-level tool type for a tool object. 2821a46c0ec8Sopenharmony_ci * 2822a46c0ec8Sopenharmony_ci * The high level tool describes general interaction expected with the tool. 2823a46c0ec8Sopenharmony_ci * For example, a user would expect a tool of type @ref 2824a46c0ec8Sopenharmony_ci * LIBINPUT_TABLET_TOOL_TYPE_PEN to interact with a graphics application 2825a46c0ec8Sopenharmony_ci * taking pressure and tilt into account. The default virtual tool assigned 2826a46c0ec8Sopenharmony_ci * should be a drawing tool, e.g. a virtual pen or brush. 2827a46c0ec8Sopenharmony_ci * A tool of type @ref LIBINPUT_TABLET_TOOL_TYPE_ERASER would normally be 2828a46c0ec8Sopenharmony_ci * mapped to an eraser-like virtual tool. 2829a46c0ec8Sopenharmony_ci * 2830a46c0ec8Sopenharmony_ci * If supported by the hardware, a more specific tool id is always 2831a46c0ec8Sopenharmony_ci * available, see libinput_tablet_tool_get_tool_id(). 2832a46c0ec8Sopenharmony_ci * 2833a46c0ec8Sopenharmony_ci * @param tool The libinput tool 2834a46c0ec8Sopenharmony_ci * @return The tool type for this tool object 2835a46c0ec8Sopenharmony_ci * 2836a46c0ec8Sopenharmony_ci * @see libinput_tablet_tool_get_tool_id 2837a46c0ec8Sopenharmony_ci * 2838a46c0ec8Sopenharmony_ci * @since 1.2 2839a46c0ec8Sopenharmony_ci */ 2840a46c0ec8Sopenharmony_cienum libinput_tablet_tool_type 2841a46c0ec8Sopenharmony_cilibinput_tablet_tool_get_type(struct libinput_tablet_tool *tool); 2842a46c0ec8Sopenharmony_ci 2843a46c0ec8Sopenharmony_ci/** 2844a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2845a46c0ec8Sopenharmony_ci * 2846a46c0ec8Sopenharmony_ci * Return the tool ID for a tool object. If nonzero, this number identifies 2847a46c0ec8Sopenharmony_ci * the specific type of the tool with more precision than the type returned in 2848a46c0ec8Sopenharmony_ci * libinput_tablet_tool_get_type(). Not all tablets support a tool ID. 2849a46c0ec8Sopenharmony_ci * 2850a46c0ec8Sopenharmony_ci * Tablets known to support tool IDs include the Wacom Intuos 3, 4, 5, Wacom 2851a46c0ec8Sopenharmony_ci * Cintiq and Wacom Intuos Pro series. The tool ID can be used to 2852a46c0ec8Sopenharmony_ci * distinguish between e.g. a Wacom Classic Pen or a Wacom Pro Pen. It is 2853a46c0ec8Sopenharmony_ci * the caller's responsibility to interpret the tool ID. 2854a46c0ec8Sopenharmony_ci * 2855a46c0ec8Sopenharmony_ci * @param tool The libinput tool 2856a46c0ec8Sopenharmony_ci * @return The tool ID for this tool object or 0 if none is provided 2857a46c0ec8Sopenharmony_ci * 2858a46c0ec8Sopenharmony_ci * @see libinput_tablet_tool_get_type 2859a46c0ec8Sopenharmony_ci * 2860a46c0ec8Sopenharmony_ci * @since 1.2 2861a46c0ec8Sopenharmony_ci */ 2862a46c0ec8Sopenharmony_ciuint64_t 2863a46c0ec8Sopenharmony_cilibinput_tablet_tool_get_tool_id(struct libinput_tablet_tool *tool); 2864a46c0ec8Sopenharmony_ci 2865a46c0ec8Sopenharmony_ci/** 2866a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2867a46c0ec8Sopenharmony_ci * 2868a46c0ec8Sopenharmony_ci * Increment the reference count of the tool by one. A tool is destroyed 2869a46c0ec8Sopenharmony_ci * whenever the reference count reaches 0. See libinput_tablet_tool_unref(). 2870a46c0ec8Sopenharmony_ci * 2871a46c0ec8Sopenharmony_ci * @param tool The tool to increment the ref count of 2872a46c0ec8Sopenharmony_ci * @return The passed tool 2873a46c0ec8Sopenharmony_ci * 2874a46c0ec8Sopenharmony_ci * @see libinput_tablet_tool_unref 2875a46c0ec8Sopenharmony_ci * 2876a46c0ec8Sopenharmony_ci * @since 1.2 2877a46c0ec8Sopenharmony_ci */ 2878a46c0ec8Sopenharmony_cistruct libinput_tablet_tool * 2879a46c0ec8Sopenharmony_cilibinput_tablet_tool_ref(struct libinput_tablet_tool *tool); 2880a46c0ec8Sopenharmony_ci 2881a46c0ec8Sopenharmony_ci/** 2882a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2883a46c0ec8Sopenharmony_ci * 2884a46c0ec8Sopenharmony_ci * Decrement the reference count of the tool by one. When the reference 2885a46c0ec8Sopenharmony_ci * count of the tool reaches 0, the memory allocated for the tool will be 2886a46c0ec8Sopenharmony_ci * freed. 2887a46c0ec8Sopenharmony_ci * 2888a46c0ec8Sopenharmony_ci * @param tool The tool to decrement the ref count of 2889a46c0ec8Sopenharmony_ci * @return NULL if the tool was destroyed otherwise the passed tool 2890a46c0ec8Sopenharmony_ci * 2891a46c0ec8Sopenharmony_ci * @see libinput_tablet_tool_ref 2892a46c0ec8Sopenharmony_ci * 2893a46c0ec8Sopenharmony_ci * @since 1.2 2894a46c0ec8Sopenharmony_ci */ 2895a46c0ec8Sopenharmony_cistruct libinput_tablet_tool * 2896a46c0ec8Sopenharmony_cilibinput_tablet_tool_unref(struct libinput_tablet_tool *tool); 2897a46c0ec8Sopenharmony_ci 2898a46c0ec8Sopenharmony_ci/** 2899a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2900a46c0ec8Sopenharmony_ci * 2901a46c0ec8Sopenharmony_ci * Return whether the tablet tool supports pressure. 2902a46c0ec8Sopenharmony_ci * 2903a46c0ec8Sopenharmony_ci * @param tool The tool to check the axis capabilities of 2904a46c0ec8Sopenharmony_ci * @return Nonzero if the axis is available, zero otherwise. 2905a46c0ec8Sopenharmony_ci * 2906a46c0ec8Sopenharmony_ci * @since 1.2 2907a46c0ec8Sopenharmony_ci */ 2908a46c0ec8Sopenharmony_ciint 2909a46c0ec8Sopenharmony_cilibinput_tablet_tool_has_pressure(struct libinput_tablet_tool *tool); 2910a46c0ec8Sopenharmony_ci 2911a46c0ec8Sopenharmony_ci/** 2912a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2913a46c0ec8Sopenharmony_ci * 2914a46c0ec8Sopenharmony_ci * Return whether the tablet tool supports distance. 2915a46c0ec8Sopenharmony_ci * 2916a46c0ec8Sopenharmony_ci * @param tool The tool to check the axis capabilities of 2917a46c0ec8Sopenharmony_ci * @return Nonzero if the axis is available, zero otherwise. 2918a46c0ec8Sopenharmony_ci * 2919a46c0ec8Sopenharmony_ci * @since 1.2 2920a46c0ec8Sopenharmony_ci */ 2921a46c0ec8Sopenharmony_ciint 2922a46c0ec8Sopenharmony_cilibinput_tablet_tool_has_distance(struct libinput_tablet_tool *tool); 2923a46c0ec8Sopenharmony_ci 2924a46c0ec8Sopenharmony_ci/** 2925a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2926a46c0ec8Sopenharmony_ci * 2927a46c0ec8Sopenharmony_ci * Return whether the tablet tool supports tilt. 2928a46c0ec8Sopenharmony_ci * 2929a46c0ec8Sopenharmony_ci * @param tool The tool to check the axis capabilities of 2930a46c0ec8Sopenharmony_ci * @return Nonzero if the axis is available, zero otherwise. 2931a46c0ec8Sopenharmony_ci * 2932a46c0ec8Sopenharmony_ci * @since 1.2 2933a46c0ec8Sopenharmony_ci */ 2934a46c0ec8Sopenharmony_ciint 2935a46c0ec8Sopenharmony_cilibinput_tablet_tool_has_tilt(struct libinput_tablet_tool *tool); 2936a46c0ec8Sopenharmony_ci 2937a46c0ec8Sopenharmony_ci/** 2938a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2939a46c0ec8Sopenharmony_ci * 2940a46c0ec8Sopenharmony_ci * Return whether the tablet tool supports z-rotation. 2941a46c0ec8Sopenharmony_ci * 2942a46c0ec8Sopenharmony_ci * @param tool The tool to check the axis capabilities of 2943a46c0ec8Sopenharmony_ci * @return Nonzero if the axis is available, zero otherwise. 2944a46c0ec8Sopenharmony_ci * 2945a46c0ec8Sopenharmony_ci * @since 1.2 2946a46c0ec8Sopenharmony_ci */ 2947a46c0ec8Sopenharmony_ciint 2948a46c0ec8Sopenharmony_cilibinput_tablet_tool_has_rotation(struct libinput_tablet_tool *tool); 2949a46c0ec8Sopenharmony_ci 2950a46c0ec8Sopenharmony_ci/** 2951a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2952a46c0ec8Sopenharmony_ci * 2953a46c0ec8Sopenharmony_ci * Return whether the tablet tool has a slider axis. 2954a46c0ec8Sopenharmony_ci * 2955a46c0ec8Sopenharmony_ci * @param tool The tool to check the axis capabilities of 2956a46c0ec8Sopenharmony_ci * @return Nonzero if the axis is available, zero otherwise. 2957a46c0ec8Sopenharmony_ci * 2958a46c0ec8Sopenharmony_ci * @since 1.2 2959a46c0ec8Sopenharmony_ci */ 2960a46c0ec8Sopenharmony_ciint 2961a46c0ec8Sopenharmony_cilibinput_tablet_tool_has_slider(struct libinput_tablet_tool *tool); 2962a46c0ec8Sopenharmony_ci 2963a46c0ec8Sopenharmony_ci/** 2964a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2965a46c0ec8Sopenharmony_ci * 2966a46c0ec8Sopenharmony_ci * Return whether the tablet tool has a ellipsis major and minor. 2967a46c0ec8Sopenharmony_ci * Where the underlying hardware only supports one of either major or minor, 2968a46c0ec8Sopenharmony_ci * libinput emulates the other axis as a circular contact, i.e. major == 2969a46c0ec8Sopenharmony_ci * minor for all values of major. 2970a46c0ec8Sopenharmony_ci * 2971a46c0ec8Sopenharmony_ci * @param tool The tool to check the axis capabilities of 2972a46c0ec8Sopenharmony_ci * @return Nonzero if the axis is available, zero otherwise. 2973a46c0ec8Sopenharmony_ci */ 2974a46c0ec8Sopenharmony_ciint 2975a46c0ec8Sopenharmony_cilibinput_tablet_tool_has_size(struct libinput_tablet_tool *tool); 2976a46c0ec8Sopenharmony_ci 2977a46c0ec8Sopenharmony_ci/** 2978a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2979a46c0ec8Sopenharmony_ci * 2980a46c0ec8Sopenharmony_ci * Return whether the tablet tool has a relative wheel. 2981a46c0ec8Sopenharmony_ci * 2982a46c0ec8Sopenharmony_ci * @param tool The tool to check the axis capabilities of 2983a46c0ec8Sopenharmony_ci * @return Nonzero if the axis is available, zero otherwise. 2984a46c0ec8Sopenharmony_ci * 2985a46c0ec8Sopenharmony_ci * @since 1.2 2986a46c0ec8Sopenharmony_ci */ 2987a46c0ec8Sopenharmony_ciint 2988a46c0ec8Sopenharmony_cilibinput_tablet_tool_has_wheel(struct libinput_tablet_tool *tool); 2989a46c0ec8Sopenharmony_ci 2990a46c0ec8Sopenharmony_ci/** 2991a46c0ec8Sopenharmony_ci * @ingroup event_tablet 2992a46c0ec8Sopenharmony_ci * 2993a46c0ec8Sopenharmony_ci * Check if a tablet tool has a button with the 2994a46c0ec8Sopenharmony_ci * passed-in code (see linux/input.h). 2995a46c0ec8Sopenharmony_ci * 2996a46c0ec8Sopenharmony_ci * @param tool A tablet tool 2997a46c0ec8Sopenharmony_ci * @param code button code to check for 2998a46c0ec8Sopenharmony_ci * 2999a46c0ec8Sopenharmony_ci * @return 1 if the tool supports this button code, 0 if it does not 3000a46c0ec8Sopenharmony_ci * 3001a46c0ec8Sopenharmony_ci * @since 1.2 3002a46c0ec8Sopenharmony_ci */ 3003a46c0ec8Sopenharmony_ciint 3004a46c0ec8Sopenharmony_cilibinput_tablet_tool_has_button(struct libinput_tablet_tool *tool, 3005a46c0ec8Sopenharmony_ci uint32_t code); 3006a46c0ec8Sopenharmony_ci 3007a46c0ec8Sopenharmony_ci/** 3008a46c0ec8Sopenharmony_ci * @ingroup event_tablet 3009a46c0ec8Sopenharmony_ci * 3010a46c0ec8Sopenharmony_ci * Return nonzero if the physical tool can be uniquely identified by 3011a46c0ec8Sopenharmony_ci * libinput, or nonzero otherwise. If a tool can be uniquely identified, 3012a46c0ec8Sopenharmony_ci * keeping a reference to the tool allows tracking the tool across 3013a46c0ec8Sopenharmony_ci * proximity out sequences and across compatible tablets. 3014a46c0ec8Sopenharmony_ci * See libinput_tablet_tool_get_serial() for more details. 3015a46c0ec8Sopenharmony_ci * 3016a46c0ec8Sopenharmony_ci * @param tool A tablet tool 3017a46c0ec8Sopenharmony_ci * @return 1 if the tool can be uniquely identified, 0 otherwise. 3018a46c0ec8Sopenharmony_ci * 3019a46c0ec8Sopenharmony_ci * @see libinput_tablet_tool_get_serial 3020a46c0ec8Sopenharmony_ci * 3021a46c0ec8Sopenharmony_ci * @since 1.2 3022a46c0ec8Sopenharmony_ci */ 3023a46c0ec8Sopenharmony_ciint 3024a46c0ec8Sopenharmony_cilibinput_tablet_tool_is_unique(struct libinput_tablet_tool *tool); 3025a46c0ec8Sopenharmony_ci 3026a46c0ec8Sopenharmony_ci/** 3027a46c0ec8Sopenharmony_ci * @ingroup event_tablet 3028a46c0ec8Sopenharmony_ci * 3029a46c0ec8Sopenharmony_ci * Return the serial number of a tool. If the tool does not report a serial 3030a46c0ec8Sopenharmony_ci * number, this function returns zero. 3031a46c0ec8Sopenharmony_ci * 3032a46c0ec8Sopenharmony_ci * Some tools provide hardware information that enables libinput to uniquely 3033a46c0ec8Sopenharmony_ci * identify the physical device. For example, tools compatible with the 3034a46c0ec8Sopenharmony_ci * Wacom Intuos 4, Intuos 5, Intuos Pro and Cintiq series are uniquely 3035a46c0ec8Sopenharmony_ci * identifiable through a serial number. libinput does not specify how a 3036a46c0ec8Sopenharmony_ci * tool can be identified uniquely, a caller should use 3037a46c0ec8Sopenharmony_ci * libinput_tablet_tool_is_unique() to check if the tool is unique. 3038a46c0ec8Sopenharmony_ci * 3039a46c0ec8Sopenharmony_ci * libinput creates a struct @ref libinput_tablet_tool on the first 3040a46c0ec8Sopenharmony_ci * proximity in of this tool. By default, this struct is destroyed on 3041a46c0ec8Sopenharmony_ci * proximity out and re-initialized on the next proximity in. If a caller 3042a46c0ec8Sopenharmony_ci * keeps a reference to the tool by using libinput_tablet_tool_ref() 3043a46c0ec8Sopenharmony_ci * libinput re-uses this struct whenever that same physical tool comes into 3044a46c0ec8Sopenharmony_ci * proximity on any tablet 3045a46c0ec8Sopenharmony_ci * recognized by libinput. It is possible to attach tool-specific virtual 3046a46c0ec8Sopenharmony_ci * state to the tool. For example, a graphics program such as the GIMP may 3047a46c0ec8Sopenharmony_ci * assign a specific color to each tool, allowing the artist to use the 3048a46c0ec8Sopenharmony_ci * tools like physical pens of different color. In multi-tablet setups it is 3049a46c0ec8Sopenharmony_ci * also possible to track the tool across devices. 3050a46c0ec8Sopenharmony_ci * 3051a46c0ec8Sopenharmony_ci * If the tool does not have a unique identifier, libinput creates a single 3052a46c0ec8Sopenharmony_ci * struct @ref libinput_tablet_tool per tool type on each tablet the tool is 3053a46c0ec8Sopenharmony_ci * used on. 3054a46c0ec8Sopenharmony_ci * 3055a46c0ec8Sopenharmony_ci * @param tool The libinput tool 3056a46c0ec8Sopenharmony_ci * @return The tool serial number 3057a46c0ec8Sopenharmony_ci * 3058a46c0ec8Sopenharmony_ci * @see libinput_tablet_tool_is_unique 3059a46c0ec8Sopenharmony_ci * 3060a46c0ec8Sopenharmony_ci * @since 1.2 3061a46c0ec8Sopenharmony_ci */ 3062a46c0ec8Sopenharmony_ciuint64_t 3063a46c0ec8Sopenharmony_cilibinput_tablet_tool_get_serial(struct libinput_tablet_tool *tool); 3064a46c0ec8Sopenharmony_ci 3065a46c0ec8Sopenharmony_ci/** 3066a46c0ec8Sopenharmony_ci * @ingroup event_tablet 3067a46c0ec8Sopenharmony_ci * 3068a46c0ec8Sopenharmony_ci * Return the user data associated with a tool object. libinput does 3069a46c0ec8Sopenharmony_ci * not manage, look at, or modify this data. The caller must ensure the 3070a46c0ec8Sopenharmony_ci * data is valid. 3071a46c0ec8Sopenharmony_ci * 3072a46c0ec8Sopenharmony_ci * @param tool The libinput tool 3073a46c0ec8Sopenharmony_ci * @return The user data associated with the tool object 3074a46c0ec8Sopenharmony_ci * 3075a46c0ec8Sopenharmony_ci * @since 1.2 3076a46c0ec8Sopenharmony_ci */ 3077a46c0ec8Sopenharmony_civoid * 3078a46c0ec8Sopenharmony_cilibinput_tablet_tool_get_user_data(struct libinput_tablet_tool *tool); 3079a46c0ec8Sopenharmony_ci 3080a46c0ec8Sopenharmony_ci/** 3081a46c0ec8Sopenharmony_ci * @ingroup event_tablet 3082a46c0ec8Sopenharmony_ci * 3083a46c0ec8Sopenharmony_ci * Set the user data associated with a tool object, if any. 3084a46c0ec8Sopenharmony_ci * 3085a46c0ec8Sopenharmony_ci * @param tool The libinput tool 3086a46c0ec8Sopenharmony_ci * @param user_data The user data to associate with the tool object 3087a46c0ec8Sopenharmony_ci * 3088a46c0ec8Sopenharmony_ci * @since 1.2 3089a46c0ec8Sopenharmony_ci */ 3090a46c0ec8Sopenharmony_civoid 3091a46c0ec8Sopenharmony_cilibinput_tablet_tool_set_user_data(struct libinput_tablet_tool *tool, 3092a46c0ec8Sopenharmony_ci void *user_data); 3093a46c0ec8Sopenharmony_ci 3094a46c0ec8Sopenharmony_ci/** 3095a46c0ec8Sopenharmony_ci * @defgroup event_tablet_pad Tablet pad events 3096a46c0ec8Sopenharmony_ci * 3097a46c0ec8Sopenharmony_ci * Events that come from the pad of tablet devices. For events from the 3098a46c0ec8Sopenharmony_ci * tablet tools, see @ref event_tablet. 3099a46c0ec8Sopenharmony_ci * 3100a46c0ec8Sopenharmony_ci * @since 1.3 3101a46c0ec8Sopenharmony_ci */ 3102a46c0ec8Sopenharmony_ci 3103a46c0ec8Sopenharmony_ci/** 3104a46c0ec8Sopenharmony_ci * @ingroup event_tablet_pad 3105a46c0ec8Sopenharmony_ci * 3106a46c0ec8Sopenharmony_ci * @return The generic libinput_event of this event 3107a46c0ec8Sopenharmony_ci * 3108a46c0ec8Sopenharmony_ci * @since 1.3 3109a46c0ec8Sopenharmony_ci */ 3110a46c0ec8Sopenharmony_cistruct libinput_event * 3111a46c0ec8Sopenharmony_cilibinput_event_tablet_pad_get_base_event(struct libinput_event_tablet_pad *event); 3112a46c0ec8Sopenharmony_ci 3113a46c0ec8Sopenharmony_ci/** 3114a46c0ec8Sopenharmony_ci * @ingroup event_tablet_pad 3115a46c0ec8Sopenharmony_ci * 3116a46c0ec8Sopenharmony_ci * Returns the current position of the ring, in degrees counterclockwise 3117a46c0ec8Sopenharmony_ci * from the northern-most point of the ring in the tablet's current logical 3118a46c0ec8Sopenharmony_ci * orientation. 3119a46c0ec8Sopenharmony_ci * 3120a46c0ec8Sopenharmony_ci * If the source is @ref LIBINPUT_TABLET_PAD_RING_SOURCE_FINGER, 3121a46c0ec8Sopenharmony_ci * libinput sends a terminating event with a ring value of -1 when the 3122a46c0ec8Sopenharmony_ci * finger is lifted from the ring. A caller may use this information to e.g. 3123a46c0ec8Sopenharmony_ci * determine if kinetic scrolling should be triggered. 3124a46c0ec8Sopenharmony_ci * 3125a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other than 3126a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_PAD_RING. For other events, this function 3127a46c0ec8Sopenharmony_ci * returns 0. 3128a46c0ec8Sopenharmony_ci * 3129a46c0ec8Sopenharmony_ci * @param event The libinput tablet pad event 3130a46c0ec8Sopenharmony_ci * @return The current value of the the axis 3131a46c0ec8Sopenharmony_ci * @retval -1 The finger was lifted 3132a46c0ec8Sopenharmony_ci * 3133a46c0ec8Sopenharmony_ci * @since 1.3 3134a46c0ec8Sopenharmony_ci */ 3135a46c0ec8Sopenharmony_cidouble 3136a46c0ec8Sopenharmony_cilibinput_event_tablet_pad_get_ring_position(struct libinput_event_tablet_pad *event); 3137a46c0ec8Sopenharmony_ci 3138a46c0ec8Sopenharmony_ci/** 3139a46c0ec8Sopenharmony_ci * @ingroup event_tablet_pad 3140a46c0ec8Sopenharmony_ci * 3141a46c0ec8Sopenharmony_ci * Returns the number of the ring that has changed state, with 0 being the 3142a46c0ec8Sopenharmony_ci * first ring. On tablets with only one ring, this function always returns 3143a46c0ec8Sopenharmony_ci * 0. 3144a46c0ec8Sopenharmony_ci * 3145a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other than 3146a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_PAD_RING. For other events, this function 3147a46c0ec8Sopenharmony_ci * returns 0. 3148a46c0ec8Sopenharmony_ci * 3149a46c0ec8Sopenharmony_ci * @param event The libinput tablet pad event 3150a46c0ec8Sopenharmony_ci * @return The index of the ring that changed state 3151a46c0ec8Sopenharmony_ci * 3152a46c0ec8Sopenharmony_ci * @since 1.3 3153a46c0ec8Sopenharmony_ci */ 3154a46c0ec8Sopenharmony_ciunsigned int 3155a46c0ec8Sopenharmony_cilibinput_event_tablet_pad_get_ring_number(struct libinput_event_tablet_pad *event); 3156a46c0ec8Sopenharmony_ci 3157a46c0ec8Sopenharmony_ci/** 3158a46c0ec8Sopenharmony_ci * @ingroup event_tablet_pad 3159a46c0ec8Sopenharmony_ci * 3160a46c0ec8Sopenharmony_ci * Returns the source of the interaction with the ring. If the source is 3161a46c0ec8Sopenharmony_ci * @ref LIBINPUT_TABLET_PAD_RING_SOURCE_FINGER, libinput sends a ring 3162a46c0ec8Sopenharmony_ci * position value of -1 to terminate the current interaction. 3163a46c0ec8Sopenharmony_ci * 3164a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other than 3165a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_PAD_RING. For other events, this function 3166a46c0ec8Sopenharmony_ci * returns 0. 3167a46c0ec8Sopenharmony_ci * 3168a46c0ec8Sopenharmony_ci * @param event The libinput tablet pad event 3169a46c0ec8Sopenharmony_ci * @return The source of the ring interaction 3170a46c0ec8Sopenharmony_ci * 3171a46c0ec8Sopenharmony_ci * @since 1.3 3172a46c0ec8Sopenharmony_ci */ 3173a46c0ec8Sopenharmony_cienum libinput_tablet_pad_ring_axis_source 3174a46c0ec8Sopenharmony_cilibinput_event_tablet_pad_get_ring_source(struct libinput_event_tablet_pad *event); 3175a46c0ec8Sopenharmony_ci 3176a46c0ec8Sopenharmony_ci/** 3177a46c0ec8Sopenharmony_ci * @ingroup event_tablet_pad 3178a46c0ec8Sopenharmony_ci * 3179a46c0ec8Sopenharmony_ci * Returns the current position of the strip, normalized to the range 3180a46c0ec8Sopenharmony_ci * [0, 1], with 0 being the top/left-most point in the tablet's current 3181a46c0ec8Sopenharmony_ci * logical orientation. 3182a46c0ec8Sopenharmony_ci * 3183a46c0ec8Sopenharmony_ci * If the source is @ref LIBINPUT_TABLET_PAD_STRIP_SOURCE_FINGER, 3184a46c0ec8Sopenharmony_ci * libinput sends a terminating event with a ring value of -1 when the 3185a46c0ec8Sopenharmony_ci * finger is lifted from the ring. A caller may use this information to e.g. 3186a46c0ec8Sopenharmony_ci * determine if kinetic scrolling should be triggered. 3187a46c0ec8Sopenharmony_ci * 3188a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other than 3189a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_PAD_STRIP. For other events, this function 3190a46c0ec8Sopenharmony_ci * returns 0. 3191a46c0ec8Sopenharmony_ci * 3192a46c0ec8Sopenharmony_ci * @param event The libinput tablet pad event 3193a46c0ec8Sopenharmony_ci * @return The current value of the the axis 3194a46c0ec8Sopenharmony_ci * @retval -1 The finger was lifted 3195a46c0ec8Sopenharmony_ci * 3196a46c0ec8Sopenharmony_ci * @since 1.3 3197a46c0ec8Sopenharmony_ci */ 3198a46c0ec8Sopenharmony_cidouble 3199a46c0ec8Sopenharmony_cilibinput_event_tablet_pad_get_strip_position(struct libinput_event_tablet_pad *event); 3200a46c0ec8Sopenharmony_ci 3201a46c0ec8Sopenharmony_ci/** 3202a46c0ec8Sopenharmony_ci * @ingroup event_tablet_pad 3203a46c0ec8Sopenharmony_ci * 3204a46c0ec8Sopenharmony_ci * Returns the number of the strip that has changed state, with 0 being the 3205a46c0ec8Sopenharmony_ci * first strip. On tablets with only one strip, this function always returns 3206a46c0ec8Sopenharmony_ci * 0. 3207a46c0ec8Sopenharmony_ci * 3208a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other than 3209a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_PAD_STRIP. For other events, this function 3210a46c0ec8Sopenharmony_ci * returns 0. 3211a46c0ec8Sopenharmony_ci * 3212a46c0ec8Sopenharmony_ci * @param event The libinput tablet pad event 3213a46c0ec8Sopenharmony_ci * @return The index of the strip that changed state 3214a46c0ec8Sopenharmony_ci * 3215a46c0ec8Sopenharmony_ci * @since 1.3 3216a46c0ec8Sopenharmony_ci */ 3217a46c0ec8Sopenharmony_ciunsigned int 3218a46c0ec8Sopenharmony_cilibinput_event_tablet_pad_get_strip_number(struct libinput_event_tablet_pad *event); 3219a46c0ec8Sopenharmony_ci 3220a46c0ec8Sopenharmony_ci/** 3221a46c0ec8Sopenharmony_ci * @ingroup event_tablet_pad 3222a46c0ec8Sopenharmony_ci * 3223a46c0ec8Sopenharmony_ci * Returns the source of the interaction with the strip. If the source is 3224a46c0ec8Sopenharmony_ci * @ref LIBINPUT_TABLET_PAD_STRIP_SOURCE_FINGER, libinput sends a strip 3225a46c0ec8Sopenharmony_ci * position value of -1 to terminate the current interaction. 3226a46c0ec8Sopenharmony_ci * 3227a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other than 3228a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_PAD_STRIP. For other events, this function 3229a46c0ec8Sopenharmony_ci * returns 0. 3230a46c0ec8Sopenharmony_ci * 3231a46c0ec8Sopenharmony_ci * @param event The libinput tablet pad event 3232a46c0ec8Sopenharmony_ci * @return The source of the strip interaction 3233a46c0ec8Sopenharmony_ci * 3234a46c0ec8Sopenharmony_ci * @since 1.3 3235a46c0ec8Sopenharmony_ci */ 3236a46c0ec8Sopenharmony_cienum libinput_tablet_pad_strip_axis_source 3237a46c0ec8Sopenharmony_cilibinput_event_tablet_pad_get_strip_source(struct libinput_event_tablet_pad *event); 3238a46c0ec8Sopenharmony_ci 3239a46c0ec8Sopenharmony_ci/** 3240a46c0ec8Sopenharmony_ci * @ingroup event_tablet_pad 3241a46c0ec8Sopenharmony_ci * 3242a46c0ec8Sopenharmony_ci * Return the button number that triggered this event, starting at 0. 3243a46c0ec8Sopenharmony_ci * For events that are not of type @ref LIBINPUT_EVENT_TABLET_PAD_BUTTON, 3244a46c0ec8Sopenharmony_ci * this function returns 0. 3245a46c0ec8Sopenharmony_ci * 3246a46c0ec8Sopenharmony_ci * Note that the number returned is a generic sequential button number and 3247a46c0ec8Sopenharmony_ci * not a semantic button code as defined in linux/input.h. 3248a46c0ec8Sopenharmony_ci * See the libinput documentation for more details. 3249a46c0ec8Sopenharmony_ci * 3250a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other than 3251a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_PAD_BUTTON. For other events, this function 3252a46c0ec8Sopenharmony_ci * returns 0. 3253a46c0ec8Sopenharmony_ci * 3254a46c0ec8Sopenharmony_ci * @param event The libinput tablet pad event 3255a46c0ec8Sopenharmony_ci * @return the button triggering this event 3256a46c0ec8Sopenharmony_ci * 3257a46c0ec8Sopenharmony_ci * @since 1.3 3258a46c0ec8Sopenharmony_ci */ 3259a46c0ec8Sopenharmony_ciuint32_t 3260a46c0ec8Sopenharmony_cilibinput_event_tablet_pad_get_button_number(struct libinput_event_tablet_pad *event); 3261a46c0ec8Sopenharmony_ci 3262a46c0ec8Sopenharmony_ci/** 3263a46c0ec8Sopenharmony_ci * @ingroup event_tablet_pad 3264a46c0ec8Sopenharmony_ci * 3265a46c0ec8Sopenharmony_ci * Return the button state of the event. 3266a46c0ec8Sopenharmony_ci * 3267a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other than 3268a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_PAD_BUTTON. For other events, this function 3269a46c0ec8Sopenharmony_ci * returns 0. 3270a46c0ec8Sopenharmony_ci * 3271a46c0ec8Sopenharmony_ci * @param event The libinput tablet pad event 3272a46c0ec8Sopenharmony_ci * @return the button state triggering this event 3273a46c0ec8Sopenharmony_ci * 3274a46c0ec8Sopenharmony_ci * @since 1.3 3275a46c0ec8Sopenharmony_ci */ 3276a46c0ec8Sopenharmony_cienum libinput_button_state 3277a46c0ec8Sopenharmony_cilibinput_event_tablet_pad_get_button_state(struct libinput_event_tablet_pad *event); 3278a46c0ec8Sopenharmony_ci 3279a46c0ec8Sopenharmony_ci/** 3280a46c0ec8Sopenharmony_ci * @ingroup event_tablet_pad 3281a46c0ec8Sopenharmony_ci * 3282a46c0ec8Sopenharmony_ci * Return the key code that triggered this event, e.g. KEY_CONTROLPANEL. The 3283a46c0ec8Sopenharmony_ci * list of key codes is defined in linux/input-event-codes.h. 3284a46c0ec8Sopenharmony_ci * 3285a46c0ec8Sopenharmony_ci * For events that are not of type @ref LIBINPUT_EVENT_TABLET_PAD_KEY, 3286a46c0ec8Sopenharmony_ci * this function returns 0. 3287a46c0ec8Sopenharmony_ci * 3288a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other than 3289a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_PAD_KEY. For other events, this function 3290a46c0ec8Sopenharmony_ci * returns 0. 3291a46c0ec8Sopenharmony_ci * 3292a46c0ec8Sopenharmony_ci * @param event The libinput tablet pad event 3293a46c0ec8Sopenharmony_ci * @return the key code triggering this event 3294a46c0ec8Sopenharmony_ci * 3295a46c0ec8Sopenharmony_ci * @since 1.15 3296a46c0ec8Sopenharmony_ci */ 3297a46c0ec8Sopenharmony_ciuint32_t 3298a46c0ec8Sopenharmony_cilibinput_event_tablet_pad_get_key(struct libinput_event_tablet_pad *event); 3299a46c0ec8Sopenharmony_ci 3300a46c0ec8Sopenharmony_ci/** 3301a46c0ec8Sopenharmony_ci * @ingroup event_tablet_pad 3302a46c0ec8Sopenharmony_ci * 3303a46c0ec8Sopenharmony_ci * Return the key state of the event. 3304a46c0ec8Sopenharmony_ci * 3305a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other than 3306a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_TABLET_PAD_KEY. For other events, this function 3307a46c0ec8Sopenharmony_ci * returns 0. 3308a46c0ec8Sopenharmony_ci * 3309a46c0ec8Sopenharmony_ci * @param event The libinput tablet pad event 3310a46c0ec8Sopenharmony_ci * @return the key state triggering this event 3311a46c0ec8Sopenharmony_ci * 3312a46c0ec8Sopenharmony_ci * @since 1.15 3313a46c0ec8Sopenharmony_ci */ 3314a46c0ec8Sopenharmony_cienum libinput_key_state 3315a46c0ec8Sopenharmony_cilibinput_event_tablet_pad_get_key_state(struct libinput_event_tablet_pad *event); 3316a46c0ec8Sopenharmony_ci 3317a46c0ec8Sopenharmony_ci/** 3318a46c0ec8Sopenharmony_ci * @ingroup event_tablet_pad 3319a46c0ec8Sopenharmony_ci * 3320a46c0ec8Sopenharmony_ci * Returns the mode the button, ring, or strip that triggered this event is 3321a46c0ec8Sopenharmony_ci * in, at the time of the event. 3322a46c0ec8Sopenharmony_ci * 3323a46c0ec8Sopenharmony_ci * The mode is a virtual grouping of functionality, usually based on some 3324a46c0ec8Sopenharmony_ci * visual feedback like LEDs on the pad. Mode indices start at 0, a device 3325a46c0ec8Sopenharmony_ci * that does not support modes always returns 0. 3326a46c0ec8Sopenharmony_ci * 3327a46c0ec8Sopenharmony_ci * @note Pad keys are not part of a mode group. It is an application bug to 3328a46c0ec8Sopenharmony_ci * call this function for @ref LIBINPUT_EVENT_TABLET_PAD_KEY. 3329a46c0ec8Sopenharmony_ci * 3330a46c0ec8Sopenharmony_ci * Mode switching is controlled by libinput and more than one mode may exist 3331a46c0ec8Sopenharmony_ci * on the tablet. This function returns the mode that this event's button, 3332a46c0ec8Sopenharmony_ci * ring or strip is logically in. If the button is a mode toggle button 3333a46c0ec8Sopenharmony_ci * and the button event caused a new mode to be toggled, the mode returned 3334a46c0ec8Sopenharmony_ci * is the new mode the button is in. 3335a46c0ec8Sopenharmony_ci * 3336a46c0ec8Sopenharmony_ci * Note that the returned mode is the mode valid as of the time of the 3337a46c0ec8Sopenharmony_ci * event. The returned mode may thus be different to the mode returned by 3338a46c0ec8Sopenharmony_ci * libinput_tablet_pad_mode_group_get_mode(). See 3339a46c0ec8Sopenharmony_ci * libinput_tablet_pad_mode_group_get_mode() for details. 3340a46c0ec8Sopenharmony_ci * 3341a46c0ec8Sopenharmony_ci * @param event The libinput tablet pad event 3342a46c0ec8Sopenharmony_ci * @return the 0-indexed mode of this button, ring or strip at the time of 3343a46c0ec8Sopenharmony_ci * the event 3344a46c0ec8Sopenharmony_ci * 3345a46c0ec8Sopenharmony_ci * @see libinput_tablet_pad_mode_group_get_mode 3346a46c0ec8Sopenharmony_ci * 3347a46c0ec8Sopenharmony_ci * @since 1.4 3348a46c0ec8Sopenharmony_ci */ 3349a46c0ec8Sopenharmony_ciunsigned int 3350a46c0ec8Sopenharmony_cilibinput_event_tablet_pad_get_mode(struct libinput_event_tablet_pad *event); 3351a46c0ec8Sopenharmony_ci 3352a46c0ec8Sopenharmony_ci/** 3353a46c0ec8Sopenharmony_ci * @ingroup event_tablet_pad 3354a46c0ec8Sopenharmony_ci * 3355a46c0ec8Sopenharmony_ci * Returns the mode group that the button, ring, or strip that triggered 3356a46c0ec8Sopenharmony_ci * this event is considered in. The mode is a virtual grouping of 3357a46c0ec8Sopenharmony_ci * functionality, usually based on some visual feedback like LEDs on the 3358a46c0ec8Sopenharmony_ci * pad. 3359a46c0ec8Sopenharmony_ci * 3360a46c0ec8Sopenharmony_ci * @note Pad keys are not part of a mode group. It is an application bug to 3361a46c0ec8Sopenharmony_ci * call this function for @ref LIBINPUT_EVENT_TABLET_PAD_KEY. 3362a46c0ec8Sopenharmony_ci * 3363a46c0ec8Sopenharmony_ci * The returned mode group is not refcounted and may become invalid after 3364a46c0ec8Sopenharmony_ci * the next call to libinput. Use libinput_tablet_pad_mode_group_ref() and 3365a46c0ec8Sopenharmony_ci * libinput_tablet_pad_mode_group_unref() to continue using the handle 3366a46c0ec8Sopenharmony_ci * outside of the immediate scope. 3367a46c0ec8Sopenharmony_ci * 3368a46c0ec8Sopenharmony_ci * @param event The libinput tablet pad event 3369a46c0ec8Sopenharmony_ci * @return the mode group of the button, ring or strip that caused this event 3370a46c0ec8Sopenharmony_ci * 3371a46c0ec8Sopenharmony_ci * @see libinput_device_tablet_pad_get_mode_group 3372a46c0ec8Sopenharmony_ci * 3373a46c0ec8Sopenharmony_ci * @since 1.4 3374a46c0ec8Sopenharmony_ci */ 3375a46c0ec8Sopenharmony_cistruct libinput_tablet_pad_mode_group * 3376a46c0ec8Sopenharmony_cilibinput_event_tablet_pad_get_mode_group(struct libinput_event_tablet_pad *event); 3377a46c0ec8Sopenharmony_ci 3378a46c0ec8Sopenharmony_ci/** 3379a46c0ec8Sopenharmony_ci * @ingroup event_tablet_pad 3380a46c0ec8Sopenharmony_ci * 3381a46c0ec8Sopenharmony_ci * @note Timestamps may not always increase. See the libinput documentation 3382a46c0ec8Sopenharmony_ci * for more details. 3383a46c0ec8Sopenharmony_ci * 3384a46c0ec8Sopenharmony_ci * @param event The libinput tablet pad event 3385a46c0ec8Sopenharmony_ci * @return The event time for this event 3386a46c0ec8Sopenharmony_ci * 3387a46c0ec8Sopenharmony_ci * @since 1.3 3388a46c0ec8Sopenharmony_ci */ 3389a46c0ec8Sopenharmony_ciuint32_t 3390a46c0ec8Sopenharmony_cilibinput_event_tablet_pad_get_time(struct libinput_event_tablet_pad *event); 3391a46c0ec8Sopenharmony_ci 3392a46c0ec8Sopenharmony_ci/** 3393a46c0ec8Sopenharmony_ci * @ingroup event_tablet_pad 3394a46c0ec8Sopenharmony_ci * 3395a46c0ec8Sopenharmony_ci * @note Timestamps may not always increase. See the libinput documentation 3396a46c0ec8Sopenharmony_ci * for more details. 3397a46c0ec8Sopenharmony_ci * 3398a46c0ec8Sopenharmony_ci * @param event The libinput tablet pad event 3399a46c0ec8Sopenharmony_ci * @return The event time for this event in microseconds 3400a46c0ec8Sopenharmony_ci * 3401a46c0ec8Sopenharmony_ci * @since 1.3 3402a46c0ec8Sopenharmony_ci */ 3403a46c0ec8Sopenharmony_ciuint64_t 3404a46c0ec8Sopenharmony_cilibinput_event_tablet_pad_get_time_usec(struct libinput_event_tablet_pad *event); 3405a46c0ec8Sopenharmony_ci 3406a46c0ec8Sopenharmony_ci/** 3407a46c0ec8Sopenharmony_ci * @defgroup event_switch Switch events 3408a46c0ec8Sopenharmony_ci * 3409a46c0ec8Sopenharmony_ci * Events that come from switch devices. 3410a46c0ec8Sopenharmony_ci */ 3411a46c0ec8Sopenharmony_ci 3412a46c0ec8Sopenharmony_ci/** 3413a46c0ec8Sopenharmony_ci * @ingroup event_switch 3414a46c0ec8Sopenharmony_ci * 3415a46c0ec8Sopenharmony_ci * Return the switch that triggered this event. 3416a46c0ec8Sopenharmony_ci * For pointer events that are not of type @ref 3417a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_SWITCH_TOGGLE, this function returns 0. 3418a46c0ec8Sopenharmony_ci * 3419a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other than 3420a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_SWITCH_TOGGLE. 3421a46c0ec8Sopenharmony_ci * 3422a46c0ec8Sopenharmony_ci * @param event The libinput switch event 3423a46c0ec8Sopenharmony_ci * @return The switch triggering this event 3424a46c0ec8Sopenharmony_ci * 3425a46c0ec8Sopenharmony_ci * @since 1.7 3426a46c0ec8Sopenharmony_ci */ 3427a46c0ec8Sopenharmony_cienum libinput_switch 3428a46c0ec8Sopenharmony_cilibinput_event_switch_get_switch(struct libinput_event_switch *event); 3429a46c0ec8Sopenharmony_ci 3430a46c0ec8Sopenharmony_ci/** 3431a46c0ec8Sopenharmony_ci * @ingroup event_switch 3432a46c0ec8Sopenharmony_ci * 3433a46c0ec8Sopenharmony_ci * Return the switch state that triggered this event. 3434a46c0ec8Sopenharmony_ci * For switch events that are not of type @ref 3435a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_SWITCH_TOGGLE, this function returns 0. 3436a46c0ec8Sopenharmony_ci * 3437a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for events other than 3438a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_SWITCH_TOGGLE. 3439a46c0ec8Sopenharmony_ci * 3440a46c0ec8Sopenharmony_ci * @param event The libinput switch event 3441a46c0ec8Sopenharmony_ci * @return The switch state triggering this event 3442a46c0ec8Sopenharmony_ci * 3443a46c0ec8Sopenharmony_ci * @since 1.7 3444a46c0ec8Sopenharmony_ci */ 3445a46c0ec8Sopenharmony_cienum libinput_switch_state 3446a46c0ec8Sopenharmony_cilibinput_event_switch_get_switch_state(struct libinput_event_switch *event); 3447a46c0ec8Sopenharmony_ci 3448a46c0ec8Sopenharmony_ci/** 3449a46c0ec8Sopenharmony_ci * @ingroup event_switch 3450a46c0ec8Sopenharmony_ci * 3451a46c0ec8Sopenharmony_ci * @return The generic libinput_event of this event 3452a46c0ec8Sopenharmony_ci * 3453a46c0ec8Sopenharmony_ci * @since 1.7 3454a46c0ec8Sopenharmony_ci */ 3455a46c0ec8Sopenharmony_cistruct libinput_event * 3456a46c0ec8Sopenharmony_cilibinput_event_switch_get_base_event(struct libinput_event_switch *event); 3457a46c0ec8Sopenharmony_ci 3458a46c0ec8Sopenharmony_ci/** 3459a46c0ec8Sopenharmony_ci * @ingroup event_switch 3460a46c0ec8Sopenharmony_ci * 3461a46c0ec8Sopenharmony_ci * @note Timestamps may not always increase. See the libinput documentation 3462a46c0ec8Sopenharmony_ci * for more details. 3463a46c0ec8Sopenharmony_ci * 3464a46c0ec8Sopenharmony_ci * @param event The libinput switch event 3465a46c0ec8Sopenharmony_ci * @return The event time for this event 3466a46c0ec8Sopenharmony_ci * 3467a46c0ec8Sopenharmony_ci * @since 1.7 3468a46c0ec8Sopenharmony_ci */ 3469a46c0ec8Sopenharmony_ciuint32_t 3470a46c0ec8Sopenharmony_cilibinput_event_switch_get_time(struct libinput_event_switch *event); 3471a46c0ec8Sopenharmony_ci 3472a46c0ec8Sopenharmony_ci/** 3473a46c0ec8Sopenharmony_ci * @ingroup event_switch 3474a46c0ec8Sopenharmony_ci * 3475a46c0ec8Sopenharmony_ci * @note Timestamps may not always increase. See the libinput documentation 3476a46c0ec8Sopenharmony_ci * for more details. 3477a46c0ec8Sopenharmony_ci * 3478a46c0ec8Sopenharmony_ci * @param event The libinput switch event 3479a46c0ec8Sopenharmony_ci * @return The event time for this event in microseconds 3480a46c0ec8Sopenharmony_ci * 3481a46c0ec8Sopenharmony_ci * @since 1.7 3482a46c0ec8Sopenharmony_ci */ 3483a46c0ec8Sopenharmony_ciuint64_t 3484a46c0ec8Sopenharmony_cilibinput_event_switch_get_time_usec(struct libinput_event_switch *event); 3485a46c0ec8Sopenharmony_ci 3486a46c0ec8Sopenharmony_ci/** 3487a46c0ec8Sopenharmony_ci * @defgroup base Initialization and manipulation of libinput contexts 3488a46c0ec8Sopenharmony_ci */ 3489a46c0ec8Sopenharmony_ci 3490a46c0ec8Sopenharmony_ci/** 3491a46c0ec8Sopenharmony_ci * @ingroup base 3492a46c0ec8Sopenharmony_ci * @struct libinput_interface 3493a46c0ec8Sopenharmony_ci * 3494a46c0ec8Sopenharmony_ci * libinput does not open file descriptors to devices directly, instead 3495a46c0ec8Sopenharmony_ci * open_restricted() and close_restricted() are called for each path that 3496a46c0ec8Sopenharmony_ci * must be opened. 3497a46c0ec8Sopenharmony_ci * 3498a46c0ec8Sopenharmony_ci * @see libinput_udev_create_context 3499a46c0ec8Sopenharmony_ci * @see libinput_path_create_context 3500a46c0ec8Sopenharmony_ci */ 3501a46c0ec8Sopenharmony_cistruct libinput_interface { 3502a46c0ec8Sopenharmony_ci /** 3503a46c0ec8Sopenharmony_ci * Open the device at the given path with the flags provided and 3504a46c0ec8Sopenharmony_ci * return the fd. 3505a46c0ec8Sopenharmony_ci * 3506a46c0ec8Sopenharmony_ci * @param path The device path to open 3507a46c0ec8Sopenharmony_ci * @param flags Flags as defined by open(2) 3508a46c0ec8Sopenharmony_ci * @param user_data The user_data provided in 3509a46c0ec8Sopenharmony_ci * libinput_udev_create_context() 3510a46c0ec8Sopenharmony_ci * 3511a46c0ec8Sopenharmony_ci * @return The file descriptor, or a negative errno on failure. 3512a46c0ec8Sopenharmony_ci */ 3513a46c0ec8Sopenharmony_ci int (*open_restricted)(const char *path, int flags, void *user_data); 3514a46c0ec8Sopenharmony_ci /** 3515a46c0ec8Sopenharmony_ci * Close the file descriptor. 3516a46c0ec8Sopenharmony_ci * 3517a46c0ec8Sopenharmony_ci * @param fd The file descriptor to close 3518a46c0ec8Sopenharmony_ci * @param user_data The user_data provided in 3519a46c0ec8Sopenharmony_ci * libinput_udev_create_context() 3520a46c0ec8Sopenharmony_ci */ 3521a46c0ec8Sopenharmony_ci void (*close_restricted)(int fd, void *user_data); 3522a46c0ec8Sopenharmony_ci}; 3523a46c0ec8Sopenharmony_ci 3524a46c0ec8Sopenharmony_ci/** 3525a46c0ec8Sopenharmony_ci * @ingroup base 3526a46c0ec8Sopenharmony_ci * 3527a46c0ec8Sopenharmony_ci * Create a new libinput context from udev. This context is inactive until 3528a46c0ec8Sopenharmony_ci * assigned a seat ID with libinput_udev_assign_seat(). 3529a46c0ec8Sopenharmony_ci * 3530a46c0ec8Sopenharmony_ci * @param interface The callback interface 3531a46c0ec8Sopenharmony_ci * @param user_data Caller-specific data passed to the various callback 3532a46c0ec8Sopenharmony_ci * interfaces. 3533a46c0ec8Sopenharmony_ci * @param udev An already initialized udev context 3534a46c0ec8Sopenharmony_ci * 3535a46c0ec8Sopenharmony_ci * @return An initialized, but inactive libinput context or NULL on error 3536a46c0ec8Sopenharmony_ci */ 3537a46c0ec8Sopenharmony_cistruct libinput * 3538a46c0ec8Sopenharmony_cilibinput_udev_create_context(const struct libinput_interface *interface, 3539a46c0ec8Sopenharmony_ci void *user_data, 3540a46c0ec8Sopenharmony_ci struct udev *udev); 3541a46c0ec8Sopenharmony_ci 3542a46c0ec8Sopenharmony_ci/** 3543a46c0ec8Sopenharmony_ci * @ingroup base 3544a46c0ec8Sopenharmony_ci * 3545a46c0ec8Sopenharmony_ci * Assign a seat to this libinput context. New devices or the removal of 3546a46c0ec8Sopenharmony_ci * existing devices will appear as events during libinput_dispatch(). 3547a46c0ec8Sopenharmony_ci * 3548a46c0ec8Sopenharmony_ci * libinput_udev_assign_seat() succeeds even if no input devices are currently 3549a46c0ec8Sopenharmony_ci * available on this seat, or if devices are available but fail to open in 3550a46c0ec8Sopenharmony_ci * @ref libinput_interface::open_restricted. Devices that do not have the 3551a46c0ec8Sopenharmony_ci * minimum capabilities to be recognized as pointer, keyboard or touch 3552a46c0ec8Sopenharmony_ci * device are ignored. Such devices and those that failed to open 3553a46c0ec8Sopenharmony_ci * ignored until the next call to libinput_resume(). 3554a46c0ec8Sopenharmony_ci * 3555a46c0ec8Sopenharmony_ci * This function may only be called once per context. 3556a46c0ec8Sopenharmony_ci * 3557a46c0ec8Sopenharmony_ci * @param libinput A libinput context initialized with 3558a46c0ec8Sopenharmony_ci * libinput_udev_create_context() 3559a46c0ec8Sopenharmony_ci * @param seat_id A seat identifier. This string must not be NULL. 3560a46c0ec8Sopenharmony_ci * 3561a46c0ec8Sopenharmony_ci * @return 0 on success or -1 on failure. 3562a46c0ec8Sopenharmony_ci */ 3563a46c0ec8Sopenharmony_ciint 3564a46c0ec8Sopenharmony_cilibinput_udev_assign_seat(struct libinput *libinput, 3565a46c0ec8Sopenharmony_ci const char *seat_id); 3566a46c0ec8Sopenharmony_ci 3567a46c0ec8Sopenharmony_ci/** 3568a46c0ec8Sopenharmony_ci * @ingroup base 3569a46c0ec8Sopenharmony_ci * 3570a46c0ec8Sopenharmony_ci * Create a new libinput context that requires the caller to manually add or 3571a46c0ec8Sopenharmony_ci * remove devices with libinput_path_add_device() and 3572a46c0ec8Sopenharmony_ci * libinput_path_remove_device(). 3573a46c0ec8Sopenharmony_ci * 3574a46c0ec8Sopenharmony_ci * The context is fully initialized but will not generate events until at 3575a46c0ec8Sopenharmony_ci * least one device has been added. 3576a46c0ec8Sopenharmony_ci * 3577a46c0ec8Sopenharmony_ci * The reference count of the context is initialized to 1. See @ref 3578a46c0ec8Sopenharmony_ci * libinput_unref. 3579a46c0ec8Sopenharmony_ci * 3580a46c0ec8Sopenharmony_ci * @param interface The callback interface 3581a46c0ec8Sopenharmony_ci * @param user_data Caller-specific data passed to the various callback 3582a46c0ec8Sopenharmony_ci * interfaces. 3583a46c0ec8Sopenharmony_ci * 3584a46c0ec8Sopenharmony_ci * @return An initialized, empty libinput context. 3585a46c0ec8Sopenharmony_ci */ 3586a46c0ec8Sopenharmony_cistruct libinput * 3587a46c0ec8Sopenharmony_cilibinput_path_create_context(const struct libinput_interface *interface, 3588a46c0ec8Sopenharmony_ci void *user_data); 3589a46c0ec8Sopenharmony_ci 3590a46c0ec8Sopenharmony_ci/** 3591a46c0ec8Sopenharmony_ci * @ingroup base 3592a46c0ec8Sopenharmony_ci * 3593a46c0ec8Sopenharmony_ci * Add a device to a libinput context initialized with 3594a46c0ec8Sopenharmony_ci * libinput_path_create_context(). If successful, the device will be 3595a46c0ec8Sopenharmony_ci * added to the internal list and re-opened on libinput_resume(). The device 3596a46c0ec8Sopenharmony_ci * can be removed with libinput_path_remove_device(). 3597a46c0ec8Sopenharmony_ci * 3598a46c0ec8Sopenharmony_ci * If the device was successfully initialized, it is returned in the device 3599a46c0ec8Sopenharmony_ci * argument. The lifetime of the returned device pointer is limited until 3600a46c0ec8Sopenharmony_ci * the next libinput_dispatch(), use libinput_device_ref() to keep a permanent 3601a46c0ec8Sopenharmony_ci * reference. 3602a46c0ec8Sopenharmony_ci * 3603a46c0ec8Sopenharmony_ci * @param libinput A previously initialized libinput context 3604a46c0ec8Sopenharmony_ci * @param path Path to an input device 3605a46c0ec8Sopenharmony_ci * @return The newly initiated device on success, or NULL on failure. 3606a46c0ec8Sopenharmony_ci * 3607a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function on a libinput 3608a46c0ec8Sopenharmony_ci * context initialized with libinput_udev_create_context(). 3609a46c0ec8Sopenharmony_ci */ 3610a46c0ec8Sopenharmony_cistruct libinput_device * 3611a46c0ec8Sopenharmony_cilibinput_path_add_device(struct libinput *libinput, 3612a46c0ec8Sopenharmony_ci const char *path); 3613a46c0ec8Sopenharmony_ci 3614a46c0ec8Sopenharmony_ci/** 3615a46c0ec8Sopenharmony_ci * @ingroup base 3616a46c0ec8Sopenharmony_ci * 3617a46c0ec8Sopenharmony_ci * Remove a device from a libinput context initialized with 3618a46c0ec8Sopenharmony_ci * libinput_path_create_context() or added to such a context with 3619a46c0ec8Sopenharmony_ci * libinput_path_add_device(). 3620a46c0ec8Sopenharmony_ci * 3621a46c0ec8Sopenharmony_ci * Events already processed from this input device are kept in the queue, 3622a46c0ec8Sopenharmony_ci * the @ref LIBINPUT_EVENT_DEVICE_REMOVED event marks the end of events for 3623a46c0ec8Sopenharmony_ci * this device. 3624a46c0ec8Sopenharmony_ci * 3625a46c0ec8Sopenharmony_ci * If no matching device exists, this function does nothing. 3626a46c0ec8Sopenharmony_ci * 3627a46c0ec8Sopenharmony_ci * @param device A libinput device 3628a46c0ec8Sopenharmony_ci * 3629a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function on a libinput 3630a46c0ec8Sopenharmony_ci * context initialized with libinput_udev_create_context(). 3631a46c0ec8Sopenharmony_ci */ 3632a46c0ec8Sopenharmony_civoid 3633a46c0ec8Sopenharmony_cilibinput_path_remove_device(struct libinput_device *device); 3634a46c0ec8Sopenharmony_ci 3635a46c0ec8Sopenharmony_ci/** 3636a46c0ec8Sopenharmony_ci * @ingroup base 3637a46c0ec8Sopenharmony_ci * 3638a46c0ec8Sopenharmony_ci * libinput keeps a single file descriptor for all events. Call into 3639a46c0ec8Sopenharmony_ci * libinput_dispatch() if any events become available on this fd. 3640a46c0ec8Sopenharmony_ci * 3641a46c0ec8Sopenharmony_ci * @return The file descriptor used to notify of pending events. 3642a46c0ec8Sopenharmony_ci */ 3643a46c0ec8Sopenharmony_ciint 3644a46c0ec8Sopenharmony_cilibinput_get_fd(struct libinput *libinput); 3645a46c0ec8Sopenharmony_ci 3646a46c0ec8Sopenharmony_ci/** 3647a46c0ec8Sopenharmony_ci * @ingroup base 3648a46c0ec8Sopenharmony_ci * 3649a46c0ec8Sopenharmony_ci * Main event dispatchment function. Reads events of the file descriptors 3650a46c0ec8Sopenharmony_ci * and processes them internally. Use libinput_get_event() to retrieve the 3651a46c0ec8Sopenharmony_ci * events. 3652a46c0ec8Sopenharmony_ci * 3653a46c0ec8Sopenharmony_ci * Dispatching does not necessarily queue libinput events. This function 3654a46c0ec8Sopenharmony_ci * should be called immediately once data is available on the file 3655a46c0ec8Sopenharmony_ci * descriptor returned by libinput_get_fd(). libinput has a number of 3656a46c0ec8Sopenharmony_ci * timing-sensitive features (e.g. tap-to-click), any delay in calling 3657a46c0ec8Sopenharmony_ci * libinput_dispatch() may prevent these features from working correctly. 3658a46c0ec8Sopenharmony_ci * 3659a46c0ec8Sopenharmony_ci * @param libinput A previously initialized libinput context 3660a46c0ec8Sopenharmony_ci * 3661a46c0ec8Sopenharmony_ci * @return 0 on success, or a negative errno on failure 3662a46c0ec8Sopenharmony_ci */ 3663a46c0ec8Sopenharmony_ciint 3664a46c0ec8Sopenharmony_cilibinput_dispatch(struct libinput *libinput); 3665a46c0ec8Sopenharmony_ci 3666a46c0ec8Sopenharmony_ci/** 3667a46c0ec8Sopenharmony_ci * @ingroup base 3668a46c0ec8Sopenharmony_ci * 3669a46c0ec8Sopenharmony_ci * Retrieve the next event from libinput's internal event queue. 3670a46c0ec8Sopenharmony_ci * 3671a46c0ec8Sopenharmony_ci * After handling the retrieved event, the caller must destroy it using 3672a46c0ec8Sopenharmony_ci * libinput_event_destroy(). 3673a46c0ec8Sopenharmony_ci * 3674a46c0ec8Sopenharmony_ci * @param libinput A previously initialized libinput context 3675a46c0ec8Sopenharmony_ci * @return The next available event, or NULL if no event is available. 3676a46c0ec8Sopenharmony_ci */ 3677a46c0ec8Sopenharmony_cistruct libinput_event * 3678a46c0ec8Sopenharmony_cilibinput_get_event(struct libinput *libinput); 3679a46c0ec8Sopenharmony_ci 3680a46c0ec8Sopenharmony_ci/** 3681a46c0ec8Sopenharmony_ci * @ingroup base 3682a46c0ec8Sopenharmony_ci * 3683a46c0ec8Sopenharmony_ci * Return the type of the next event in the internal queue. This function 3684a46c0ec8Sopenharmony_ci * does not pop the event off the queue and the next call to 3685a46c0ec8Sopenharmony_ci * libinput_get_event() returns that event. 3686a46c0ec8Sopenharmony_ci * 3687a46c0ec8Sopenharmony_ci * @param libinput A previously initialized libinput context 3688a46c0ec8Sopenharmony_ci * @return The event type of the next available event or @ref 3689a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_NONE if no event is available. 3690a46c0ec8Sopenharmony_ci */ 3691a46c0ec8Sopenharmony_cienum libinput_event_type 3692a46c0ec8Sopenharmony_cilibinput_next_event_type(struct libinput *libinput); 3693a46c0ec8Sopenharmony_ci 3694a46c0ec8Sopenharmony_ci/** 3695a46c0ec8Sopenharmony_ci * @ingroup base 3696a46c0ec8Sopenharmony_ci * 3697a46c0ec8Sopenharmony_ci * Set caller-specific data associated with this context. libinput does 3698a46c0ec8Sopenharmony_ci * not manage, look at, or modify this data. The caller must ensure the 3699a46c0ec8Sopenharmony_ci * data is valid. 3700a46c0ec8Sopenharmony_ci * 3701a46c0ec8Sopenharmony_ci * @param libinput A previously initialized libinput context 3702a46c0ec8Sopenharmony_ci * @param user_data Caller-specific data passed to the various callback 3703a46c0ec8Sopenharmony_ci * interfaces. 3704a46c0ec8Sopenharmony_ci */ 3705a46c0ec8Sopenharmony_civoid 3706a46c0ec8Sopenharmony_cilibinput_set_user_data(struct libinput *libinput, 3707a46c0ec8Sopenharmony_ci void *user_data); 3708a46c0ec8Sopenharmony_ci 3709a46c0ec8Sopenharmony_ci/** 3710a46c0ec8Sopenharmony_ci * @ingroup base 3711a46c0ec8Sopenharmony_ci * 3712a46c0ec8Sopenharmony_ci * Get the caller-specific data associated with this context, if any. 3713a46c0ec8Sopenharmony_ci * 3714a46c0ec8Sopenharmony_ci * @param libinput A previously initialized libinput context 3715a46c0ec8Sopenharmony_ci * @return The caller-specific data previously assigned in 3716a46c0ec8Sopenharmony_ci * libinput_set_user_data(), libinput_path_create_context() or 3717a46c0ec8Sopenharmony_ci * libinput_udev_create_context(). 3718a46c0ec8Sopenharmony_ci */ 3719a46c0ec8Sopenharmony_civoid * 3720a46c0ec8Sopenharmony_cilibinput_get_user_data(struct libinput *libinput); 3721a46c0ec8Sopenharmony_ci 3722a46c0ec8Sopenharmony_ci/** 3723a46c0ec8Sopenharmony_ci * @ingroup base 3724a46c0ec8Sopenharmony_ci * 3725a46c0ec8Sopenharmony_ci * Resume a suspended libinput context. This re-enables device 3726a46c0ec8Sopenharmony_ci * monitoring and adds existing devices. 3727a46c0ec8Sopenharmony_ci * 3728a46c0ec8Sopenharmony_ci * @param libinput A previously initialized libinput context 3729a46c0ec8Sopenharmony_ci * @see libinput_suspend 3730a46c0ec8Sopenharmony_ci * 3731a46c0ec8Sopenharmony_ci * @return 0 on success or -1 on failure 3732a46c0ec8Sopenharmony_ci */ 3733a46c0ec8Sopenharmony_ciint 3734a46c0ec8Sopenharmony_cilibinput_resume(struct libinput *libinput); 3735a46c0ec8Sopenharmony_ci 3736a46c0ec8Sopenharmony_ci/** 3737a46c0ec8Sopenharmony_ci * @ingroup base 3738a46c0ec8Sopenharmony_ci * 3739a46c0ec8Sopenharmony_ci * Suspend monitoring for new devices and close existing devices. 3740a46c0ec8Sopenharmony_ci * This all but terminates libinput but does keep the context 3741a46c0ec8Sopenharmony_ci * valid to be resumed with libinput_resume(). 3742a46c0ec8Sopenharmony_ci * 3743a46c0ec8Sopenharmony_ci * @param libinput A previously initialized libinput context 3744a46c0ec8Sopenharmony_ci */ 3745a46c0ec8Sopenharmony_civoid 3746a46c0ec8Sopenharmony_cilibinput_suspend(struct libinput *libinput); 3747a46c0ec8Sopenharmony_ci 3748a46c0ec8Sopenharmony_ci/** 3749a46c0ec8Sopenharmony_ci * @ingroup base 3750a46c0ec8Sopenharmony_ci * 3751a46c0ec8Sopenharmony_ci * Add a reference to the context. A context is destroyed whenever the 3752a46c0ec8Sopenharmony_ci * reference count reaches 0. See @ref libinput_unref. 3753a46c0ec8Sopenharmony_ci * 3754a46c0ec8Sopenharmony_ci * @param libinput A previously initialized valid libinput context 3755a46c0ec8Sopenharmony_ci * @return The passed libinput context 3756a46c0ec8Sopenharmony_ci */ 3757a46c0ec8Sopenharmony_cistruct libinput * 3758a46c0ec8Sopenharmony_cilibinput_ref(struct libinput *libinput); 3759a46c0ec8Sopenharmony_ci 3760a46c0ec8Sopenharmony_ci/** 3761a46c0ec8Sopenharmony_ci * @ingroup base 3762a46c0ec8Sopenharmony_ci * 3763a46c0ec8Sopenharmony_ci * Dereference the libinput context. After this, the context may have been 3764a46c0ec8Sopenharmony_ci * destroyed, if the last reference was dereferenced. If so, the context is 3765a46c0ec8Sopenharmony_ci * invalid and may not be interacted with. 3766a46c0ec8Sopenharmony_ci * 3767a46c0ec8Sopenharmony_ci * @bug When the refcount reaches zero, libinput_unref() releases resources 3768a46c0ec8Sopenharmony_ci * even if a caller still holds refcounted references to related resources 3769a46c0ec8Sopenharmony_ci * (e.g. a libinput_device). When libinput_unref() returns 3770a46c0ec8Sopenharmony_ci * NULL, the caller must consider any resources related to that context 3771a46c0ec8Sopenharmony_ci * invalid. See https://bugs.freedesktop.org/show_bug.cgi?id=91872. 3772a46c0ec8Sopenharmony_ci * 3773a46c0ec8Sopenharmony_ci * Example code: 3774a46c0ec8Sopenharmony_ci * @code 3775a46c0ec8Sopenharmony_ci * li = libinput_path_create_context(&interface, NULL); 3776a46c0ec8Sopenharmony_ci * device = libinput_path_add_device(li, "/dev/input/event0"); 3777a46c0ec8Sopenharmony_ci * // get extra reference to device 3778a46c0ec8Sopenharmony_ci * libinput_device_ref(device); 3779a46c0ec8Sopenharmony_ci * 3780a46c0ec8Sopenharmony_ci * // refcount reaches 0, so *all* resources are cleaned up, 3781a46c0ec8Sopenharmony_ci * // including device 3782a46c0ec8Sopenharmony_ci * libinput_unref(li); 3783a46c0ec8Sopenharmony_ci * 3784a46c0ec8Sopenharmony_ci * // INCORRECT: device has been cleaned up and must not be used 3785a46c0ec8Sopenharmony_ci * // li = libinput_device_get_context(device); 3786a46c0ec8Sopenharmony_ci * @endcode 3787a46c0ec8Sopenharmony_ci * 3788a46c0ec8Sopenharmony_ci * @param libinput A previously initialized libinput context 3789a46c0ec8Sopenharmony_ci * @return NULL if context was destroyed otherwise the passed context 3790a46c0ec8Sopenharmony_ci */ 3791a46c0ec8Sopenharmony_cistruct libinput * 3792a46c0ec8Sopenharmony_cilibinput_unref(struct libinput *libinput); 3793a46c0ec8Sopenharmony_ci 3794a46c0ec8Sopenharmony_ci/** 3795a46c0ec8Sopenharmony_ci * @ingroup base 3796a46c0ec8Sopenharmony_ci * 3797a46c0ec8Sopenharmony_ci * Set the log priority for the libinput context. Messages with priorities 3798a46c0ec8Sopenharmony_ci * equal to or higher than the argument will be printed to the context's 3799a46c0ec8Sopenharmony_ci * log handler. 3800a46c0ec8Sopenharmony_ci * 3801a46c0ec8Sopenharmony_ci * The default log priority is @ref LIBINPUT_LOG_PRIORITY_ERROR. 3802a46c0ec8Sopenharmony_ci * 3803a46c0ec8Sopenharmony_ci * @param libinput A previously initialized libinput context 3804a46c0ec8Sopenharmony_ci * @param priority The minimum priority of log messages to print. 3805a46c0ec8Sopenharmony_ci * 3806a46c0ec8Sopenharmony_ci * @see libinput_log_set_handler 3807a46c0ec8Sopenharmony_ci * @see libinput_log_get_priority 3808a46c0ec8Sopenharmony_ci */ 3809a46c0ec8Sopenharmony_civoid 3810a46c0ec8Sopenharmony_cilibinput_log_set_priority(struct libinput *libinput, 3811a46c0ec8Sopenharmony_ci enum libinput_log_priority priority); 3812a46c0ec8Sopenharmony_ci 3813a46c0ec8Sopenharmony_ci/** 3814a46c0ec8Sopenharmony_ci * @ingroup base 3815a46c0ec8Sopenharmony_ci * 3816a46c0ec8Sopenharmony_ci * Get the context's log priority. Messages with priorities equal to or 3817a46c0ec8Sopenharmony_ci * higher than the argument will be printed to the current log handler. 3818a46c0ec8Sopenharmony_ci * 3819a46c0ec8Sopenharmony_ci * The default log priority is @ref LIBINPUT_LOG_PRIORITY_ERROR. 3820a46c0ec8Sopenharmony_ci * 3821a46c0ec8Sopenharmony_ci * @param libinput A previously initialized libinput context 3822a46c0ec8Sopenharmony_ci * @return The minimum priority of log messages to print. 3823a46c0ec8Sopenharmony_ci * 3824a46c0ec8Sopenharmony_ci * @see libinput_log_set_handler 3825a46c0ec8Sopenharmony_ci * @see libinput_log_set_priority 3826a46c0ec8Sopenharmony_ci */ 3827a46c0ec8Sopenharmony_cienum libinput_log_priority 3828a46c0ec8Sopenharmony_cilibinput_log_get_priority(const struct libinput *libinput); 3829a46c0ec8Sopenharmony_ci 3830a46c0ec8Sopenharmony_ci/** 3831a46c0ec8Sopenharmony_ci * @ingroup base 3832a46c0ec8Sopenharmony_ci * 3833a46c0ec8Sopenharmony_ci * Log handler type for custom logging. 3834a46c0ec8Sopenharmony_ci * 3835a46c0ec8Sopenharmony_ci * @param libinput The libinput context 3836a46c0ec8Sopenharmony_ci * @param priority The priority of the current message 3837a46c0ec8Sopenharmony_ci * @param format Message format in printf-style 3838a46c0ec8Sopenharmony_ci * @param args Message arguments 3839a46c0ec8Sopenharmony_ci * 3840a46c0ec8Sopenharmony_ci * @see libinput_log_set_priority 3841a46c0ec8Sopenharmony_ci * @see libinput_log_get_priority 3842a46c0ec8Sopenharmony_ci * @see libinput_log_set_handler 3843a46c0ec8Sopenharmony_ci */ 3844a46c0ec8Sopenharmony_citypedef void (*libinput_log_handler)(struct libinput *libinput, 3845a46c0ec8Sopenharmony_ci enum libinput_log_priority priority, 3846a46c0ec8Sopenharmony_ci const char *format, va_list args) 3847a46c0ec8Sopenharmony_ci LIBINPUT_ATTRIBUTE_PRINTF(3, 0); 3848a46c0ec8Sopenharmony_ci 3849a46c0ec8Sopenharmony_ci/** 3850a46c0ec8Sopenharmony_ci * @ingroup base 3851a46c0ec8Sopenharmony_ci * 3852a46c0ec8Sopenharmony_ci * Set the context's log handler. Messages with priorities equal to or 3853a46c0ec8Sopenharmony_ci * higher than the context's log priority will be passed to the given 3854a46c0ec8Sopenharmony_ci * log handler. 3855a46c0ec8Sopenharmony_ci * 3856a46c0ec8Sopenharmony_ci * The default log handler prints to stderr. 3857a46c0ec8Sopenharmony_ci * 3858a46c0ec8Sopenharmony_ci * @param libinput A previously initialized libinput context 3859a46c0ec8Sopenharmony_ci * @param log_handler The log handler for library messages. 3860a46c0ec8Sopenharmony_ci * 3861a46c0ec8Sopenharmony_ci * @see libinput_log_set_priority 3862a46c0ec8Sopenharmony_ci * @see libinput_log_get_priority 3863a46c0ec8Sopenharmony_ci */ 3864a46c0ec8Sopenharmony_civoid 3865a46c0ec8Sopenharmony_cilibinput_log_set_handler(struct libinput *libinput, 3866a46c0ec8Sopenharmony_ci libinput_log_handler log_handler); 3867a46c0ec8Sopenharmony_ci 3868a46c0ec8Sopenharmony_ci/** 3869a46c0ec8Sopenharmony_ci * @defgroup seat Initialization and manipulation of seats 3870a46c0ec8Sopenharmony_ci * 3871a46c0ec8Sopenharmony_ci * A seat has two identifiers, the physical name and the logical name. A 3872a46c0ec8Sopenharmony_ci * device is always assigned to exactly one seat. It may change to a 3873a46c0ec8Sopenharmony_ci * different logical seat but it cannot change physical seats. 3874a46c0ec8Sopenharmony_ci * 3875a46c0ec8Sopenharmony_ci * See the libinput documentation for more information on seats. 3876a46c0ec8Sopenharmony_ci */ 3877a46c0ec8Sopenharmony_ci 3878a46c0ec8Sopenharmony_ci/** 3879a46c0ec8Sopenharmony_ci * @ingroup seat 3880a46c0ec8Sopenharmony_ci * 3881a46c0ec8Sopenharmony_ci * Increase the refcount of the seat. A seat will be freed whenever the 3882a46c0ec8Sopenharmony_ci * refcount reaches 0. This may happen during libinput_dispatch() if the 3883a46c0ec8Sopenharmony_ci * seat was removed from the system. A caller must ensure to reference 3884a46c0ec8Sopenharmony_ci * the seat correctly to avoid dangling pointers. 3885a46c0ec8Sopenharmony_ci * 3886a46c0ec8Sopenharmony_ci * @param seat A previously obtained seat 3887a46c0ec8Sopenharmony_ci * @return The passed seat 3888a46c0ec8Sopenharmony_ci */ 3889a46c0ec8Sopenharmony_cistruct libinput_seat * 3890a46c0ec8Sopenharmony_cilibinput_seat_ref(struct libinput_seat *seat); 3891a46c0ec8Sopenharmony_ci 3892a46c0ec8Sopenharmony_ci/** 3893a46c0ec8Sopenharmony_ci * @ingroup seat 3894a46c0ec8Sopenharmony_ci * 3895a46c0ec8Sopenharmony_ci * Decrease the refcount of the seat. A seat will be freed whenever the 3896a46c0ec8Sopenharmony_ci * refcount reaches 0. This may happen during libinput_dispatch() if the 3897a46c0ec8Sopenharmony_ci * seat was removed from the system. A caller must ensure to reference 3898a46c0ec8Sopenharmony_ci * the seat correctly to avoid dangling pointers. 3899a46c0ec8Sopenharmony_ci * 3900a46c0ec8Sopenharmony_ci * @param seat A previously obtained seat 3901a46c0ec8Sopenharmony_ci * @return NULL if seat was destroyed, otherwise the passed seat 3902a46c0ec8Sopenharmony_ci */ 3903a46c0ec8Sopenharmony_cistruct libinput_seat * 3904a46c0ec8Sopenharmony_cilibinput_seat_unref(struct libinput_seat *seat); 3905a46c0ec8Sopenharmony_ci 3906a46c0ec8Sopenharmony_ci/** 3907a46c0ec8Sopenharmony_ci * @ingroup seat 3908a46c0ec8Sopenharmony_ci * 3909a46c0ec8Sopenharmony_ci * Set caller-specific data associated with this seat. libinput does 3910a46c0ec8Sopenharmony_ci * not manage, look at, or modify this data. The caller must ensure the 3911a46c0ec8Sopenharmony_ci * data is valid. 3912a46c0ec8Sopenharmony_ci * 3913a46c0ec8Sopenharmony_ci * @param seat A previously obtained seat 3914a46c0ec8Sopenharmony_ci * @param user_data Caller-specific data pointer 3915a46c0ec8Sopenharmony_ci * @see libinput_seat_get_user_data 3916a46c0ec8Sopenharmony_ci */ 3917a46c0ec8Sopenharmony_civoid 3918a46c0ec8Sopenharmony_cilibinput_seat_set_user_data(struct libinput_seat *seat, void *user_data); 3919a46c0ec8Sopenharmony_ci 3920a46c0ec8Sopenharmony_ci/** 3921a46c0ec8Sopenharmony_ci * @ingroup seat 3922a46c0ec8Sopenharmony_ci * 3923a46c0ec8Sopenharmony_ci * Get the caller-specific data associated with this seat, if any. 3924a46c0ec8Sopenharmony_ci * 3925a46c0ec8Sopenharmony_ci * @param seat A previously obtained seat 3926a46c0ec8Sopenharmony_ci * @return Caller-specific data pointer or NULL if none was set 3927a46c0ec8Sopenharmony_ci * @see libinput_seat_set_user_data 3928a46c0ec8Sopenharmony_ci */ 3929a46c0ec8Sopenharmony_civoid * 3930a46c0ec8Sopenharmony_cilibinput_seat_get_user_data(struct libinput_seat *seat); 3931a46c0ec8Sopenharmony_ci 3932a46c0ec8Sopenharmony_ci/** 3933a46c0ec8Sopenharmony_ci * @ingroup seat 3934a46c0ec8Sopenharmony_ci * 3935a46c0ec8Sopenharmony_ci * Get the libinput context from the seat. 3936a46c0ec8Sopenharmony_ci * 3937a46c0ec8Sopenharmony_ci * @param seat A previously obtained seat 3938a46c0ec8Sopenharmony_ci * @return The libinput context for this seat. 3939a46c0ec8Sopenharmony_ci */ 3940a46c0ec8Sopenharmony_cistruct libinput * 3941a46c0ec8Sopenharmony_cilibinput_seat_get_context(struct libinput_seat *seat); 3942a46c0ec8Sopenharmony_ci 3943a46c0ec8Sopenharmony_ci/** 3944a46c0ec8Sopenharmony_ci * @ingroup seat 3945a46c0ec8Sopenharmony_ci * 3946a46c0ec8Sopenharmony_ci * Return the physical name of the seat. For libinput contexts created from 3947a46c0ec8Sopenharmony_ci * udev, this is always the same value as passed into 3948a46c0ec8Sopenharmony_ci * libinput_udev_assign_seat() and all seats from that context will have 3949a46c0ec8Sopenharmony_ci * the same physical name. 3950a46c0ec8Sopenharmony_ci * 3951a46c0ec8Sopenharmony_ci * The physical name of the seat is one that is usually set by the system or 3952a46c0ec8Sopenharmony_ci * lower levels of the stack. In most cases, this is the base filter for 3953a46c0ec8Sopenharmony_ci * devices - devices assigned to seats outside the current seat will not 3954a46c0ec8Sopenharmony_ci * be available to the caller. 3955a46c0ec8Sopenharmony_ci * 3956a46c0ec8Sopenharmony_ci * @param seat A previously obtained seat 3957a46c0ec8Sopenharmony_ci * @return The physical name of this seat 3958a46c0ec8Sopenharmony_ci */ 3959a46c0ec8Sopenharmony_ciconst char * 3960a46c0ec8Sopenharmony_cilibinput_seat_get_physical_name(struct libinput_seat *seat); 3961a46c0ec8Sopenharmony_ci 3962a46c0ec8Sopenharmony_ci/** 3963a46c0ec8Sopenharmony_ci * @ingroup seat 3964a46c0ec8Sopenharmony_ci * 3965a46c0ec8Sopenharmony_ci * Return the logical name of the seat. This is an identifier to group sets 3966a46c0ec8Sopenharmony_ci * of devices within the compositor. 3967a46c0ec8Sopenharmony_ci * 3968a46c0ec8Sopenharmony_ci * @param seat A previously obtained seat 3969a46c0ec8Sopenharmony_ci * @return The logical name of this seat 3970a46c0ec8Sopenharmony_ci */ 3971a46c0ec8Sopenharmony_ciconst char * 3972a46c0ec8Sopenharmony_cilibinput_seat_get_logical_name(struct libinput_seat *seat); 3973a46c0ec8Sopenharmony_ci 3974a46c0ec8Sopenharmony_ci/** 3975a46c0ec8Sopenharmony_ci * @defgroup device Initialization and manipulation of input devices 3976a46c0ec8Sopenharmony_ci */ 3977a46c0ec8Sopenharmony_ci 3978a46c0ec8Sopenharmony_ci/** 3979a46c0ec8Sopenharmony_ci * @ingroup device 3980a46c0ec8Sopenharmony_ci * 3981a46c0ec8Sopenharmony_ci * Increase the refcount of the input device. An input device will be freed 3982a46c0ec8Sopenharmony_ci * whenever the refcount reaches 0. This may happen during 3983a46c0ec8Sopenharmony_ci * libinput_dispatch() if the device was removed from the system. A caller 3984a46c0ec8Sopenharmony_ci * must ensure to reference the device correctly to avoid dangling pointers. 3985a46c0ec8Sopenharmony_ci * 3986a46c0ec8Sopenharmony_ci * @param device A previously obtained device 3987a46c0ec8Sopenharmony_ci * @return The passed device 3988a46c0ec8Sopenharmony_ci */ 3989a46c0ec8Sopenharmony_cistruct libinput_device * 3990a46c0ec8Sopenharmony_cilibinput_device_ref(struct libinput_device *device); 3991a46c0ec8Sopenharmony_ci 3992a46c0ec8Sopenharmony_ci/** 3993a46c0ec8Sopenharmony_ci * @ingroup device 3994a46c0ec8Sopenharmony_ci * 3995a46c0ec8Sopenharmony_ci * Decrease the refcount of the input device. An input device will be freed 3996a46c0ec8Sopenharmony_ci * whenever the refcount reaches 0. This may happen during libinput_dispatch 3997a46c0ec8Sopenharmony_ci * if the device was removed from the system. A caller must ensure to 3998a46c0ec8Sopenharmony_ci * reference the device correctly to avoid dangling pointers. 3999a46c0ec8Sopenharmony_ci * 4000a46c0ec8Sopenharmony_ci * @param device A previously obtained device 4001a46c0ec8Sopenharmony_ci * @return NULL if the device was destroyed, otherwise the passed device 4002a46c0ec8Sopenharmony_ci */ 4003a46c0ec8Sopenharmony_cistruct libinput_device * 4004a46c0ec8Sopenharmony_cilibinput_device_unref(struct libinput_device *device); 4005a46c0ec8Sopenharmony_ci 4006a46c0ec8Sopenharmony_ci/** 4007a46c0ec8Sopenharmony_ci * @ingroup device 4008a46c0ec8Sopenharmony_ci * 4009a46c0ec8Sopenharmony_ci * Set caller-specific data associated with this input device. libinput does 4010a46c0ec8Sopenharmony_ci * not manage, look at, or modify this data. The caller must ensure the 4011a46c0ec8Sopenharmony_ci * data is valid. 4012a46c0ec8Sopenharmony_ci * 4013a46c0ec8Sopenharmony_ci * @param device A previously obtained device 4014a46c0ec8Sopenharmony_ci * @param user_data Caller-specific data pointer 4015a46c0ec8Sopenharmony_ci * @see libinput_device_get_user_data 4016a46c0ec8Sopenharmony_ci */ 4017a46c0ec8Sopenharmony_civoid 4018a46c0ec8Sopenharmony_cilibinput_device_set_user_data(struct libinput_device *device, void *user_data); 4019a46c0ec8Sopenharmony_ci 4020a46c0ec8Sopenharmony_ci/** 4021a46c0ec8Sopenharmony_ci * @ingroup device 4022a46c0ec8Sopenharmony_ci * 4023a46c0ec8Sopenharmony_ci * Get the caller-specific data associated with this input device, if any. 4024a46c0ec8Sopenharmony_ci * 4025a46c0ec8Sopenharmony_ci * @param device A previously obtained device 4026a46c0ec8Sopenharmony_ci * @return Caller-specific data pointer or NULL if none was set 4027a46c0ec8Sopenharmony_ci * @see libinput_device_set_user_data 4028a46c0ec8Sopenharmony_ci */ 4029a46c0ec8Sopenharmony_civoid * 4030a46c0ec8Sopenharmony_cilibinput_device_get_user_data(struct libinput_device *device); 4031a46c0ec8Sopenharmony_ci 4032a46c0ec8Sopenharmony_ci/** 4033a46c0ec8Sopenharmony_ci * @ingroup device 4034a46c0ec8Sopenharmony_ci * 4035a46c0ec8Sopenharmony_ci * Get the libinput context from the device. 4036a46c0ec8Sopenharmony_ci * 4037a46c0ec8Sopenharmony_ci * @param device A previously obtained device 4038a46c0ec8Sopenharmony_ci * @return The libinput context for this device. 4039a46c0ec8Sopenharmony_ci */ 4040a46c0ec8Sopenharmony_cistruct libinput * 4041a46c0ec8Sopenharmony_cilibinput_device_get_context(struct libinput_device *device); 4042a46c0ec8Sopenharmony_ci 4043a46c0ec8Sopenharmony_ci/** 4044a46c0ec8Sopenharmony_ci * @ingroup device 4045a46c0ec8Sopenharmony_ci * 4046a46c0ec8Sopenharmony_ci * Get the device group this device is assigned to. Some physical 4047a46c0ec8Sopenharmony_ci * devices like graphics tablets are represented by multiple kernel 4048a46c0ec8Sopenharmony_ci * devices and thus by multiple struct @ref libinput_device. 4049a46c0ec8Sopenharmony_ci * 4050a46c0ec8Sopenharmony_ci * libinput assigns these devices to the same @ref libinput_device_group 4051a46c0ec8Sopenharmony_ci * allowing the caller to identify such devices and adjust configuration 4052a46c0ec8Sopenharmony_ci * settings accordingly. For example, setting a tablet to left-handed often 4053a46c0ec8Sopenharmony_ci * means turning it upside down. A touch device on the same tablet would 4054a46c0ec8Sopenharmony_ci * need to be turned upside down too to work correctly. 4055a46c0ec8Sopenharmony_ci * 4056a46c0ec8Sopenharmony_ci * All devices are part of a device group though for most devices the group 4057a46c0ec8Sopenharmony_ci * will be a singleton. A device is assigned to a device group on @ref 4058a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_DEVICE_ADDED and removed from that group on @ref 4059a46c0ec8Sopenharmony_ci * LIBINPUT_EVENT_DEVICE_REMOVED. It is up to the caller to track how many 4060a46c0ec8Sopenharmony_ci * devices are in each device group. 4061a46c0ec8Sopenharmony_ci * 4062a46c0ec8Sopenharmony_ci * @dot 4063a46c0ec8Sopenharmony_ci * digraph groups_libinput { 4064a46c0ec8Sopenharmony_ci * rankdir="TB"; 4065a46c0ec8Sopenharmony_ci * node [ 4066a46c0ec8Sopenharmony_ci * shape="box"; 4067a46c0ec8Sopenharmony_ci * ] 4068a46c0ec8Sopenharmony_ci * 4069a46c0ec8Sopenharmony_ci * mouse [ label="mouse"; URL="\ref libinput_device"]; 4070a46c0ec8Sopenharmony_ci * kbd [ label="keyboard"; URL="\ref libinput_device"]; 4071a46c0ec8Sopenharmony_ci * 4072a46c0ec8Sopenharmony_ci * pen [ label="tablet pen"; URL="\ref libinput_device"]; 4073a46c0ec8Sopenharmony_ci * touch [ label="tablet touch"; URL="\ref libinput_device"]; 4074a46c0ec8Sopenharmony_ci * pad [ label="tablet pad"; URL="\ref libinput_device"]; 4075a46c0ec8Sopenharmony_ci * 4076a46c0ec8Sopenharmony_ci * group1 [ label="group 1"; URL="\ref libinput_device_group"]; 4077a46c0ec8Sopenharmony_ci * group2 [ label="group 2"; URL="\ref libinput_device_group"]; 4078a46c0ec8Sopenharmony_ci * group3 [ label="group 3"; URL="\ref libinput_device_group"]; 4079a46c0ec8Sopenharmony_ci * 4080a46c0ec8Sopenharmony_ci * mouse -> group1 4081a46c0ec8Sopenharmony_ci * kbd -> group2 4082a46c0ec8Sopenharmony_ci * 4083a46c0ec8Sopenharmony_ci * pen -> group3; 4084a46c0ec8Sopenharmony_ci * touch -> group3; 4085a46c0ec8Sopenharmony_ci * pad -> group3; 4086a46c0ec8Sopenharmony_ci * } 4087a46c0ec8Sopenharmony_ci * @enddot 4088a46c0ec8Sopenharmony_ci * 4089a46c0ec8Sopenharmony_ci * Device groups do not get re-used once the last device in the group was 4090a46c0ec8Sopenharmony_ci * removed, i.e. unplugging and re-plugging a physical device with grouped 4091a46c0ec8Sopenharmony_ci * devices will return a different device group after every unplug. 4092a46c0ec8Sopenharmony_ci * 4093a46c0ec8Sopenharmony_ci * The returned device group is not refcounted and may become invalid after 4094a46c0ec8Sopenharmony_ci * the next call to libinput. Use libinput_device_group_ref() and 4095a46c0ec8Sopenharmony_ci * libinput_device_group_unref() to continue using the handle outside of the 4096a46c0ec8Sopenharmony_ci * immediate scope. 4097a46c0ec8Sopenharmony_ci * 4098a46c0ec8Sopenharmony_ci * Device groups are assigned based on the <b>LIBINPUT_DEVICE_GROUP</b> udev 4099a46c0ec8Sopenharmony_ci * property, see the libinput documentation for more details. 4100a46c0ec8Sopenharmony_ci * 4101a46c0ec8Sopenharmony_ci * @return The device group this device belongs to 4102a46c0ec8Sopenharmony_ci */ 4103a46c0ec8Sopenharmony_cistruct libinput_device_group * 4104a46c0ec8Sopenharmony_cilibinput_device_get_device_group(struct libinput_device *device); 4105a46c0ec8Sopenharmony_ci 4106a46c0ec8Sopenharmony_ci/** 4107a46c0ec8Sopenharmony_ci * @ingroup device 4108a46c0ec8Sopenharmony_ci * 4109a46c0ec8Sopenharmony_ci * Get the system name of the device. 4110a46c0ec8Sopenharmony_ci * 4111a46c0ec8Sopenharmony_ci * To get the descriptive device name, use libinput_device_get_name(). 4112a46c0ec8Sopenharmony_ci * 4113a46c0ec8Sopenharmony_ci * @param device A previously obtained device 4114a46c0ec8Sopenharmony_ci * @return System name of the device 4115a46c0ec8Sopenharmony_ci * 4116a46c0ec8Sopenharmony_ci */ 4117a46c0ec8Sopenharmony_ciconst char * 4118a46c0ec8Sopenharmony_cilibinput_device_get_sysname(struct libinput_device *device); 4119a46c0ec8Sopenharmony_ci 4120a46c0ec8Sopenharmony_ci/** 4121a46c0ec8Sopenharmony_ci * @ingroup device 4122a46c0ec8Sopenharmony_ci * 4123a46c0ec8Sopenharmony_ci * The descriptive device name as advertised by the kernel and/or the 4124a46c0ec8Sopenharmony_ci * hardware itself. To get the sysname for this device, use 4125a46c0ec8Sopenharmony_ci * libinput_device_get_sysname(). 4126a46c0ec8Sopenharmony_ci * 4127a46c0ec8Sopenharmony_ci * The lifetime of the returned string is tied to the struct 4128a46c0ec8Sopenharmony_ci * libinput_device. The string may be the empty string but is never NULL. 4129a46c0ec8Sopenharmony_ci * 4130a46c0ec8Sopenharmony_ci * @param device A previously obtained device 4131a46c0ec8Sopenharmony_ci * @return The device name 4132a46c0ec8Sopenharmony_ci */ 4133a46c0ec8Sopenharmony_ciconst char * 4134a46c0ec8Sopenharmony_cilibinput_device_get_name(struct libinput_device *device); 4135a46c0ec8Sopenharmony_ci 4136a46c0ec8Sopenharmony_ci/** 4137a46c0ec8Sopenharmony_ci * @ingroup device 4138a46c0ec8Sopenharmony_ci * 4139a46c0ec8Sopenharmony_ci * Get the product ID for this device. 4140a46c0ec8Sopenharmony_ci * 4141a46c0ec8Sopenharmony_ci * @param device A previously obtained device 4142a46c0ec8Sopenharmony_ci * @return The product ID of this device 4143a46c0ec8Sopenharmony_ci */ 4144a46c0ec8Sopenharmony_ciunsigned int 4145a46c0ec8Sopenharmony_cilibinput_device_get_id_product(struct libinput_device *device); 4146a46c0ec8Sopenharmony_ci 4147a46c0ec8Sopenharmony_ci/** 4148a46c0ec8Sopenharmony_ci * @ingroup device 4149a46c0ec8Sopenharmony_ci * 4150a46c0ec8Sopenharmony_ci * Get the vendor ID for this device. 4151a46c0ec8Sopenharmony_ci * 4152a46c0ec8Sopenharmony_ci * @param device A previously obtained device 4153a46c0ec8Sopenharmony_ci * @return The vendor ID of this device 4154a46c0ec8Sopenharmony_ci */ 4155a46c0ec8Sopenharmony_ciunsigned int 4156a46c0ec8Sopenharmony_cilibinput_device_get_id_vendor(struct libinput_device *device); 4157a46c0ec8Sopenharmony_ci 4158a46c0ec8Sopenharmony_ci/** 4159a46c0ec8Sopenharmony_ci * @ingroup device 4160a46c0ec8Sopenharmony_ci * 4161a46c0ec8Sopenharmony_ci * A device may be mapped to a single output, or all available outputs. If a 4162a46c0ec8Sopenharmony_ci * device is mapped to a single output only, a relative device may not move 4163a46c0ec8Sopenharmony_ci * beyond the boundaries of this output. An absolute device has its input 4164a46c0ec8Sopenharmony_ci * coordinates mapped to the extents of this output. 4165a46c0ec8Sopenharmony_ci * 4166a46c0ec8Sopenharmony_ci * @note <b>Use of this function is discouraged.</b> Its return value is not 4167a46c0ec8Sopenharmony_ci * precisely defined and may not be understood by the caller or may be 4168a46c0ec8Sopenharmony_ci * insufficient to map the device. Instead, the system configuration could 4169a46c0ec8Sopenharmony_ci * set a udev property the caller understands and interprets correctly. The 4170a46c0ec8Sopenharmony_ci * caller could then obtain device with libinput_device_get_udev_device() 4171a46c0ec8Sopenharmony_ci * and query it for this property. For more complex cases, the caller 4172a46c0ec8Sopenharmony_ci * must implement monitor-to-device association heuristics. 4173a46c0ec8Sopenharmony_ci * 4174a46c0ec8Sopenharmony_ci * @return The name of the output this device is mapped to, or NULL if no 4175a46c0ec8Sopenharmony_ci * output is set 4176a46c0ec8Sopenharmony_ci */ 4177a46c0ec8Sopenharmony_ciconst char * 4178a46c0ec8Sopenharmony_cilibinput_device_get_output_name(struct libinput_device *device); 4179a46c0ec8Sopenharmony_ci 4180a46c0ec8Sopenharmony_ci/** 4181a46c0ec8Sopenharmony_ci * @ingroup device 4182a46c0ec8Sopenharmony_ci * 4183a46c0ec8Sopenharmony_ci * Get the seat associated with this input device. 4184a46c0ec8Sopenharmony_ci * 4185a46c0ec8Sopenharmony_ci * A seat can be uniquely identified by the physical and logical seat name. 4186a46c0ec8Sopenharmony_ci * There will ever be only one seat instance with a given physical and logical 4187a46c0ec8Sopenharmony_ci * seat name pair at any given time, but if no external reference is kept, it 4188a46c0ec8Sopenharmony_ci * may be destroyed if no device belonging to it is left. 4189a46c0ec8Sopenharmony_ci * 4190a46c0ec8Sopenharmony_ci * The returned seat is not refcounted and may become invalid after 4191a46c0ec8Sopenharmony_ci * the next call to libinput. Use libinput_seat_ref() and 4192a46c0ec8Sopenharmony_ci * libinput_seat_unref() to continue using the handle outside of the 4193a46c0ec8Sopenharmony_ci * immediate scope. 4194a46c0ec8Sopenharmony_ci * 4195a46c0ec8Sopenharmony_ci * See the libinput documentation for more information on seats. 4196a46c0ec8Sopenharmony_ci * 4197a46c0ec8Sopenharmony_ci * @param device A previously obtained device 4198a46c0ec8Sopenharmony_ci * @return The seat this input device belongs to 4199a46c0ec8Sopenharmony_ci */ 4200a46c0ec8Sopenharmony_cistruct libinput_seat * 4201a46c0ec8Sopenharmony_cilibinput_device_get_seat(struct libinput_device *device); 4202a46c0ec8Sopenharmony_ci 4203a46c0ec8Sopenharmony_ci/** 4204a46c0ec8Sopenharmony_ci * @ingroup device 4205a46c0ec8Sopenharmony_ci * 4206a46c0ec8Sopenharmony_ci * Change the logical seat associated with this device by removing the 4207a46c0ec8Sopenharmony_ci * device and adding it to the new seat. 4208a46c0ec8Sopenharmony_ci * 4209a46c0ec8Sopenharmony_ci * This command is identical to physically unplugging the device, then 4210a46c0ec8Sopenharmony_ci * re-plugging it as a member of the new seat. libinput will generate a 4211a46c0ec8Sopenharmony_ci * @ref LIBINPUT_EVENT_DEVICE_REMOVED event and this @ref libinput_device is 4212a46c0ec8Sopenharmony_ci * considered removed from the context; it will not generate further events 4213a46c0ec8Sopenharmony_ci * and will be freed when the refcount reaches zero. 4214a46c0ec8Sopenharmony_ci * A @ref LIBINPUT_EVENT_DEVICE_ADDED event is generated with a new @ref 4215a46c0ec8Sopenharmony_ci * libinput_device handle. It is the caller's responsibility to update 4216a46c0ec8Sopenharmony_ci * references to the new device accordingly. 4217a46c0ec8Sopenharmony_ci * 4218a46c0ec8Sopenharmony_ci * If the logical seat name already exists in the device's physical seat, 4219a46c0ec8Sopenharmony_ci * the device is added to this seat. Otherwise, a new seat is created. 4220a46c0ec8Sopenharmony_ci * 4221a46c0ec8Sopenharmony_ci * @note This change applies to this device until removal or @ref 4222a46c0ec8Sopenharmony_ci * libinput_suspend(), whichever happens earlier. 4223a46c0ec8Sopenharmony_ci * 4224a46c0ec8Sopenharmony_ci * @param device A previously obtained device 4225a46c0ec8Sopenharmony_ci * @param name The new logical seat name 4226a46c0ec8Sopenharmony_ci * @return 0 on success, non-zero on error 4227a46c0ec8Sopenharmony_ci */ 4228a46c0ec8Sopenharmony_ciint 4229a46c0ec8Sopenharmony_cilibinput_device_set_seat_logical_name(struct libinput_device *device, 4230a46c0ec8Sopenharmony_ci const char *name); 4231a46c0ec8Sopenharmony_ci 4232a46c0ec8Sopenharmony_ci/** 4233a46c0ec8Sopenharmony_ci * @ingroup device 4234a46c0ec8Sopenharmony_ci * 4235a46c0ec8Sopenharmony_ci * Return a udev handle to the device that is this libinput device, if any. 4236a46c0ec8Sopenharmony_ci * The returned handle has a refcount of at least 1, the caller must call 4237a46c0ec8Sopenharmony_ci * <i>udev_device_unref()</i> once to release the associated resources. 4238a46c0ec8Sopenharmony_ci * See the [libudev documentation] 4239a46c0ec8Sopenharmony_ci * (http://www.freedesktop.org/software/systemd/libudev/) for details. 4240a46c0ec8Sopenharmony_ci * 4241a46c0ec8Sopenharmony_ci * Some devices may not have a udev device, or the udev device may be 4242a46c0ec8Sopenharmony_ci * unobtainable. This function returns NULL if no udev device was available. 4243a46c0ec8Sopenharmony_ci * 4244a46c0ec8Sopenharmony_ci * Calling this function multiple times for the same device may not 4245a46c0ec8Sopenharmony_ci * return the same udev handle each time. 4246a46c0ec8Sopenharmony_ci * 4247a46c0ec8Sopenharmony_ci * @param device A previously obtained device 4248a46c0ec8Sopenharmony_ci * @return A udev handle to the device with a refcount of >= 1 or NULL. 4249a46c0ec8Sopenharmony_ci * @retval NULL This device is not represented by a udev device 4250a46c0ec8Sopenharmony_ci */ 4251a46c0ec8Sopenharmony_cistruct udev_device * 4252a46c0ec8Sopenharmony_cilibinput_device_get_udev_device(struct libinput_device *device); 4253a46c0ec8Sopenharmony_ci 4254a46c0ec8Sopenharmony_ci/** 4255a46c0ec8Sopenharmony_ci * @ingroup device 4256a46c0ec8Sopenharmony_ci * 4257a46c0ec8Sopenharmony_ci * Update the LEDs on the device, if any. If the device does not have 4258a46c0ec8Sopenharmony_ci * LEDs, or does not have one or more of the LEDs given in the mask, this 4259a46c0ec8Sopenharmony_ci * function does nothing. 4260a46c0ec8Sopenharmony_ci * 4261a46c0ec8Sopenharmony_ci * @param device A previously obtained device 4262a46c0ec8Sopenharmony_ci * @param leds A mask of the LEDs to set, or unset. 4263a46c0ec8Sopenharmony_ci */ 4264a46c0ec8Sopenharmony_civoid 4265a46c0ec8Sopenharmony_cilibinput_device_led_update(struct libinput_device *device, 4266a46c0ec8Sopenharmony_ci enum libinput_led leds); 4267a46c0ec8Sopenharmony_ci 4268a46c0ec8Sopenharmony_ci/** 4269a46c0ec8Sopenharmony_ci * @ingroup device 4270a46c0ec8Sopenharmony_ci * 4271a46c0ec8Sopenharmony_ci * Check if the given device has the specified capability 4272a46c0ec8Sopenharmony_ci * 4273a46c0ec8Sopenharmony_ci * @return Non-zero if the given device has the capability or zero otherwise 4274a46c0ec8Sopenharmony_ci */ 4275a46c0ec8Sopenharmony_ciint 4276a46c0ec8Sopenharmony_cilibinput_device_has_capability(struct libinput_device *device, 4277a46c0ec8Sopenharmony_ci enum libinput_device_capability capability); 4278a46c0ec8Sopenharmony_ci 4279a46c0ec8Sopenharmony_ci/** 4280a46c0ec8Sopenharmony_ci * @ingroup device 4281a46c0ec8Sopenharmony_ci * 4282a46c0ec8Sopenharmony_ci * Get the physical size of a device in mm, where meaningful. This function 4283a46c0ec8Sopenharmony_ci * only succeeds on devices with the required data, i.e. tablets, touchpads 4284a46c0ec8Sopenharmony_ci * and touchscreens. 4285a46c0ec8Sopenharmony_ci * 4286a46c0ec8Sopenharmony_ci * If this function returns nonzero, width and height are unmodified. 4287a46c0ec8Sopenharmony_ci * 4288a46c0ec8Sopenharmony_ci * @param device The device 4289a46c0ec8Sopenharmony_ci * @param width Set to the width of the device 4290a46c0ec8Sopenharmony_ci * @param height Set to the height of the device 4291a46c0ec8Sopenharmony_ci * @return 0 on success, or nonzero otherwise 4292a46c0ec8Sopenharmony_ci */ 4293a46c0ec8Sopenharmony_ciint 4294a46c0ec8Sopenharmony_cilibinput_device_get_size(struct libinput_device *device, 4295a46c0ec8Sopenharmony_ci double *width, 4296a46c0ec8Sopenharmony_ci double *height); 4297a46c0ec8Sopenharmony_ci 4298a46c0ec8Sopenharmony_ci/** 4299a46c0ec8Sopenharmony_ci * @ingroup device 4300a46c0ec8Sopenharmony_ci * 4301a46c0ec8Sopenharmony_ci * Check if a @ref LIBINPUT_DEVICE_CAP_POINTER device has a button with the 4302a46c0ec8Sopenharmony_ci * given code (see linux/input-event-codes.h). 4303a46c0ec8Sopenharmony_ci * 4304a46c0ec8Sopenharmony_ci * @param device A current input device 4305a46c0ec8Sopenharmony_ci * @param code Button code to check for, e.g. <i>BTN_LEFT</i> 4306a46c0ec8Sopenharmony_ci * 4307a46c0ec8Sopenharmony_ci * @return 1 if the device supports this button code, 0 if it does not, -1 4308a46c0ec8Sopenharmony_ci * on error. 4309a46c0ec8Sopenharmony_ci */ 4310a46c0ec8Sopenharmony_ciint 4311a46c0ec8Sopenharmony_cilibinput_device_pointer_has_button(struct libinput_device *device, uint32_t code); 4312a46c0ec8Sopenharmony_ci 4313a46c0ec8Sopenharmony_ci/** 4314a46c0ec8Sopenharmony_ci * @ingroup device 4315a46c0ec8Sopenharmony_ci * 4316a46c0ec8Sopenharmony_ci * Check if a @ref LIBINPUT_DEVICE_CAP_KEYBOARD device has a key with the 4317a46c0ec8Sopenharmony_ci * given code (see linux/input-event-codes.h). 4318a46c0ec8Sopenharmony_ci * 4319a46c0ec8Sopenharmony_ci * @param device A current input device 4320a46c0ec8Sopenharmony_ci * @param code Key code to check for, e.g. <i>KEY_ESC</i> 4321a46c0ec8Sopenharmony_ci * 4322a46c0ec8Sopenharmony_ci * @return 1 if the device supports this key code, 0 if it does not, -1 4323a46c0ec8Sopenharmony_ci * on error. 4324a46c0ec8Sopenharmony_ci */ 4325a46c0ec8Sopenharmony_ciint 4326a46c0ec8Sopenharmony_cilibinput_device_keyboard_has_key(struct libinput_device *device, 4327a46c0ec8Sopenharmony_ci uint32_t code); 4328a46c0ec8Sopenharmony_ci 4329a46c0ec8Sopenharmony_ci/** 4330a46c0ec8Sopenharmony_ci * @ingroup device 4331a46c0ec8Sopenharmony_ci * 4332a46c0ec8Sopenharmony_ci * Check how many touches a @ref LIBINPUT_DEVICE_CAP_TOUCH device supports 4333a46c0ec8Sopenharmony_ci * simultaneously. 4334a46c0ec8Sopenharmony_ci * 4335a46c0ec8Sopenharmony_ci * @param device A current input device 4336a46c0ec8Sopenharmony_ci * 4337a46c0ec8Sopenharmony_ci * @return The number of simultaneous touches or 0 if unknown, -1 4338a46c0ec8Sopenharmony_ci * on error. 4339a46c0ec8Sopenharmony_ci * 4340a46c0ec8Sopenharmony_ci * @since 1.11 4341a46c0ec8Sopenharmony_ci */ 4342a46c0ec8Sopenharmony_ciint 4343a46c0ec8Sopenharmony_cilibinput_device_touch_get_touch_count(struct libinput_device *device); 4344a46c0ec8Sopenharmony_ci 4345a46c0ec8Sopenharmony_ci/** 4346a46c0ec8Sopenharmony_ci * @ingroup device 4347a46c0ec8Sopenharmony_ci * 4348a46c0ec8Sopenharmony_ci * Check if a @ref LIBINPUT_DEVICE_CAP_SWITCH device has a switch of the 4349a46c0ec8Sopenharmony_ci * given type. 4350a46c0ec8Sopenharmony_ci * 4351a46c0ec8Sopenharmony_ci * @param device A current input device 4352a46c0ec8Sopenharmony_ci * @param sw Switch to check for 4353a46c0ec8Sopenharmony_ci * 4354a46c0ec8Sopenharmony_ci * @return 1 if the device supports this switch, 0 if it does not, -1 4355a46c0ec8Sopenharmony_ci * on error. 4356a46c0ec8Sopenharmony_ci * 4357a46c0ec8Sopenharmony_ci * @since 1.9 4358a46c0ec8Sopenharmony_ci */ 4359a46c0ec8Sopenharmony_ciint 4360a46c0ec8Sopenharmony_cilibinput_device_switch_has_switch(struct libinput_device *device, 4361a46c0ec8Sopenharmony_ci enum libinput_switch sw); 4362a46c0ec8Sopenharmony_ci 4363a46c0ec8Sopenharmony_ci/** 4364a46c0ec8Sopenharmony_ci * @ingroup device 4365a46c0ec8Sopenharmony_ci * 4366a46c0ec8Sopenharmony_ci * Return the number of buttons on a device with the 4367a46c0ec8Sopenharmony_ci * @ref LIBINPUT_DEVICE_CAP_TABLET_PAD capability. 4368a46c0ec8Sopenharmony_ci * Buttons on a pad device are numbered sequentially, see the 4369a46c0ec8Sopenharmony_ci * libinput documentation for details. 4370a46c0ec8Sopenharmony_ci * 4371a46c0ec8Sopenharmony_ci * @param device A current input device 4372a46c0ec8Sopenharmony_ci * 4373a46c0ec8Sopenharmony_ci * @return The number of buttons supported by the device. -1 on error. 4374a46c0ec8Sopenharmony_ci * 4375a46c0ec8Sopenharmony_ci * @since 1.3 4376a46c0ec8Sopenharmony_ci */ 4377a46c0ec8Sopenharmony_ciint 4378a46c0ec8Sopenharmony_cilibinput_device_tablet_pad_get_num_buttons(struct libinput_device *device); 4379a46c0ec8Sopenharmony_ci 4380a46c0ec8Sopenharmony_ci/** 4381a46c0ec8Sopenharmony_ci * @ingroup device 4382a46c0ec8Sopenharmony_ci * 4383a46c0ec8Sopenharmony_ci * Return the number of rings a device with the @ref 4384a46c0ec8Sopenharmony_ci * LIBINPUT_DEVICE_CAP_TABLET_PAD capability provides. 4385a46c0ec8Sopenharmony_ci * 4386a46c0ec8Sopenharmony_ci * @param device A current input device 4387a46c0ec8Sopenharmony_ci * 4388a46c0ec8Sopenharmony_ci * @return The number of rings or 0 if the device has no rings. -1 on error. 4389a46c0ec8Sopenharmony_ci * 4390a46c0ec8Sopenharmony_ci * @see libinput_event_tablet_pad_get_ring_number 4391a46c0ec8Sopenharmony_ci * 4392a46c0ec8Sopenharmony_ci * @since 1.3 4393a46c0ec8Sopenharmony_ci */ 4394a46c0ec8Sopenharmony_ciint 4395a46c0ec8Sopenharmony_cilibinput_device_tablet_pad_get_num_rings(struct libinput_device *device); 4396a46c0ec8Sopenharmony_ci 4397a46c0ec8Sopenharmony_ci/** 4398a46c0ec8Sopenharmony_ci * @ingroup device 4399a46c0ec8Sopenharmony_ci * 4400a46c0ec8Sopenharmony_ci * Return the number of strips a device with the @ref 4401a46c0ec8Sopenharmony_ci * LIBINPUT_DEVICE_CAP_TABLET_PAD capability provides. 4402a46c0ec8Sopenharmony_ci * 4403a46c0ec8Sopenharmony_ci * @param device A current input device 4404a46c0ec8Sopenharmony_ci * 4405a46c0ec8Sopenharmony_ci * @return The number of strips or 0 if the device has no strips. -1 on error. 4406a46c0ec8Sopenharmony_ci * 4407a46c0ec8Sopenharmony_ci * @see libinput_event_tablet_pad_get_strip_number 4408a46c0ec8Sopenharmony_ci * 4409a46c0ec8Sopenharmony_ci * @since 1.3 4410a46c0ec8Sopenharmony_ci */ 4411a46c0ec8Sopenharmony_ciint 4412a46c0ec8Sopenharmony_cilibinput_device_tablet_pad_get_num_strips(struct libinput_device *device); 4413a46c0ec8Sopenharmony_ci 4414a46c0ec8Sopenharmony_ci/** 4415a46c0ec8Sopenharmony_ci * @ingroup device 4416a46c0ec8Sopenharmony_ci * 4417a46c0ec8Sopenharmony_ci * Check if a @ref LIBINPUT_DEVICE_CAP_TABLET_PAD device has a key with the 4418a46c0ec8Sopenharmony_ci * given code (see linux/input-event-codes.h). 4419a46c0ec8Sopenharmony_ci * 4420a46c0ec8Sopenharmony_ci * @param device A current input device 4421a46c0ec8Sopenharmony_ci * @param code Key code to check for, e.g. <i>KEY_ESC</i> 4422a46c0ec8Sopenharmony_ci * 4423a46c0ec8Sopenharmony_ci * @return 1 if the device supports this key code, 0 if it does not, -1 4424a46c0ec8Sopenharmony_ci * on error. 4425a46c0ec8Sopenharmony_ci * 4426a46c0ec8Sopenharmony_ci * @since 1.15 4427a46c0ec8Sopenharmony_ci */ 4428a46c0ec8Sopenharmony_ciint 4429a46c0ec8Sopenharmony_cilibinput_device_tablet_pad_has_key(struct libinput_device *device, 4430a46c0ec8Sopenharmony_ci uint32_t code); 4431a46c0ec8Sopenharmony_ci 4432a46c0ec8Sopenharmony_ci/** 4433a46c0ec8Sopenharmony_ci * @ingroup device 4434a46c0ec8Sopenharmony_ci * 4435a46c0ec8Sopenharmony_ci * Increase the refcount of the device group. A device group will be freed 4436a46c0ec8Sopenharmony_ci * whenever the refcount reaches 0. This may happen during 4437a46c0ec8Sopenharmony_ci * libinput_dispatch() if all devices of this group were removed from the 4438a46c0ec8Sopenharmony_ci * system. A caller must ensure to reference the device group correctly to 4439a46c0ec8Sopenharmony_ci * avoid dangling pointers. 4440a46c0ec8Sopenharmony_ci * 4441a46c0ec8Sopenharmony_ci * @param group A previously obtained device group 4442a46c0ec8Sopenharmony_ci * @return The passed device group 4443a46c0ec8Sopenharmony_ci */ 4444a46c0ec8Sopenharmony_cistruct libinput_device_group * 4445a46c0ec8Sopenharmony_cilibinput_device_group_ref(struct libinput_device_group *group); 4446a46c0ec8Sopenharmony_ci 4447a46c0ec8Sopenharmony_ci/** 4448a46c0ec8Sopenharmony_ci * @ingroup device 4449a46c0ec8Sopenharmony_ci * 4450a46c0ec8Sopenharmony_ci * Decrease the refcount of the device group. A device group will be freed 4451a46c0ec8Sopenharmony_ci * whenever the refcount reaches 0. This may happen during 4452a46c0ec8Sopenharmony_ci * libinput_dispatch() if all devices of this group were removed from the 4453a46c0ec8Sopenharmony_ci * system. A caller must ensure to reference the device group correctly to 4454a46c0ec8Sopenharmony_ci * avoid dangling pointers. 4455a46c0ec8Sopenharmony_ci * 4456a46c0ec8Sopenharmony_ci * @param group A previously obtained device group 4457a46c0ec8Sopenharmony_ci * @return NULL if the device group was destroyed, otherwise the passed 4458a46c0ec8Sopenharmony_ci * device group 4459a46c0ec8Sopenharmony_ci */ 4460a46c0ec8Sopenharmony_cistruct libinput_device_group * 4461a46c0ec8Sopenharmony_cilibinput_device_group_unref(struct libinput_device_group *group); 4462a46c0ec8Sopenharmony_ci 4463a46c0ec8Sopenharmony_ci/** 4464a46c0ec8Sopenharmony_ci * @ingroup device 4465a46c0ec8Sopenharmony_ci * 4466a46c0ec8Sopenharmony_ci * Set caller-specific data associated with this device group. libinput does 4467a46c0ec8Sopenharmony_ci * not manage, look at, or modify this data. The caller must ensure the 4468a46c0ec8Sopenharmony_ci * data is valid. 4469a46c0ec8Sopenharmony_ci * 4470a46c0ec8Sopenharmony_ci * @param group A previously obtained device group 4471a46c0ec8Sopenharmony_ci * @param user_data Caller-specific data pointer 4472a46c0ec8Sopenharmony_ci * @see libinput_device_group_get_user_data 4473a46c0ec8Sopenharmony_ci */ 4474a46c0ec8Sopenharmony_civoid 4475a46c0ec8Sopenharmony_cilibinput_device_group_set_user_data(struct libinput_device_group *group, 4476a46c0ec8Sopenharmony_ci void *user_data); 4477a46c0ec8Sopenharmony_ci 4478a46c0ec8Sopenharmony_ci/** 4479a46c0ec8Sopenharmony_ci * @ingroup device 4480a46c0ec8Sopenharmony_ci * 4481a46c0ec8Sopenharmony_ci * Get the caller-specific data associated with this input device group, if 4482a46c0ec8Sopenharmony_ci * any. 4483a46c0ec8Sopenharmony_ci * 4484a46c0ec8Sopenharmony_ci * @param group A previously obtained group 4485a46c0ec8Sopenharmony_ci * @return Caller-specific data pointer or NULL if none was set 4486a46c0ec8Sopenharmony_ci * @see libinput_device_group_set_user_data 4487a46c0ec8Sopenharmony_ci */ 4488a46c0ec8Sopenharmony_civoid * 4489a46c0ec8Sopenharmony_cilibinput_device_group_get_user_data(struct libinput_device_group *group); 4490a46c0ec8Sopenharmony_ci 4491a46c0ec8Sopenharmony_ci/** 4492a46c0ec8Sopenharmony_ci * @defgroup config Device configuration 4493a46c0ec8Sopenharmony_ci * 4494a46c0ec8Sopenharmony_ci * Enable, disable, change and/or check for device-specific features. For 4495a46c0ec8Sopenharmony_ci * all features, libinput assigns a default based on the hardware 4496a46c0ec8Sopenharmony_ci * configuration. This default can be obtained with the respective 4497a46c0ec8Sopenharmony_ci * get_default call. 4498a46c0ec8Sopenharmony_ci * 4499a46c0ec8Sopenharmony_ci * Configuration options are device dependent and not all options are 4500a46c0ec8Sopenharmony_ci * supported on all devices. For all configuration options, libinput 4501a46c0ec8Sopenharmony_ci * provides a call to check if a configuration option is available on a 4502a46c0ec8Sopenharmony_ci * device (e.g. libinput_device_config_calibration_has_matrix()) 4503a46c0ec8Sopenharmony_ci * 4504a46c0ec8Sopenharmony_ci * Some configuration option may be dependent on or mutually exclusive with 4505a46c0ec8Sopenharmony_ci * with other options. The behavior in those cases is 4506a46c0ec8Sopenharmony_ci * implementation-dependent, the caller must ensure that the options are set 4507a46c0ec8Sopenharmony_ci * in the right order. 4508a46c0ec8Sopenharmony_ci * 4509a46c0ec8Sopenharmony_ci * Below is a general grouping of configuration options according to device 4510a46c0ec8Sopenharmony_ci * type. Note that this is a guide only and not indicative of any specific 4511a46c0ec8Sopenharmony_ci * device. 4512a46c0ec8Sopenharmony_ci * - Touchpad: 4513a46c0ec8Sopenharmony_ci * - libinput_device_config_tap_set_enabled() 4514a46c0ec8Sopenharmony_ci * - libinput_device_config_tap_set_drag_enabled() 4515a46c0ec8Sopenharmony_ci * - libinput_device_config_tap_set_drag_lock_enabled() 4516a46c0ec8Sopenharmony_ci * - libinput_device_config_click_set_method() 4517a46c0ec8Sopenharmony_ci * - libinput_device_config_scroll_set_method() 4518a46c0ec8Sopenharmony_ci * - libinput_device_config_dwt_set_enabled() 4519a46c0ec8Sopenharmony_ci * - Touchscreens: 4520a46c0ec8Sopenharmony_ci * - libinput_device_config_calibration_set_matrix() 4521a46c0ec8Sopenharmony_ci * - Pointer devices (mice, trackballs, touchpads): 4522a46c0ec8Sopenharmony_ci * - libinput_device_config_accel_set_speed() 4523a46c0ec8Sopenharmony_ci * - libinput_device_config_accel_set_profile() 4524a46c0ec8Sopenharmony_ci * - libinput_device_config_scroll_set_natural_scroll_enabled() 4525a46c0ec8Sopenharmony_ci * - libinput_device_config_left_handed_set() 4526a46c0ec8Sopenharmony_ci * - libinput_device_config_middle_emulation_set_enabled() 4527a46c0ec8Sopenharmony_ci * - libinput_device_config_rotation_set_angle() 4528a46c0ec8Sopenharmony_ci * - All devices: 4529a46c0ec8Sopenharmony_ci * - libinput_device_config_send_events_set_mode() 4530a46c0ec8Sopenharmony_ci */ 4531a46c0ec8Sopenharmony_ci 4532a46c0ec8Sopenharmony_ci/** 4533a46c0ec8Sopenharmony_ci * @ingroup config 4534a46c0ec8Sopenharmony_ci * 4535a46c0ec8Sopenharmony_ci * Status codes returned when applying configuration settings. 4536a46c0ec8Sopenharmony_ci */ 4537a46c0ec8Sopenharmony_cienum libinput_config_status { 4538a46c0ec8Sopenharmony_ci LIBINPUT_CONFIG_STATUS_SUCCESS = 0, /**< Config applied successfully */ 4539a46c0ec8Sopenharmony_ci LIBINPUT_CONFIG_STATUS_UNSUPPORTED, /**< Configuration not available on 4540a46c0ec8Sopenharmony_ci this device */ 4541a46c0ec8Sopenharmony_ci LIBINPUT_CONFIG_STATUS_INVALID, /**< Invalid parameter range */ 4542a46c0ec8Sopenharmony_ci}; 4543a46c0ec8Sopenharmony_ci 4544a46c0ec8Sopenharmony_ci/** 4545a46c0ec8Sopenharmony_ci * @ingroup config 4546a46c0ec8Sopenharmony_ci * 4547a46c0ec8Sopenharmony_ci * Return a string describing the error. 4548a46c0ec8Sopenharmony_ci * 4549a46c0ec8Sopenharmony_ci * @param status The status to translate to a string 4550a46c0ec8Sopenharmony_ci * @return A human-readable string representing the error or NULL for an 4551a46c0ec8Sopenharmony_ci * invalid status. 4552a46c0ec8Sopenharmony_ci */ 4553a46c0ec8Sopenharmony_ciconst char * 4554a46c0ec8Sopenharmony_cilibinput_config_status_to_str(enum libinput_config_status status); 4555a46c0ec8Sopenharmony_ci 4556a46c0ec8Sopenharmony_ci/** 4557a46c0ec8Sopenharmony_ci * @ingroup config 4558a46c0ec8Sopenharmony_ci */ 4559a46c0ec8Sopenharmony_cienum libinput_config_tap_state { 4560a46c0ec8Sopenharmony_ci LIBINPUT_CONFIG_TAP_DISABLED, /**< Tapping is to be disabled, or is 4561a46c0ec8Sopenharmony_ci currently disabled */ 4562a46c0ec8Sopenharmony_ci LIBINPUT_CONFIG_TAP_ENABLED, /**< Tapping is to be enabled, or is 4563a46c0ec8Sopenharmony_ci currently enabled */ 4564a46c0ec8Sopenharmony_ci}; 4565a46c0ec8Sopenharmony_ci 4566a46c0ec8Sopenharmony_ci/** 4567a46c0ec8Sopenharmony_ci * @ingroup config 4568a46c0ec8Sopenharmony_ci * 4569a46c0ec8Sopenharmony_ci * Check if the device supports tap-to-click and how many fingers can be 4570a46c0ec8Sopenharmony_ci * used for tapping. See 4571a46c0ec8Sopenharmony_ci * libinput_device_config_tap_set_enabled() for more information. 4572a46c0ec8Sopenharmony_ci * 4573a46c0ec8Sopenharmony_ci * @param device The device to configure 4574a46c0ec8Sopenharmony_ci * @return The number of fingers that can generate a tap event, or 0 if the 4575a46c0ec8Sopenharmony_ci * device does not support tapping. 4576a46c0ec8Sopenharmony_ci * 4577a46c0ec8Sopenharmony_ci * @see libinput_device_config_tap_set_enabled 4578a46c0ec8Sopenharmony_ci * @see libinput_device_config_tap_get_enabled 4579a46c0ec8Sopenharmony_ci * @see libinput_device_config_tap_get_default_enabled 4580a46c0ec8Sopenharmony_ci */ 4581a46c0ec8Sopenharmony_ciint 4582a46c0ec8Sopenharmony_cilibinput_device_config_tap_get_finger_count(struct libinput_device *device); 4583a46c0ec8Sopenharmony_ci 4584a46c0ec8Sopenharmony_ci/** 4585a46c0ec8Sopenharmony_ci * @ingroup config 4586a46c0ec8Sopenharmony_ci * 4587a46c0ec8Sopenharmony_ci * Enable or disable tap-to-click on this device, with a default mapping of 4588a46c0ec8Sopenharmony_ci * 1, 2, 3 finger tap mapping to left, right, middle click, respectively. 4589a46c0ec8Sopenharmony_ci * Tapping is limited by the number of simultaneous touches 4590a46c0ec8Sopenharmony_ci * supported by the device, see 4591a46c0ec8Sopenharmony_ci * libinput_device_config_tap_get_finger_count(). 4592a46c0ec8Sopenharmony_ci * 4593a46c0ec8Sopenharmony_ci * @param device The device to configure 4594a46c0ec8Sopenharmony_ci * @param enable @ref LIBINPUT_CONFIG_TAP_ENABLED to enable tapping or @ref 4595a46c0ec8Sopenharmony_ci * LIBINPUT_CONFIG_TAP_DISABLED to disable tapping 4596a46c0ec8Sopenharmony_ci * 4597a46c0ec8Sopenharmony_ci * @return A config status code. Disabling tapping on a device that does not 4598a46c0ec8Sopenharmony_ci * support tapping always succeeds. 4599a46c0ec8Sopenharmony_ci * 4600a46c0ec8Sopenharmony_ci * @see libinput_device_config_tap_get_finger_count 4601a46c0ec8Sopenharmony_ci * @see libinput_device_config_tap_get_enabled 4602a46c0ec8Sopenharmony_ci * @see libinput_device_config_tap_get_default_enabled 4603a46c0ec8Sopenharmony_ci */ 4604a46c0ec8Sopenharmony_cienum libinput_config_status 4605a46c0ec8Sopenharmony_cilibinput_device_config_tap_set_enabled(struct libinput_device *device, 4606a46c0ec8Sopenharmony_ci enum libinput_config_tap_state enable); 4607a46c0ec8Sopenharmony_ci 4608a46c0ec8Sopenharmony_ci/** 4609a46c0ec8Sopenharmony_ci * @ingroup config 4610a46c0ec8Sopenharmony_ci * 4611a46c0ec8Sopenharmony_ci * Check if tap-to-click is enabled on this device. If the device does not 4612a46c0ec8Sopenharmony_ci * support tapping, this function always returns @ref 4613a46c0ec8Sopenharmony_ci * LIBINPUT_CONFIG_TAP_DISABLED. 4614a46c0ec8Sopenharmony_ci * 4615a46c0ec8Sopenharmony_ci * @param device The device to configure 4616a46c0ec8Sopenharmony_ci * 4617a46c0ec8Sopenharmony_ci * @retval LIBINPUT_CONFIG_TAP_ENABLED If tapping is currently enabled 4618a46c0ec8Sopenharmony_ci * @retval LIBINPUT_CONFIG_TAP_DISABLED If tapping is currently disabled 4619a46c0ec8Sopenharmony_ci * 4620a46c0ec8Sopenharmony_ci * @see libinput_device_config_tap_get_finger_count 4621a46c0ec8Sopenharmony_ci * @see libinput_device_config_tap_set_enabled 4622a46c0ec8Sopenharmony_ci * @see libinput_device_config_tap_get_default_enabled 4623a46c0ec8Sopenharmony_ci */ 4624a46c0ec8Sopenharmony_cienum libinput_config_tap_state 4625a46c0ec8Sopenharmony_cilibinput_device_config_tap_get_enabled(struct libinput_device *device); 4626a46c0ec8Sopenharmony_ci 4627a46c0ec8Sopenharmony_ci/** 4628a46c0ec8Sopenharmony_ci * @ingroup config 4629a46c0ec8Sopenharmony_ci * 4630a46c0ec8Sopenharmony_ci * Return the default setting for whether tap-to-click is enabled on this 4631a46c0ec8Sopenharmony_ci * device. 4632a46c0ec8Sopenharmony_ci * 4633a46c0ec8Sopenharmony_ci * @param device The device to configure 4634a46c0ec8Sopenharmony_ci * @retval LIBINPUT_CONFIG_TAP_ENABLED If tapping is enabled by default 4635a46c0ec8Sopenharmony_ci * @retval LIBINPUT_CONFIG_TAP_DISABLED If tapping Is disabled by default 4636a46c0ec8Sopenharmony_ci * 4637a46c0ec8Sopenharmony_ci * @see libinput_device_config_tap_get_finger_count 4638a46c0ec8Sopenharmony_ci * @see libinput_device_config_tap_set_enabled 4639a46c0ec8Sopenharmony_ci * @see libinput_device_config_tap_get_enabled 4640a46c0ec8Sopenharmony_ci */ 4641a46c0ec8Sopenharmony_cienum libinput_config_tap_state 4642a46c0ec8Sopenharmony_cilibinput_device_config_tap_get_default_enabled(struct libinput_device *device); 4643a46c0ec8Sopenharmony_ci 4644a46c0ec8Sopenharmony_ci/** 4645a46c0ec8Sopenharmony_ci * @ingroup config 4646a46c0ec8Sopenharmony_ci * 4647a46c0ec8Sopenharmony_ci * @since 1.5 4648a46c0ec8Sopenharmony_ci */ 4649a46c0ec8Sopenharmony_cienum libinput_config_tap_button_map { 4650a46c0ec8Sopenharmony_ci /** 1/2/3 finger tap maps to left/right/middle */ 4651a46c0ec8Sopenharmony_ci LIBINPUT_CONFIG_TAP_MAP_LRM, 4652a46c0ec8Sopenharmony_ci /** 1/2/3 finger tap maps to left/middle/right*/ 4653a46c0ec8Sopenharmony_ci LIBINPUT_CONFIG_TAP_MAP_LMR, 4654a46c0ec8Sopenharmony_ci}; 4655a46c0ec8Sopenharmony_ci 4656a46c0ec8Sopenharmony_ci/** 4657a46c0ec8Sopenharmony_ci * @ingroup config 4658a46c0ec8Sopenharmony_ci * 4659a46c0ec8Sopenharmony_ci * Set the finger number to button number mapping for tap-to-click. The 4660a46c0ec8Sopenharmony_ci * default mapping on most devices is to have a 1, 2 and 3 finger tap to map 4661a46c0ec8Sopenharmony_ci * to the left, right and middle button, respectively. 4662a46c0ec8Sopenharmony_ci * A device may permit changing the button mapping but disallow specific 4663a46c0ec8Sopenharmony_ci * maps. In this case @ref LIBINPUT_CONFIG_STATUS_UNSUPPORTED is returned, 4664a46c0ec8Sopenharmony_ci * the caller is expected to handle this case correctly. 4665a46c0ec8Sopenharmony_ci * 4666a46c0ec8Sopenharmony_ci * Changing the button mapping may not take effect immediately, 4667a46c0ec8Sopenharmony_ci * the device may wait until it is in a neutral state before applying any 4668a46c0ec8Sopenharmony_ci * changes. 4669a46c0ec8Sopenharmony_ci * 4670a46c0ec8Sopenharmony_ci * The mapping may be changed when tap-to-click is disabled. The new mapping 4671a46c0ec8Sopenharmony_ci * takes effect when tap-to-click is enabled in the future. 4672a46c0ec8Sopenharmony_ci * 4673a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for devices where 4674a46c0ec8Sopenharmony_ci * libinput_device_config_tap_get_finger_count() returns 0. 4675a46c0ec8Sopenharmony_ci * 4676a46c0ec8Sopenharmony_ci * @param device The device to configure 4677a46c0ec8Sopenharmony_ci * @param map The new finger-to-button number mapping 4678a46c0ec8Sopenharmony_ci * @return A config status code. Changing the order on a device that does not 4679a46c0ec8Sopenharmony_ci * support tapping always fails with @ref LIBINPUT_CONFIG_STATUS_UNSUPPORTED. 4680a46c0ec8Sopenharmony_ci * 4681a46c0ec8Sopenharmony_ci * @see libinput_device_config_tap_get_button_map 4682a46c0ec8Sopenharmony_ci * @see libinput_device_config_tap_get_default_button_map 4683a46c0ec8Sopenharmony_ci * 4684a46c0ec8Sopenharmony_ci * @since 1.5 4685a46c0ec8Sopenharmony_ci */ 4686a46c0ec8Sopenharmony_cienum libinput_config_status 4687a46c0ec8Sopenharmony_cilibinput_device_config_tap_set_button_map(struct libinput_device *device, 4688a46c0ec8Sopenharmony_ci enum libinput_config_tap_button_map map); 4689a46c0ec8Sopenharmony_ci 4690a46c0ec8Sopenharmony_ci/** 4691a46c0ec8Sopenharmony_ci * @ingroup config 4692a46c0ec8Sopenharmony_ci * 4693a46c0ec8Sopenharmony_ci * Get the finger number to button number mapping for tap-to-click. 4694a46c0ec8Sopenharmony_ci * 4695a46c0ec8Sopenharmony_ci * The return value for a device that does not support tapping is always 4696a46c0ec8Sopenharmony_ci * @ref LIBINPUT_CONFIG_TAP_MAP_LRM. 4697a46c0ec8Sopenharmony_ci * 4698a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for devices where 4699a46c0ec8Sopenharmony_ci * libinput_device_config_tap_get_finger_count() returns 0. 4700a46c0ec8Sopenharmony_ci * 4701a46c0ec8Sopenharmony_ci * @param device The device to configure 4702a46c0ec8Sopenharmony_ci * @return The current finger-to-button number mapping 4703a46c0ec8Sopenharmony_ci * 4704a46c0ec8Sopenharmony_ci * @see libinput_device_config_tap_set_button_map 4705a46c0ec8Sopenharmony_ci * @see libinput_device_config_tap_get_default_button_map 4706a46c0ec8Sopenharmony_ci * 4707a46c0ec8Sopenharmony_ci * @since 1.5 4708a46c0ec8Sopenharmony_ci */ 4709a46c0ec8Sopenharmony_cienum libinput_config_tap_button_map 4710a46c0ec8Sopenharmony_cilibinput_device_config_tap_get_button_map(struct libinput_device *device); 4711a46c0ec8Sopenharmony_ci 4712a46c0ec8Sopenharmony_ci/** 4713a46c0ec8Sopenharmony_ci * @ingroup config 4714a46c0ec8Sopenharmony_ci * 4715a46c0ec8Sopenharmony_ci * Get the default finger number to button number mapping for tap-to-click. 4716a46c0ec8Sopenharmony_ci * 4717a46c0ec8Sopenharmony_ci * The return value for a device that does not support tapping is always 4718a46c0ec8Sopenharmony_ci * @ref LIBINPUT_CONFIG_TAP_MAP_LRM. 4719a46c0ec8Sopenharmony_ci * 4720a46c0ec8Sopenharmony_ci * @note It is an application bug to call this function for devices where 4721a46c0ec8Sopenharmony_ci * libinput_device_config_tap_get_finger_count() returns 0. 4722a46c0ec8Sopenharmony_ci * 4723a46c0ec8Sopenharmony_ci * @param device The device to configure 4724a46c0ec8Sopenharmony_ci * @return The current finger-to-button number mapping 4725a46c0ec8Sopenharmony_ci * 4726a46c0ec8Sopenharmony_ci * @see libinput_device_config_tap_set_button_map 4727a46c0ec8Sopenharmony_ci * @see libinput_device_config_tap_get_default_button_map 4728a46c0ec8Sopenharmony_ci * 4729a46c0ec8Sopenharmony_ci * @since 1.5 4730a46c0ec8Sopenharmony_ci */ 4731a46c0ec8Sopenharmony_cienum libinput_config_tap_button_map 4732a46c0ec8Sopenharmony_cilibinput_device_config_tap_get_default_button_map(struct libinput_device *device); 4733a46c0ec8Sopenharmony_ci 4734a46c0ec8Sopenharmony_ci/** 4735a46c0ec8Sopenharmony_ci * @ingroup config 4736a46c0ec8Sopenharmony_ci * 4737a46c0ec8Sopenharmony_ci * A config status to distinguish or set dragging on a device. Currently 4738a46c0ec8Sopenharmony_ci * implemented for tap-and-drag only, see 4739a46c0ec8Sopenharmony_ci * libinput_device_config_tap_set_drag_enabled() 4740a46c0ec8Sopenharmony_ci * 4741a46c0ec8Sopenharmony_ci * @since 1.2 4742a46c0ec8Sopenharmony_ci */ 4743a46c0ec8Sopenharmony_cienum libinput_config_drag_state { 4744a46c0ec8Sopenharmony_ci /** 4745a46c0ec8Sopenharmony_ci * Drag is to be disabled, or is 4746a46c0ec8Sopenharmony_ci * currently disabled. 4747a46c0ec8Sopenharmony_ci */ 4748a46c0ec8Sopenharmony_ci LIBINPUT_CONFIG_DRAG_DISABLED, 4749a46c0ec8Sopenharmony_ci /** 4750a46c0ec8Sopenharmony_ci * Drag is to be enabled, or is 4751a46c0ec8Sopenharmony_ci * currently enabled 4752a46c0ec8Sopenharmony_ci */ 4753a46c0ec8Sopenharmony_ci LIBINPUT_CONFIG_DRAG_ENABLED, 4754a46c0ec8Sopenharmony_ci}; 4755a46c0ec8Sopenharmony_ci 4756a46c0ec8Sopenharmony_ci/** 4757a46c0ec8Sopenharmony_ci * @ingroup config 4758a46c0ec8Sopenharmony_ci * 4759a46c0ec8Sopenharmony_ci * Enable or disable tap-and-drag on this device. When enabled, a 4760a46c0ec8Sopenharmony_ci * tap immediately followed by a finger down results in a button down event, 4761a46c0ec8Sopenharmony_ci * subsequent finger motion thus triggers a drag. The button is released 4762a46c0ec8Sopenharmony_ci * on finger up. See the libinput documentation for more details. 4763a46c0ec8Sopenharmony_ci * 4764a46c0ec8Sopenharmony_ci * @param device The device to configure 4765a46c0ec8Sopenharmony_ci * @param enable @ref LIBINPUT_CONFIG_DRAG_ENABLED to enable, @ref 4766a46c0ec8Sopenharmony_ci * LIBINPUT_CONFIG_DRAG_DISABLED to disable tap-and-drag 4767a46c0ec8Sopenharmony_ci * 4768a46c0ec8Sopenharmony_ci * @see libinput_device_config_tap_drag_get_enabled 4769a46c0ec8Sopenharmony_ci * @see libinput_device_config_tap_drag_get_default_enabled 4770a46c0ec8Sopenharmony_ci * 4771a46c0ec8Sopenharmony_ci * @since 1.2 4772a46c0ec8Sopenharmony_ci */ 4773a46c0ec8Sopenharmony_cienum libinput_config_status 4774a46c0ec8Sopenharmony_cilibinput_device_config_tap_set_drag_enabled(struct libinput_device *device, 4775a46c0ec8Sopenharmony_ci enum libinput_config_drag_state enable); 4776a46c0ec8Sopenharmony_ci 4777a46c0ec8Sopenharmony_ci/** 4778a46c0ec8Sopenharmony_ci * @ingroup config 4779a46c0ec8Sopenharmony_ci * 4780a46c0ec8Sopenharmony_ci * Return whether tap-and-drag is enabled or disabled on this device. 4781a46c0ec8Sopenharmony_ci * 4782a46c0ec8Sopenharmony_ci * @param device The device to check 4783a46c0ec8Sopenharmony_ci * @retval LIBINPUT_CONFIG_DRAG_ENABLED if tap-and-drag is enabled 4784a46c0ec8Sopenharmony_ci * @retval LIBINPUT_CONFIG_DRAG_DISABLED if tap-and-drag is 4785a46c0ec8Sopenharmony_ci * disabled 4786a46c0ec8Sopenharmony_ci * 4787a46c0ec8Sopenharmony_ci * @see libinput_device_config_tap_drag_set_enabled 4788a46c0ec8Sopenharmony_ci * @see libinput_device_config_tap_drag_get_default_enabled 4789a46c0ec8Sopenharmony_ci * 4790a46c0ec8Sopenharmony_ci * @since 1.2 4791a46c0ec8Sopenharmony_ci */ 4792a46c0ec8Sopenharmony_cienum libinput_config_drag_state 4793a46c0ec8Sopenharmony_cilibinput_device_config_tap_get_drag_enabled(struct libinput_device *device); 4794a46c0ec8Sopenharmony_ci 4795a46c0ec8Sopenharmony_ci/** 4796a46c0ec8Sopenharmony_ci * @ingroup config 4797a46c0ec8Sopenharmony_ci * 4798a46c0ec8Sopenharmony_ci * Return whether tap-and-drag is enabled or disabled by default on this 4799a46c0ec8Sopenharmony_ci * device. 4800a46c0ec8Sopenharmony_ci * 4801a46c0ec8Sopenharmony_ci * @param device The device to check 4802a46c0ec8Sopenharmony_ci * @retval LIBINPUT_CONFIG_DRAG_ENABLED if tap-and-drag is enabled by 4803a46c0ec8Sopenharmony_ci * default 4804a46c0ec8Sopenharmony_ci * @retval LIBINPUT_CONFIG_DRAG_DISABLED if tap-and-drag is 4805a46c0ec8Sopenharmony_ci * disabled by default 4806a46c0ec8Sopenharmony_ci * 4807a46c0ec8Sopenharmony_ci * @see libinput_device_config_tap_drag_set_enabled 4808a46c0ec8Sopenharmony_ci * @see libinput_device_config_tap_drag_get_enabled 4809a46c0ec8Sopenharmony_ci * 4810a46c0ec8Sopenharmony_ci * @since 1.2 4811a46c0ec8Sopenharmony_ci */ 4812a46c0ec8Sopenharmony_cienum libinput_config_drag_state 4813a46c0ec8Sopenharmony_cilibinput_device_config_tap_get_default_drag_enabled(struct libinput_device *device); 4814a46c0ec8Sopenharmony_ci 4815a46c0ec8Sopenharmony_ci/** 4816a46c0ec8Sopenharmony_ci * @ingroup config 4817a46c0ec8Sopenharmony_ci */ 4818a46c0ec8Sopenharmony_cienum libinput_config_drag_lock_state { 4819a46c0ec8Sopenharmony_ci /** Drag lock is to be disabled, or is currently disabled */ 4820a46c0ec8Sopenharmony_ci LIBINPUT_CONFIG_DRAG_LOCK_DISABLED, 4821a46c0ec8Sopenharmony_ci /** Drag lock is to be enabled, or is currently disabled */ 4822a46c0ec8Sopenharmony_ci LIBINPUT_CONFIG_DRAG_LOCK_ENABLED, 4823a46c0ec8Sopenharmony_ci}; 4824a46c0ec8Sopenharmony_ci 4825a46c0ec8Sopenharmony_ci/** 4826a46c0ec8Sopenharmony_ci * @ingroup config 4827a46c0ec8Sopenharmony_ci * 4828a46c0ec8Sopenharmony_ci * Enable or disable drag-lock during tapping on this device. When enabled, 4829a46c0ec8Sopenharmony_ci * a finger may be lifted and put back on the touchpad within a timeout and 4830a46c0ec8Sopenharmony_ci * the drag process continues. When disabled, lifting the finger during a 4831a46c0ec8Sopenharmony_ci * tap-and-drag will immediately stop the drag. See the libinput 4832a46c0ec8Sopenharmony_ci * documentation for more details. 4833a46c0ec8Sopenharmony_ci * 4834a46c0ec8Sopenharmony_ci * Enabling drag lock on a device that has tapping disabled is permitted, 4835a46c0ec8Sopenharmony_ci * but has no effect until tapping is enabled. 4836a46c0ec8Sopenharmony_ci * 4837a46c0ec8Sopenharmony_ci * @param device The device to configure 4838a46c0ec8Sopenharmony_ci * @param enable @ref LIBINPUT_CONFIG_DRAG_LOCK_ENABLED to enable drag lock 4839a46c0ec8Sopenharmony_ci * or @ref LIBINPUT_CONFIG_DRAG_LOCK_DISABLED to disable drag lock 4840a46c0ec8Sopenharmony_ci * 4841a46c0ec8Sopenharmony_ci * @return A config status code. Disabling drag lock on a device that does not 4842a46c0ec8Sopenharmony_ci * support tapping always succeeds. 4843a46c0ec8Sopenharmony_ci * 4844a46c0ec8Sopenharmony_ci * @see libinput_device_config_tap_get_drag_lock_enabled 4845a46c0ec8Sopenharmony_ci * @see libinput_device_config_tap_get_default_drag_lock_enabled 4846a46c0ec8Sopenharmony_ci */ 4847a46c0ec8Sopenharmony_cienum libinput_config_status 4848a46c0ec8Sopenharmony_cilibinput_device_config_tap_set_drag_lock_enabled(struct libinput_device *device, 4849a46c0ec8Sopenharmony_ci enum libinput_config_drag_lock_state enable); 4850a46c0ec8Sopenharmony_ci 4851a46c0ec8Sopenharmony_ci/** 4852a46c0ec8Sopenharmony_ci * @ingroup config 4853a46c0ec8Sopenharmony_ci * 4854a46c0ec8Sopenharmony_ci * Check if drag-lock during tapping is enabled on this device. If the 4855a46c0ec8Sopenharmony_ci * device does not support tapping, this function always returns 4856a46c0ec8Sopenharmony_ci * @ref LIBINPUT_CONFIG_DRAG_LOCK_DISABLED. 4857a46c0ec8Sopenharmony_ci * 4858a46c0ec8Sopenharmony_ci * Drag lock may be enabled even when tapping is disabled. 4859a46c0ec8Sopenharmony_ci * 4860a46c0ec8Sopenharmony_ci * @param device The device to configure 4861a46c0ec8Sopenharmony_ci * 4862a46c0ec8Sopenharmony_ci * @retval LIBINPUT_CONFIG_DRAG_LOCK_ENABLED If drag lock is currently enabled 4863a46c0ec8Sopenharmony_ci * @retval LIBINPUT_CONFIG_DRAG_LOCK_DISABLED If drag lock is currently disabled 4864a46c0ec8Sopenharmony_ci * 4865a46c0ec8Sopenharmony_ci * @see libinput_device_config_tap_set_drag_lock_enabled 4866a46c0ec8Sopenharmony_ci * @see libinput_device_config_tap_get_default_drag_lock_enabled 4867a46c0ec8Sopenharmony_ci */ 4868a46c0ec8Sopenharmony_cienum libinput_config_drag_lock_state 4869a46c0ec8Sopenharmony_cilibinput_device_config_tap_get_drag_lock_enabled(struct libinput_device *device); 4870a46c0ec8Sopenharmony_ci 4871a46c0ec8Sopenharmony_ci/** 4872a46c0ec8Sopenharmony_ci * @ingroup config 4873a46c0ec8Sopenharmony_ci * 4874a46c0ec8Sopenharmony_ci * Check if drag-lock during tapping is enabled by default on this device. 4875a46c0ec8Sopenharmony_ci * If the device does not support tapping, this function always returns 4876a46c0ec8Sopenharmony_ci * @ref LIBINPUT_CONFIG_DRAG_LOCK_DISABLED. 4877a46c0ec8Sopenharmony_ci * 4878a46c0ec8Sopenharmony_ci * Drag lock may be enabled by default even when tapping is disabled by 4879a46c0ec8Sopenharmony_ci * default. 4880a46c0ec8Sopenharmony_ci * 4881a46c0ec8Sopenharmony_ci * @param device The device to configure 4882a46c0ec8Sopenharmony_ci * 4883a46c0ec8Sopenharmony_ci * @retval LIBINPUT_CONFIG_DRAG_LOCK_ENABLED If drag lock is enabled by 4884a46c0ec8Sopenharmony_ci * default 4885a46c0ec8Sopenharmony_ci * @retval LIBINPUT_CONFIG_DRAG_LOCK_DISABLED If drag lock is disabled by 4886a46c0ec8Sopenharmony_ci * default 4887a46c0ec8Sopenharmony_ci * 4888a46c0ec8Sopenharmony_ci * @see libinput_device_config_tap_set_drag_lock_enabled 4889a46c0ec8Sopenharmony_ci * @see libinput_device_config_tap_get_drag_lock_enabled 4890a46c0ec8Sopenharmony_ci */ 4891a46c0ec8Sopenharmony_cienum libinput_config_drag_lock_state 4892a46c0ec8Sopenharmony_cilibinput_device_config_tap_get_default_drag_lock_enabled(struct libinput_device *device); 4893a46c0ec8Sopenharmony_ci 4894a46c0ec8Sopenharmony_ci/** 4895a46c0ec8Sopenharmony_ci * @ingroup config 4896a46c0ec8Sopenharmony_ci * 4897a46c0ec8Sopenharmony_ci * Check if the device can be calibrated via a calibration matrix. 4898a46c0ec8Sopenharmony_ci * 4899a46c0ec8Sopenharmony_ci * @param device The device to check 4900a46c0ec8Sopenharmony_ci * @return Non-zero if the device can be calibrated, zero otherwise. 4901a46c0ec8Sopenharmony_ci * 4902a46c0ec8Sopenharmony_ci * @see libinput_device_config_calibration_set_matrix 4903a46c0ec8Sopenharmony_ci * @see libinput_device_config_calibration_get_matrix 4904a46c0ec8Sopenharmony_ci * @see libinput_device_config_calibration_get_default_matrix 4905a46c0ec8Sopenharmony_ci */ 4906a46c0ec8Sopenharmony_ciint 4907a46c0ec8Sopenharmony_cilibinput_device_config_calibration_has_matrix(struct libinput_device *device); 4908a46c0ec8Sopenharmony_ci 4909a46c0ec8Sopenharmony_ci/** 4910a46c0ec8Sopenharmony_ci * @ingroup config 4911a46c0ec8Sopenharmony_ci * 4912a46c0ec8Sopenharmony_ci * Apply the 3x3 transformation matrix to absolute device coordinates. This 4913a46c0ec8Sopenharmony_ci * matrix has no effect on relative events. 4914a46c0ec8Sopenharmony_ci * 4915a46c0ec8Sopenharmony_ci * Given a 6-element array [a, b, c, d, e, f], the matrix is applied as 4916a46c0ec8Sopenharmony_ci * @code 4917a46c0ec8Sopenharmony_ci * [ a b c ] [ x ] 4918a46c0ec8Sopenharmony_ci * [ d e f ] * [ y ] 4919a46c0ec8Sopenharmony_ci * [ 0 0 1 ] [ 1 ] 4920a46c0ec8Sopenharmony_ci * @endcode 4921a46c0ec8Sopenharmony_ci * 4922a46c0ec8Sopenharmony_ci * The translation component (c, f) is expected to be normalized to the 4923a46c0ec8Sopenharmony_ci * device coordinate range. For example, the matrix 4924a46c0ec8Sopenharmony_ci * @code 4925a46c0ec8Sopenharmony_ci * [ 1 0 1 ] 4926a46c0ec8Sopenharmony_ci * [ 0 1 -1 ] 4927a46c0ec8Sopenharmony_ci * [ 0 0 1 ] 4928a46c0ec8Sopenharmony_ci * @endcode 4929a46c0ec8Sopenharmony_ci * moves all coordinates by 1 device-width to the right and 1 device-height 4930a46c0ec8Sopenharmony_ci * up. 4931a46c0ec8Sopenharmony_ci * 4932a46c0ec8Sopenharmony_ci * The rotation matrix for rotation around the origin is defined as 4933a46c0ec8Sopenharmony_ci * @code 4934a46c0ec8Sopenharmony_ci * [ cos(a) -sin(a) 0 ] 4935a46c0ec8Sopenharmony_ci * [ sin(a) cos(a) 0 ] 4936a46c0ec8Sopenharmony_ci * [ 0 0 1 ] 4937a46c0ec8Sopenharmony_ci * @endcode 4938a46c0ec8Sopenharmony_ci * Note that any rotation requires an additional translation component to 4939a46c0ec8Sopenharmony_ci * translate the rotated coordinates back into the original device space. 4940a46c0ec8Sopenharmony_ci * The rotation matrixes for 90, 180 and 270 degrees clockwise are: 4941a46c0ec8Sopenharmony_ci * @code 4942a46c0ec8Sopenharmony_ci * 90 deg cw: 180 deg cw: 270 deg cw: 4943a46c0ec8Sopenharmony_ci * [ 0 -1 1] [ -1 0 1] [ 0 1 0 ] 4944a46c0ec8Sopenharmony_ci * [ 1 0 0] [ 0 -1 1] [ -1 0 1 ] 4945a46c0ec8Sopenharmony_ci * [ 0 0 1] [ 0 0 1] [ 0 0 1 ] 4946a46c0ec8Sopenharmony_ci * @endcode 4947a46c0ec8Sopenharmony_ci * 4948a46c0ec8Sopenharmony_ci * @param device The device to configure 4949a46c0ec8Sopenharmony_ci * @param matrix An array representing the first two rows of a 3x3 matrix as 4950a46c0ec8Sopenharmony_ci * described above. 4951a46c0ec8Sopenharmony_ci * 4952a46c0ec8Sopenharmony_ci * @return A config status code. 4953a46c0ec8Sopenharmony_ci * 4954a46c0ec8Sopenharmony_ci * @see libinput_device_config_calibration_has_matrix 4955a46c0ec8Sopenharmony_ci * @see libinput_device_config_calibration_get_matrix 4956a46c0ec8Sopenharmony_ci * @see libinput_device_config_calibration_get_default_matrix 4957a46c0ec8Sopenharmony_ci */ 4958a46c0ec8Sopenharmony_cienum libinput_config_status 4959a46c0ec8Sopenharmony_cilibinput_device_config_calibration_set_matrix(struct libinput_device *device, 4960a46c0ec8Sopenharmony_ci const float matrix[6]); 4961a46c0ec8Sopenharmony_ci 4962a46c0ec8Sopenharmony_ci/** 4963a46c0ec8Sopenharmony_ci * @ingroup config 4964a46c0ec8Sopenharmony_ci * 4965a46c0ec8Sopenharmony_ci * Return the current calibration matrix for this device. 4966a46c0ec8Sopenharmony_ci * 4967a46c0ec8Sopenharmony_ci * @param device The device to configure 4968a46c0ec8Sopenharmony_ci * @param matrix Set to the array representing the first two rows of a 3x3 matrix as 4969a46c0ec8Sopenharmony_ci * described in libinput_device_config_calibration_set_matrix(). 4970a46c0ec8Sopenharmony_ci * 4971a46c0ec8Sopenharmony_ci * @return 0 if no calibration is set and the returned matrix is the 4972a46c0ec8Sopenharmony_ci * identity matrix, 1 otherwise 4973a46c0ec8Sopenharmony_ci * 4974a46c0ec8Sopenharmony_ci * @see libinput_device_config_calibration_has_matrix 4975a46c0ec8Sopenharmony_ci * @see libinput_device_config_calibration_set_matrix 4976a46c0ec8Sopenharmony_ci * @see libinput_device_config_calibration_get_default_matrix 4977a46c0ec8Sopenharmony_ci */ 4978a46c0ec8Sopenharmony_ciint 4979a46c0ec8Sopenharmony_cilibinput_device_config_calibration_get_matrix(struct libinput_device *device, 4980a46c0ec8Sopenharmony_ci float matrix[6]); 4981a46c0ec8Sopenharmony_ci 4982a46c0ec8Sopenharmony_ci/** 4983a46c0ec8Sopenharmony_ci * @ingroup config 4984a46c0ec8Sopenharmony_ci * 4985a46c0ec8Sopenharmony_ci * Return the default calibration matrix for this device. On most devices, 4986a46c0ec8Sopenharmony_ci * this is the identity matrix. If the udev property 4987a46c0ec8Sopenharmony_ci * <b>LIBINPUT_CALIBRATION_MATRIX</b> is set on the respective udev device, 4988a46c0ec8Sopenharmony_ci * that property's value becomes the default matrix, see the libinput 4989a46c0ec8Sopenharmony_ci * documentation for more details. 4990a46c0ec8Sopenharmony_ci * 4991a46c0ec8Sopenharmony_ci * @param device The device to configure 4992a46c0ec8Sopenharmony_ci * @param matrix Set to the array representing the first two rows of a 3x3 matrix as 4993a46c0ec8Sopenharmony_ci * described in libinput_device_config_calibration_set_matrix(). 4994a46c0ec8Sopenharmony_ci * 4995a46c0ec8Sopenharmony_ci * @return 0 if no calibration is set and the returned matrix is the 4996a46c0ec8Sopenharmony_ci * identity matrix, 1 otherwise 4997a46c0ec8Sopenharmony_ci * 4998a46c0ec8Sopenharmony_ci * @see libinput_device_config_calibration_has_matrix 4999a46c0ec8Sopenharmony_ci * @see libinput_device_config_calibration_set_matrix 5000a46c0ec8Sopenharmony_ci * @see libinput_device_config_calibration_get_matrix 5001a46c0ec8Sopenharmony_ci */ 5002a46c0ec8Sopenharmony_ciint 5003a46c0ec8Sopenharmony_cilibinput_device_config_calibration_get_default_matrix(struct libinput_device *device, 5004a46c0ec8Sopenharmony_ci float matrix[6]); 5005a46c0ec8Sopenharmony_ci 5006a46c0ec8Sopenharmony_ci/** 5007a46c0ec8Sopenharmony_ci * @ingroup config 5008a46c0ec8Sopenharmony_ci * 5009a46c0ec8Sopenharmony_ci * The send-event mode of a device defines when a device may generate events 5010a46c0ec8Sopenharmony_ci * and pass those events to the caller. 5011a46c0ec8Sopenharmony_ci */ 5012a46c0ec8Sopenharmony_cienum libinput_config_send_events_mode { 5013a46c0ec8Sopenharmony_ci /** 5014a46c0ec8Sopenharmony_ci * Send events from this device normally. This is a placeholder 5015a46c0ec8Sopenharmony_ci * mode only, any device detected by libinput can be enabled. Do not 5016a46c0ec8Sopenharmony_ci * test for this value as bitmask. 5017a46c0ec8Sopenharmony_ci */ 5018a46c0ec8Sopenharmony_ci LIBINPUT_CONFIG_SEND_EVENTS_ENABLED = 0, 5019a46c0ec8Sopenharmony_ci /** 5020a46c0ec8Sopenharmony_ci * Do not send events through this device. Depending on the device, 5021a46c0ec8Sopenharmony_ci * this may close all file descriptors on the device or it may leave 5022a46c0ec8Sopenharmony_ci * the file descriptors open and route events through a different 5023a46c0ec8Sopenharmony_ci * device. 5024a46c0ec8Sopenharmony_ci * 5025a46c0ec8Sopenharmony_ci * If this bit field is set, other disable modes may be 5026a46c0ec8Sopenharmony_ci * ignored. For example, if both @ref 5027a46c0ec8Sopenharmony_ci * LIBINPUT_CONFIG_SEND_EVENTS_DISABLED and @ref 5028a46c0ec8Sopenharmony_ci * LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE are set, 5029a46c0ec8Sopenharmony_ci * the device remains disabled when all external pointer devices are 5030a46c0ec8Sopenharmony_ci * unplugged. 5031a46c0ec8Sopenharmony_ci */ 5032a46c0ec8Sopenharmony_ci LIBINPUT_CONFIG_SEND_EVENTS_DISABLED = (1 << 0), 5033a46c0ec8Sopenharmony_ci /** 5034a46c0ec8Sopenharmony_ci * If an external pointer device is plugged in, do not send events 5035a46c0ec8Sopenharmony_ci * from this device. This option may be available on built-in 5036a46c0ec8Sopenharmony_ci * touchpads. 5037a46c0ec8Sopenharmony_ci */ 5038a46c0ec8Sopenharmony_ci LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE = (1 << 1), 5039a46c0ec8Sopenharmony_ci}; 5040a46c0ec8Sopenharmony_ci 5041a46c0ec8Sopenharmony_ci/** 5042a46c0ec8Sopenharmony_ci * @ingroup config 5043a46c0ec8Sopenharmony_ci * 5044a46c0ec8Sopenharmony_ci * Return the possible send-event modes for this device. These modes define 5045a46c0ec8Sopenharmony_ci * when a device may process and send events. 5046a46c0ec8Sopenharmony_ci * 5047a46c0ec8Sopenharmony_ci * @param device The device to configure 5048a46c0ec8Sopenharmony_ci * 5049a46c0ec8Sopenharmony_ci * @return A bitmask of possible modes. 5050a46c0ec8Sopenharmony_ci * 5051a46c0ec8Sopenharmony_ci * @see libinput_device_config_send_events_set_mode 5052a46c0ec8Sopenharmony_ci * @see libinput_device_config_send_events_get_mode 5053a46c0ec8Sopenharmony_ci * @see libinput_device_config_send_events_get_default_mode 5054a46c0ec8Sopenharmony_ci */ 5055a46c0ec8Sopenharmony_ciuint32_t 5056a46c0ec8Sopenharmony_cilibinput_device_config_send_events_get_modes(struct libinput_device *device); 5057a46c0ec8Sopenharmony_ci 5058a46c0ec8Sopenharmony_ci/** 5059a46c0ec8Sopenharmony_ci * @ingroup config 5060a46c0ec8Sopenharmony_ci * 5061a46c0ec8Sopenharmony_ci * Set the send-event mode for this device. The mode defines when the device 5062a46c0ec8Sopenharmony_ci * processes and sends events to the caller. 5063a46c0ec8Sopenharmony_ci * 5064a46c0ec8Sopenharmony_ci * The selected mode may not take effect immediately. Events already 5065a46c0ec8Sopenharmony_ci * received and processed from this device are unaffected and will be passed 5066a46c0ec8Sopenharmony_ci * to the caller on the next call to libinput_get_event(). 5067a46c0ec8Sopenharmony_ci * 5068a46c0ec8Sopenharmony_ci * If the mode is a bitmask of @ref libinput_config_send_events_mode, 5069a46c0ec8Sopenharmony_ci * the device may wait for or generate events until it is in a neutral 5070a46c0ec8Sopenharmony_ci * state. For example, this may include waiting for or generating button 5071a46c0ec8Sopenharmony_ci * release events. 5072a46c0ec8Sopenharmony_ci * 5073a46c0ec8Sopenharmony_ci * If the device is already suspended, this function does nothing and 5074a46c0ec8Sopenharmony_ci * returns success. Changing the send-event mode on a device that has been 5075a46c0ec8Sopenharmony_ci * removed is permitted. 5076a46c0ec8Sopenharmony_ci * 5077a46c0ec8Sopenharmony_ci * @param device The device to configure 5078a46c0ec8Sopenharmony_ci * @param mode A bitmask of send-events modes 5079a46c0ec8Sopenharmony_ci * 5080a46c0ec8Sopenharmony_ci * @return A config status code. 5081a46c0ec8Sopenharmony_ci * 5082a46c0ec8Sopenharmony_ci * @see libinput_device_config_send_events_get_modes 5083a46c0ec8Sopenharmony_ci * @see libinput_device_config_send_events_get_mode 5084a46c0ec8Sopenharmony_ci * @see libinput_device_config_send_events_get_default_mode 5085a46c0ec8Sopenharmony_ci */ 5086a46c0ec8Sopenharmony_cienum libinput_config_status 5087a46c0ec8Sopenharmony_cilibinput_device_config_send_events_set_mode(struct libinput_device *device, 5088a46c0ec8Sopenharmony_ci uint32_t mode); 5089a46c0ec8Sopenharmony_ci 5090a46c0ec8Sopenharmony_ci/** 5091a46c0ec8Sopenharmony_ci * @ingroup config 5092a46c0ec8Sopenharmony_ci * 5093a46c0ec8Sopenharmony_ci * Get the send-event mode for this device. The mode defines when the device 5094a46c0ec8Sopenharmony_ci * processes and sends events to the caller. 5095a46c0ec8Sopenharmony_ci * 5096a46c0ec8Sopenharmony_ci * If a caller enables the bits for multiple modes, some of which are 5097a46c0ec8Sopenharmony_ci * subsets of another mode libinput may drop the bits that are subsets. In 5098a46c0ec8Sopenharmony_ci * other words, don't expect libinput_device_config_send_events_get_mode() 5099a46c0ec8Sopenharmony_ci * to always return exactly the same bitmask as passed into 5100a46c0ec8Sopenharmony_ci * libinput_device_config_send_events_set_mode(). 5101a46c0ec8Sopenharmony_ci * 5102a46c0ec8Sopenharmony_ci * @param device The device to configure 5103a46c0ec8Sopenharmony_ci * @return The current bitmask of the send-event mode for this device. 5104a46c0ec8Sopenharmony_ci * 5105a46c0ec8Sopenharmony_ci * @see libinput_device_config_send_events_get_modes 5106a46c0ec8Sopenharmony_ci * @see libinput_device_config_send_events_set_mode 5107a46c0ec8Sopenharmony_ci * @see libinput_device_config_send_events_get_default_mode 5108a46c0ec8Sopenharmony_ci */ 5109a46c0ec8Sopenharmony_ciuint32_t 5110a46c0ec8Sopenharmony_cilibinput_device_config_send_events_get_mode(struct libinput_device *device); 5111a46c0ec8Sopenharmony_ci 5112a46c0ec8Sopenharmony_ci/** 5113a46c0ec8Sopenharmony_ci * @ingroup config 5114a46c0ec8Sopenharmony_ci * 5115a46c0ec8Sopenharmony_ci * Get the default send-event mode for this device. The mode defines when 5116a46c0ec8Sopenharmony_ci * the device processes and sends events to the caller. 5117a46c0ec8Sopenharmony_ci * 5118a46c0ec8Sopenharmony_ci * @param device The device to configure 5119a46c0ec8Sopenharmony_ci * @return The bitmask of the send-event mode for this device. 5120a46c0ec8Sopenharmony_ci * 5121a46c0ec8Sopenharmony_ci * @see libinput_device_config_send_events_get_modes 5122a46c0ec8Sopenharmony_ci * @see libinput_device_config_send_events_set_mode 5123a46c0ec8Sopenharmony_ci * @see libinput_device_config_send_events_get_mode 5124a46c0ec8Sopenharmony_ci */ 5125a46c0ec8Sopenharmony_ciuint32_t 5126a46c0ec8Sopenharmony_cilibinput_device_config_send_events_get_default_mode(struct libinput_device *device); 5127a46c0ec8Sopenharmony_ci 5128a46c0ec8Sopenharmony_ci/** 5129a46c0ec8Sopenharmony_ci * @ingroup config 5130a46c0ec8Sopenharmony_ci * 5131a46c0ec8Sopenharmony_ci * Check if a device uses libinput-internal pointer-acceleration. 5132a46c0ec8Sopenharmony_ci * 5133a46c0ec8Sopenharmony_ci * @param device The device to configure 5134a46c0ec8Sopenharmony_ci * 5135a46c0ec8Sopenharmony_ci * @return 0 if the device is not accelerated, nonzero if it is accelerated 5136a46c0ec8Sopenharmony_ci * 5137a46c0ec8Sopenharmony_ci * @see libinput_device_config_accel_set_speed 5138a46c0ec8Sopenharmony_ci * @see libinput_device_config_accel_get_speed 5139a46c0ec8Sopenharmony_ci * @see libinput_device_config_accel_get_default_speed 5140a46c0ec8Sopenharmony_ci */ 5141a46c0ec8Sopenharmony_ciint 5142a46c0ec8Sopenharmony_cilibinput_device_config_accel_is_available(struct libinput_device *device); 5143a46c0ec8Sopenharmony_ci 5144a46c0ec8Sopenharmony_ci/** 5145a46c0ec8Sopenharmony_ci * @ingroup config 5146a46c0ec8Sopenharmony_ci * 5147a46c0ec8Sopenharmony_ci * Set the pointer acceleration speed of this pointer device within a range 5148a46c0ec8Sopenharmony_ci * of [-1, 1], where 0 is the default acceleration for this device, -1 is 5149a46c0ec8Sopenharmony_ci * the slowest acceleration and 1 is the maximum acceleration available on 5150a46c0ec8Sopenharmony_ci * this device. The actual pointer acceleration mechanism is 5151a46c0ec8Sopenharmony_ci * implementation-dependent, as is the number of steps available within the 5152a46c0ec8Sopenharmony_ci * range. libinput picks the semantically closest acceleration step if the 5153a46c0ec8Sopenharmony_ci * requested value does not match a discrete setting. 5154a46c0ec8Sopenharmony_ci * 5155a46c0ec8Sopenharmony_ci * @param device The device to configure 5156a46c0ec8Sopenharmony_ci * @param speed The normalized speed, in a range of [-1, 1] 5157a46c0ec8Sopenharmony_ci * 5158a46c0ec8Sopenharmony_ci * @return A config status code 5159a46c0ec8Sopenharmony_ci * 5160a46c0ec8Sopenharmony_ci * @see libinput_device_config_accel_is_available 5161a46c0ec8Sopenharmony_ci * @see libinput_device_config_accel_get_speed 5162a46c0ec8Sopenharmony_ci * @see libinput_device_config_accel_get_default_speed 5163a46c0ec8Sopenharmony_ci */ 5164a46c0ec8Sopenharmony_cienum libinput_config_status 5165a46c0ec8Sopenharmony_cilibinput_device_config_accel_set_speed(struct libinput_device *device, 5166a46c0ec8Sopenharmony_ci double speed); 5167a46c0ec8Sopenharmony_ci 5168a46c0ec8Sopenharmony_ci/** 5169a46c0ec8Sopenharmony_ci * @ingroup config 5170a46c0ec8Sopenharmony_ci * 5171a46c0ec8Sopenharmony_ci * Get the current pointer acceleration setting for this pointer device. The 5172a46c0ec8Sopenharmony_ci * returned value is normalized to a range of [-1, 1]. 5173a46c0ec8Sopenharmony_ci * See libinput_device_config_accel_set_speed() for details. 5174a46c0ec8Sopenharmony_ci * 5175a46c0ec8Sopenharmony_ci * If the current acceleration profile is @ref 5176a46c0ec8Sopenharmony_ci * LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM, the behavior of the 5177a46c0ec8Sopenharmony_ci * device will not change but future calls to 5178a46c0ec8Sopenharmony_ci * libinput_device_config_accel_get_speed() will reflect the updated speed 5179a46c0ec8Sopenharmony_ci * setting. 5180a46c0ec8Sopenharmony_ci * 5181a46c0ec8Sopenharmony_ci * @param device The device to configure 5182a46c0ec8Sopenharmony_ci * 5183a46c0ec8Sopenharmony_ci * @return The current speed, range -1 to 1 5184a46c0ec8Sopenharmony_ci * 5185a46c0ec8Sopenharmony_ci * @see libinput_device_config_accel_is_available 5186a46c0ec8Sopenharmony_ci * @see libinput_device_config_accel_set_speed 5187a46c0ec8Sopenharmony_ci * @see libinput_device_config_accel_get_default_speed 5188a46c0ec8Sopenharmony_ci */ 5189a46c0ec8Sopenharmony_cidouble 5190a46c0ec8Sopenharmony_cilibinput_device_config_accel_get_speed(struct libinput_device *device); 5191a46c0ec8Sopenharmony_ci 5192a46c0ec8Sopenharmony_ci/** 5193a46c0ec8Sopenharmony_ci * @ingroup config 5194a46c0ec8Sopenharmony_ci * 5195a46c0ec8Sopenharmony_ci * Return the default speed setting for this device, normalized to a range 5196a46c0ec8Sopenharmony_ci * of [-1, 1]. 5197a46c0ec8Sopenharmony_ci * See libinput_device_config_accel_set_speed() for details. 5198a46c0ec8Sopenharmony_ci * 5199a46c0ec8Sopenharmony_ci * @param device The device to configure 5200a46c0ec8Sopenharmony_ci * @return The default speed setting for this device. 5201a46c0ec8Sopenharmony_ci * 5202a46c0ec8Sopenharmony_ci * @see libinput_device_config_accel_is_available 5203a46c0ec8Sopenharmony_ci * @see libinput_device_config_accel_set_speed 5204a46c0ec8Sopenharmony_ci * @see libinput_device_config_accel_get_speed 5205a46c0ec8Sopenharmony_ci */ 5206a46c0ec8Sopenharmony_cidouble 5207a46c0ec8Sopenharmony_cilibinput_device_config_accel_get_default_speed(struct libinput_device *device); 5208a46c0ec8Sopenharmony_ci 5209a46c0ec8Sopenharmony_ci/** 5210a46c0ec8Sopenharmony_ci * @ingroup config 5211a46c0ec8Sopenharmony_ci * 5212a46c0ec8Sopenharmony_ci * @since 1.1 5213a46c0ec8Sopenharmony_ci */ 5214a46c0ec8Sopenharmony_cienum libinput_config_accel_profile { 5215a46c0ec8Sopenharmony_ci /** 5216a46c0ec8Sopenharmony_ci * Placeholder for devices that don't have a configurable pointer 5217a46c0ec8Sopenharmony_ci * acceleration profile. 5218a46c0ec8Sopenharmony_ci */ 5219a46c0ec8Sopenharmony_ci LIBINPUT_CONFIG_ACCEL_PROFILE_NONE = 0, 5220a46c0ec8Sopenharmony_ci /** 5221a46c0ec8Sopenharmony_ci * A flat acceleration profile. Pointer motion is accelerated by a 5222a46c0ec8Sopenharmony_ci * constant (device-specific) factor, depending on the current 5223a46c0ec8Sopenharmony_ci * speed. 5224a46c0ec8Sopenharmony_ci * 5225a46c0ec8Sopenharmony_ci * @see libinput_device_config_accel_set_speed 5226a46c0ec8Sopenharmony_ci */ 5227a46c0ec8Sopenharmony_ci LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT = (1 << 0), 5228a46c0ec8Sopenharmony_ci 5229a46c0ec8Sopenharmony_ci /** 5230a46c0ec8Sopenharmony_ci * An adaptive acceleration profile. Pointer acceleration depends 5231a46c0ec8Sopenharmony_ci * on the input speed. This is the default profile for most devices. 5232a46c0ec8Sopenharmony_ci */ 5233a46c0ec8Sopenharmony_ci LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE = (1 << 1), 5234a46c0ec8Sopenharmony_ci 5235a46c0ec8Sopenharmony_ci /** 5236a46c0ec8Sopenharmony_ci * A custom acceleration profile. Device movement acceleration depends 5237a46c0ec8Sopenharmony_ci * on user defined custom acceleration functions for each movement 5238a46c0ec8Sopenharmony_ci * type. 5239a46c0ec8Sopenharmony_ci * 5240a46c0ec8Sopenharmony_ci * @see libinput_config_accel_set_points 5241a46c0ec8Sopenharmony_ci */ 5242a46c0ec8Sopenharmony_ci LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM = (1 << 2), 5243a46c0ec8Sopenharmony_ci}; 5244a46c0ec8Sopenharmony_ci 5245a46c0ec8Sopenharmony_ci/** 5246a46c0ec8Sopenharmony_ci * @ingroup config 5247a46c0ec8Sopenharmony_ci * 5248a46c0ec8Sopenharmony_ci * A handle for configuration pointer acceleration. 5249a46c0ec8Sopenharmony_ci * 5250a46c0ec8Sopenharmony_ci * @warning Unlike other structs pointer acceleration configuration is 5251a46c0ec8Sopenharmony_ci * considered transient and <b>not</b> refcounted. Calling 5252a46c0ec8Sopenharmony_ci * libinput_config_accel_destroy() <b>will</b> destroy the configuration. 5253a46c0ec8Sopenharmony_ci * 5254a46c0ec8Sopenharmony_ci * To configure pointer acceleration, first create a config of a desired 5255a46c0ec8Sopenharmony_ci * acceleration profile with libinput_config_accel_create(), then 5256a46c0ec8Sopenharmony_ci * configure the profile-specific acceleration properties. 5257a46c0ec8Sopenharmony_ci * 5258a46c0ec8Sopenharmony_ci * In this version of libinput, this pointer acceleration configuration 5259a46c0ec8Sopenharmony_ci * only provides configuration for @ref LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM. 5260a46c0ec8Sopenharmony_ci * 5261a46c0ec8Sopenharmony_ci * For @ref LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM use 5262a46c0ec8Sopenharmony_ci * @ref libinput_config_accel_set_points. 5263a46c0ec8Sopenharmony_ci * 5264a46c0ec8Sopenharmony_ci * Once set up, apply the configuration to a device using 5265a46c0ec8Sopenharmony_ci * libinput_device_config_accel_apply(). Once applied, 5266a46c0ec8Sopenharmony_ci * destroy it with libinput_config_accel_destroy(). 5267a46c0ec8Sopenharmony_ci * 5268a46c0ec8Sopenharmony_ci * @since 1.23 5269a46c0ec8Sopenharmony_ci */ 5270a46c0ec8Sopenharmony_cistruct libinput_config_accel; 5271a46c0ec8Sopenharmony_ci 5272a46c0ec8Sopenharmony_ci/** 5273a46c0ec8Sopenharmony_ci * @ingroup config 5274a46c0ec8Sopenharmony_ci * 5275a46c0ec8Sopenharmony_ci * Create an acceleration configuration of a given profile. 5276a46c0ec8Sopenharmony_ci * 5277a46c0ec8Sopenharmony_ci * Note that in this version of libinput, only the 5278a46c0ec8Sopenharmony_ci * @ref LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM profile provides configuration 5279a46c0ec8Sopenharmony_ci * options. All other acceleration profiles, when applied, will merely switch 5280a46c0ec8Sopenharmony_ci * the profile and reset any profile-specific options to the default values. 5281a46c0ec8Sopenharmony_ci * 5282a46c0ec8Sopenharmony_ci * @param profile The profile of the newly created acceleration configuration. 5283a46c0ec8Sopenharmony_ci * 5284a46c0ec8Sopenharmony_ci * @return The newly created acceleration configuration or NULL on error. 5285a46c0ec8Sopenharmony_ci * 5286a46c0ec8Sopenharmony_ci * @warning Unlike other structs pointer acceleration configuration is 5287a46c0ec8Sopenharmony_ci * considered transient and <b>not</b> refcounted. Calling 5288a46c0ec8Sopenharmony_ci * libinput_config_accel_destroy() <b>will</b> destroy the configuration. 5289a46c0ec8Sopenharmony_ci * 5290a46c0ec8Sopenharmony_ci * @see libinput_config_accel 5291a46c0ec8Sopenharmony_ci * @since 1.23 5292a46c0ec8Sopenharmony_ci */ 5293a46c0ec8Sopenharmony_cistruct libinput_config_accel * 5294a46c0ec8Sopenharmony_cilibinput_config_accel_create(enum libinput_config_accel_profile profile); 5295a46c0ec8Sopenharmony_ci 5296a46c0ec8Sopenharmony_ci/** 5297a46c0ec8Sopenharmony_ci * @ingroup config 5298a46c0ec8Sopenharmony_ci * 5299a46c0ec8Sopenharmony_ci * Destroy an acceleration configuration. 5300a46c0ec8Sopenharmony_ci * 5301a46c0ec8Sopenharmony_ci * @warning Unlike other structs pointer acceleration configuration is 5302a46c0ec8Sopenharmony_ci * considered transient and <b>not</b> refcounted. Calling 5303a46c0ec8Sopenharmony_ci * libinput_config_accel_destroy() <b>will</b> destroy the configuration. 5304a46c0ec8Sopenharmony_ci * 5305a46c0ec8Sopenharmony_ci * @param accel_config The acceleration configuration to destroy. 5306a46c0ec8Sopenharmony_ci * 5307a46c0ec8Sopenharmony_ci * @see libinput_config_accel 5308a46c0ec8Sopenharmony_ci * @since 1.23 5309a46c0ec8Sopenharmony_ci */ 5310a46c0ec8Sopenharmony_civoid 5311a46c0ec8Sopenharmony_cilibinput_config_accel_destroy(struct libinput_config_accel *accel_config); 5312a46c0ec8Sopenharmony_ci 5313a46c0ec8Sopenharmony_ci/** 5314a46c0ec8Sopenharmony_ci * @ingroup config 5315a46c0ec8Sopenharmony_ci * 5316a46c0ec8Sopenharmony_ci * Apply this pointer acceleration configuration to the device. This changes the 5317a46c0ec8Sopenharmony_ci * device's pointer acceleration method to the method given in 5318a46c0ec8Sopenharmony_ci * libinput_config_accel_create() and applies all other configuration settings. 5319a46c0ec8Sopenharmony_ci * 5320a46c0ec8Sopenharmony_ci * Once applied, call libinput_config_accel_destroy() to destroy the 5321a46c0ec8Sopenharmony_ci * configuration struct. 5322a46c0ec8Sopenharmony_ci * 5323a46c0ec8Sopenharmony_ci * @param device The device to configure. 5324a46c0ec8Sopenharmony_ci * @param accel_config The acceleration configuration. 5325a46c0ec8Sopenharmony_ci * 5326a46c0ec8Sopenharmony_ci * @return A config status code. 5327a46c0ec8Sopenharmony_ci * 5328a46c0ec8Sopenharmony_ci * @see libinput_config_accel 5329a46c0ec8Sopenharmony_ci * @since 1.23 5330a46c0ec8Sopenharmony_ci */ 5331a46c0ec8Sopenharmony_cienum libinput_config_status 5332a46c0ec8Sopenharmony_cilibinput_device_config_accel_apply(struct libinput_device *device, 5333a46c0ec8Sopenharmony_ci struct libinput_config_accel *accel_config); 5334a46c0ec8Sopenharmony_ci 5335a46c0ec8Sopenharmony_ci/** 5336a46c0ec8Sopenharmony_ci * @ingroup config 5337a46c0ec8Sopenharmony_ci * 5338a46c0ec8Sopenharmony_ci * Acceleration types are categories of movement by a device that may have 5339a46c0ec8Sopenharmony_ci * specific acceleration functions applied. A device always supports the 5340a46c0ec8Sopenharmony_ci * @ref LIBINPUT_ACCEL_TYPE_MOTION type (for regular pointer motion). Other 5341a46c0ec8Sopenharmony_ci * types (e.g. scrolling) may be added in the future. 5342a46c0ec8Sopenharmony_ci * 5343a46c0ec8Sopenharmony_ci * The special type @ref LIBINPUT_ACCEL_TYPE_FALLBACK specifies the acceleration 5344a46c0ec8Sopenharmony_ci * function to be moved for any movement produced by the device that does not 5345a46c0ec8Sopenharmony_ci * have a specific acceleration type defined. 5346a46c0ec8Sopenharmony_ci * 5347a46c0ec8Sopenharmony_ci * Use to specify the acceleration function type in 5348a46c0ec8Sopenharmony_ci * @ref libinput_config_accel_set_points 5349a46c0ec8Sopenharmony_ci * 5350a46c0ec8Sopenharmony_ci * Each device implements a subset of those types, see a list of supported 5351a46c0ec8Sopenharmony_ci * devices for each movement type definition. 5352a46c0ec8Sopenharmony_ci * 5353a46c0ec8Sopenharmony_ci * @see LIBINPUT_ACCEL_ARG_TYPE 5354a46c0ec8Sopenharmony_ci * @since 1.23 5355a46c0ec8Sopenharmony_ci */ 5356a46c0ec8Sopenharmony_cienum libinput_config_accel_type { 5357a46c0ec8Sopenharmony_ci /** 5358a46c0ec8Sopenharmony_ci * The default acceleration type used as a fallback when other 5359a46c0ec8Sopenharmony_ci * acceleration types are not provided. 5360a46c0ec8Sopenharmony_ci */ 5361a46c0ec8Sopenharmony_ci LIBINPUT_ACCEL_TYPE_FALLBACK = 0, 5362a46c0ec8Sopenharmony_ci /** 5363a46c0ec8Sopenharmony_ci * Acceleration type for regular pointer movement. This 5364a46c0ec8Sopenharmony_ci * type is always supported. 5365a46c0ec8Sopenharmony_ci */ 5366a46c0ec8Sopenharmony_ci LIBINPUT_ACCEL_TYPE_MOTION, 5367a46c0ec8Sopenharmony_ci /** 5368a46c0ec8Sopenharmony_ci * Acceleration type for scroll movement. 5369a46c0ec8Sopenharmony_ci * This type is supported by mouse and touchpad. 5370a46c0ec8Sopenharmony_ci */ 5371a46c0ec8Sopenharmony_ci LIBINPUT_ACCEL_TYPE_SCROLL, 5372a46c0ec8Sopenharmony_ci}; 5373a46c0ec8Sopenharmony_ci 5374a46c0ec8Sopenharmony_ci/** 5375a46c0ec8Sopenharmony_ci * @ingroup config 5376a46c0ec8Sopenharmony_ci * 5377a46c0ec8Sopenharmony_ci * Defines the acceleration function for a given movement type 5378a46c0ec8Sopenharmony_ci * in an acceleration configuration with the profile 5379a46c0ec8Sopenharmony_ci * @ref LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM. 5380a46c0ec8Sopenharmony_ci * 5381a46c0ec8Sopenharmony_ci * Movement types are specific to each device, @see libinput_config_accel_type. 5382a46c0ec8Sopenharmony_ci * 5383a46c0ec8Sopenharmony_ci * Each custom acceleration function is defined by ``n`` points spaced uniformly 5384a46c0ec8Sopenharmony_ci * along the x-axis starting from 0 and continuing in a constant step size. 5385a46c0ec8Sopenharmony_ci * There by the function is defined by the following points: 5386a46c0ec8Sopenharmony_ci * (0 * step, f[0]), (1 * step, f[1]), ..., ((n - 1) * step, f[n - 1]). 5387a46c0ec8Sopenharmony_ci * The x-axis represents the device-speed in device units per millisecond. 5388a46c0ec8Sopenharmony_ci * The y-axis represents the pointer-speed. 5389a46c0ec8Sopenharmony_ci * 5390a46c0ec8Sopenharmony_ci * It is up to the user to define those values in accordance with device DPI 5391a46c0ec8Sopenharmony_ci * and screen DPI. 5392a46c0ec8Sopenharmony_ci * 5393a46c0ec8Sopenharmony_ci * @param accel_config The acceleration configuration to modify. 5394a46c0ec8Sopenharmony_ci * @param accel_type The movement type to configure a custom function for. 5395a46c0ec8Sopenharmony_ci * @param step The distance between each point along the x-axis. 5396a46c0ec8Sopenharmony_ci * @param npoints The number of points of the custom acceleration function. 5397a46c0ec8Sopenharmony_ci * @param points The points' y-values of the custom acceleration function. 5398a46c0ec8Sopenharmony_ci * 5399a46c0ec8Sopenharmony_ci * @return A config status code. 5400a46c0ec8Sopenharmony_ci * 5401a46c0ec8Sopenharmony_ci * @see libinput_config_accel 5402a46c0ec8Sopenharmony_ci * @since 1.23 5403a46c0ec8Sopenharmony_ci */ 5404a46c0ec8Sopenharmony_cienum libinput_config_status 5405a46c0ec8Sopenharmony_cilibinput_config_accel_set_points(struct libinput_config_accel *accel_config, 5406a46c0ec8Sopenharmony_ci enum libinput_config_accel_type accel_type, 5407a46c0ec8Sopenharmony_ci double step, size_t npoints, double *points); 5408a46c0ec8Sopenharmony_ci 5409a46c0ec8Sopenharmony_ci/** 5410a46c0ec8Sopenharmony_ci * @ingroup config 5411a46c0ec8Sopenharmony_ci * 5412a46c0ec8Sopenharmony_ci * Returns a bitmask of the configurable acceleration modes available on 5413a46c0ec8Sopenharmony_ci * this device. 5414a46c0ec8Sopenharmony_ci * 5415a46c0ec8Sopenharmony_ci * @param device The device to configure 5416a46c0ec8Sopenharmony_ci * 5417a46c0ec8Sopenharmony_ci * @return A bitmask of all configurable modes available on this device. 5418a46c0ec8Sopenharmony_ci * 5419a46c0ec8Sopenharmony_ci * @since 1.1 5420a46c0ec8Sopenharmony_ci */ 5421a46c0ec8Sopenharmony_ciuint32_t 5422a46c0ec8Sopenharmony_cilibinput_device_config_accel_get_profiles(struct libinput_device *device); 5423a46c0ec8Sopenharmony_ci 5424a46c0ec8Sopenharmony_ci/** 5425a46c0ec8Sopenharmony_ci * @ingroup config 5426a46c0ec8Sopenharmony_ci * 5427a46c0ec8Sopenharmony_ci * Set the pointer acceleration profile of this pointer device to the given 5428a46c0ec8Sopenharmony_ci * mode. 5429a46c0ec8Sopenharmony_ci * 5430a46c0ec8Sopenharmony_ci * @param device The device to configure 5431a46c0ec8Sopenharmony_ci * @param profile The profile to set the device to. 5432a46c0ec8Sopenharmony_ci * 5433a46c0ec8Sopenharmony_ci * @return A config status code 5434a46c0ec8Sopenharmony_ci * 5435a46c0ec8Sopenharmony_ci * @since 1.1 5436a46c0ec8Sopenharmony_ci */ 5437a46c0ec8Sopenharmony_cienum libinput_config_status 5438a46c0ec8Sopenharmony_cilibinput_device_config_accel_set_profile(struct libinput_device *device, 5439a46c0ec8Sopenharmony_ci enum libinput_config_accel_profile profile); 5440a46c0ec8Sopenharmony_ci 5441a46c0ec8Sopenharmony_ci/** 5442a46c0ec8Sopenharmony_ci * @ingroup config 5443a46c0ec8Sopenharmony_ci * 5444a46c0ec8Sopenharmony_ci * Get the current pointer acceleration profile for this pointer device. 5445a46c0ec8Sopenharmony_ci * 5446a46c0ec8Sopenharmony_ci * @param device The device to configure 5447a46c0ec8Sopenharmony_ci * 5448a46c0ec8Sopenharmony_ci * @return The currently configured pointer acceleration profile. 5449a46c0ec8Sopenharmony_ci * 5450a46c0ec8Sopenharmony_ci * @since 1.1 5451a46c0ec8Sopenharmony_ci */ 5452a46c0ec8Sopenharmony_cienum libinput_config_accel_profile 5453a46c0ec8Sopenharmony_cilibinput_device_config_accel_get_profile(struct libinput_device *device); 5454a46c0ec8Sopenharmony_ci 5455a46c0ec8Sopenharmony_ci/** 5456a46c0ec8Sopenharmony_ci * @ingroup config 5457a46c0ec8Sopenharmony_ci * 5458a46c0ec8Sopenharmony_ci * Return the default pointer acceleration profile for this pointer device. 5459a46c0ec8Sopenharmony_ci * 5460a46c0ec8Sopenharmony_ci * @param device The device to configure 5461a46c0ec8Sopenharmony_ci * 5462a46c0ec8Sopenharmony_ci * @return The default acceleration profile for this device. 5463a46c0ec8Sopenharmony_ci * 5464a46c0ec8Sopenharmony_ci * @since 1.1 5465a46c0ec8Sopenharmony_ci */ 5466a46c0ec8Sopenharmony_cienum libinput_config_accel_profile 5467a46c0ec8Sopenharmony_cilibinput_device_config_accel_get_default_profile(struct libinput_device *device); 5468a46c0ec8Sopenharmony_ci 5469a46c0ec8Sopenharmony_ci/** 5470a46c0ec8Sopenharmony_ci * @ingroup config 5471a46c0ec8Sopenharmony_ci * 5472a46c0ec8Sopenharmony_ci * Return non-zero if the device supports "natural scrolling". 5473a46c0ec8Sopenharmony_ci * 5474a46c0ec8Sopenharmony_ci * In traditional scroll mode, the movement of fingers on a touchpad when 5475a46c0ec8Sopenharmony_ci * scrolling matches the movement of the scroll bars. When the fingers move 5476a46c0ec8Sopenharmony_ci * down, the scroll bar moves down, a line of text on the screen moves 5477a46c0ec8Sopenharmony_ci * towards the upper end of the screen. This also matches scroll wheels on 5478a46c0ec8Sopenharmony_ci * mice (wheel down, content moves up). 5479a46c0ec8Sopenharmony_ci * 5480a46c0ec8Sopenharmony_ci * Natural scrolling is the term coined by Apple for inverted scrolling. 5481a46c0ec8Sopenharmony_ci * In this mode, the effect of scrolling movement of fingers on a touchpad 5482a46c0ec8Sopenharmony_ci * resemble physical manipulation of paper. When the fingers move down, a 5483a46c0ec8Sopenharmony_ci * line of text on the screen moves down (scrollbars move up). This is the 5484a46c0ec8Sopenharmony_ci * opposite of scroll wheels on mice. 5485a46c0ec8Sopenharmony_ci * 5486a46c0ec8Sopenharmony_ci * A device supporting natural scrolling can be switched between traditional 5487a46c0ec8Sopenharmony_ci * scroll mode and natural scroll mode. 5488a46c0ec8Sopenharmony_ci * 5489a46c0ec8Sopenharmony_ci * @param device The device to configure 5490a46c0ec8Sopenharmony_ci * 5491a46c0ec8Sopenharmony_ci * @return Zero if natural scrolling is not supported, non-zero if natural 5492a46c0ec8Sopenharmony_ci * scrolling is supported by this device 5493a46c0ec8Sopenharmony_ci * 5494a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_set_natural_scroll_enabled 5495a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_natural_scroll_enabled 5496a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_default_natural_scroll_enabled 5497a46c0ec8Sopenharmony_ci */ 5498a46c0ec8Sopenharmony_ciint 5499a46c0ec8Sopenharmony_cilibinput_device_config_scroll_has_natural_scroll(struct libinput_device *device); 5500a46c0ec8Sopenharmony_ci 5501a46c0ec8Sopenharmony_ci/** 5502a46c0ec8Sopenharmony_ci * @ingroup config 5503a46c0ec8Sopenharmony_ci * 5504a46c0ec8Sopenharmony_ci * Enable or disable natural scrolling on the device. 5505a46c0ec8Sopenharmony_ci * 5506a46c0ec8Sopenharmony_ci * @param device The device to configure 5507a46c0ec8Sopenharmony_ci * @param enable non-zero to enable, zero to disable natural scrolling 5508a46c0ec8Sopenharmony_ci * 5509a46c0ec8Sopenharmony_ci * @return A config status code 5510a46c0ec8Sopenharmony_ci * 5511a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_has_natural_scroll 5512a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_natural_scroll_enabled 5513a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_default_natural_scroll_enabled 5514a46c0ec8Sopenharmony_ci */ 5515a46c0ec8Sopenharmony_cienum libinput_config_status 5516a46c0ec8Sopenharmony_cilibinput_device_config_scroll_set_natural_scroll_enabled(struct libinput_device *device, 5517a46c0ec8Sopenharmony_ci int enable); 5518a46c0ec8Sopenharmony_ci/** 5519a46c0ec8Sopenharmony_ci * @ingroup config 5520a46c0ec8Sopenharmony_ci * 5521a46c0ec8Sopenharmony_ci * Get the current mode for scrolling on this device 5522a46c0ec8Sopenharmony_ci * 5523a46c0ec8Sopenharmony_ci * @param device The device to configure 5524a46c0ec8Sopenharmony_ci * 5525a46c0ec8Sopenharmony_ci * @return Zero if natural scrolling is disabled, non-zero if enabled 5526a46c0ec8Sopenharmony_ci * 5527a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_has_natural_scroll 5528a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_set_natural_scroll_enabled 5529a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_default_natural_scroll_enabled 5530a46c0ec8Sopenharmony_ci */ 5531a46c0ec8Sopenharmony_ciint 5532a46c0ec8Sopenharmony_cilibinput_device_config_scroll_get_natural_scroll_enabled(struct libinput_device *device); 5533a46c0ec8Sopenharmony_ci 5534a46c0ec8Sopenharmony_ci/** 5535a46c0ec8Sopenharmony_ci * @ingroup config 5536a46c0ec8Sopenharmony_ci * 5537a46c0ec8Sopenharmony_ci * Get the default mode for scrolling on this device 5538a46c0ec8Sopenharmony_ci * 5539a46c0ec8Sopenharmony_ci * @param device The device to configure 5540a46c0ec8Sopenharmony_ci * 5541a46c0ec8Sopenharmony_ci * @return Zero if natural scrolling is disabled by default, non-zero if enabled 5542a46c0ec8Sopenharmony_ci * 5543a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_has_natural_scroll 5544a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_set_natural_scroll_enabled 5545a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_natural_scroll_enabled 5546a46c0ec8Sopenharmony_ci */ 5547a46c0ec8Sopenharmony_ciint 5548a46c0ec8Sopenharmony_cilibinput_device_config_scroll_get_default_natural_scroll_enabled(struct libinput_device *device); 5549a46c0ec8Sopenharmony_ci 5550a46c0ec8Sopenharmony_ci/** 5551a46c0ec8Sopenharmony_ci * @ingroup config 5552a46c0ec8Sopenharmony_ci * 5553a46c0ec8Sopenharmony_ci * Check if a device has a configuration that supports left-handed usage. 5554a46c0ec8Sopenharmony_ci * 5555a46c0ec8Sopenharmony_ci * @param device The device to configure 5556a46c0ec8Sopenharmony_ci * @return Non-zero if the device can be set to left-handed, or zero 5557a46c0ec8Sopenharmony_ci * otherwise 5558a46c0ec8Sopenharmony_ci * 5559a46c0ec8Sopenharmony_ci * @see libinput_device_config_left_handed_set 5560a46c0ec8Sopenharmony_ci * @see libinput_device_config_left_handed_get 5561a46c0ec8Sopenharmony_ci * @see libinput_device_config_left_handed_get_default 5562a46c0ec8Sopenharmony_ci */ 5563a46c0ec8Sopenharmony_ciint 5564a46c0ec8Sopenharmony_cilibinput_device_config_left_handed_is_available(struct libinput_device *device); 5565a46c0ec8Sopenharmony_ci 5566a46c0ec8Sopenharmony_ci/** 5567a46c0ec8Sopenharmony_ci * @ingroup config 5568a46c0ec8Sopenharmony_ci * 5569a46c0ec8Sopenharmony_ci * Set the left-handed configuration of the device. 5570a46c0ec8Sopenharmony_ci * 5571a46c0ec8Sopenharmony_ci * The exact behavior is device-dependent. On a mouse and most pointing 5572a46c0ec8Sopenharmony_ci * devices, left and right buttons are swapped but the middle button is 5573a46c0ec8Sopenharmony_ci * unmodified. On a touchpad, physical buttons (if present) are swapped. On a 5574a46c0ec8Sopenharmony_ci * clickpad, the top and bottom software-emulated buttons are swapped where 5575a46c0ec8Sopenharmony_ci * present, the main area of the touchpad remains a left button. Tapping and 5576a46c0ec8Sopenharmony_ci * clickfinger behavior is not affected by this setting. 5577a46c0ec8Sopenharmony_ci * 5578a46c0ec8Sopenharmony_ci * Changing the left-handed configuration of a device may not take effect 5579a46c0ec8Sopenharmony_ci * until all buttons have been logically released. 5580a46c0ec8Sopenharmony_ci * 5581a46c0ec8Sopenharmony_ci * @param device The device to configure 5582a46c0ec8Sopenharmony_ci * @param left_handed Zero to disable, non-zero to enable left-handed mode 5583a46c0ec8Sopenharmony_ci * @return A configuration status code 5584a46c0ec8Sopenharmony_ci * 5585a46c0ec8Sopenharmony_ci * @see libinput_device_config_left_handed_is_available 5586a46c0ec8Sopenharmony_ci * @see libinput_device_config_left_handed_get 5587a46c0ec8Sopenharmony_ci * @see libinput_device_config_left_handed_get_default 5588a46c0ec8Sopenharmony_ci */ 5589a46c0ec8Sopenharmony_cienum libinput_config_status 5590a46c0ec8Sopenharmony_cilibinput_device_config_left_handed_set(struct libinput_device *device, 5591a46c0ec8Sopenharmony_ci int left_handed); 5592a46c0ec8Sopenharmony_ci 5593a46c0ec8Sopenharmony_ci/** 5594a46c0ec8Sopenharmony_ci * @ingroup config 5595a46c0ec8Sopenharmony_ci * 5596a46c0ec8Sopenharmony_ci * Get the current left-handed configuration of the device. 5597a46c0ec8Sopenharmony_ci * 5598a46c0ec8Sopenharmony_ci * @param device The device to configure 5599a46c0ec8Sopenharmony_ci * @return Zero if the device is in right-handed mode, non-zero if the 5600a46c0ec8Sopenharmony_ci * device is in left-handed mode 5601a46c0ec8Sopenharmony_ci * 5602a46c0ec8Sopenharmony_ci * @see libinput_device_config_left_handed_is_available 5603a46c0ec8Sopenharmony_ci * @see libinput_device_config_left_handed_set 5604a46c0ec8Sopenharmony_ci * @see libinput_device_config_left_handed_get_default 5605a46c0ec8Sopenharmony_ci */ 5606a46c0ec8Sopenharmony_ciint 5607a46c0ec8Sopenharmony_cilibinput_device_config_left_handed_get(struct libinput_device *device); 5608a46c0ec8Sopenharmony_ci 5609a46c0ec8Sopenharmony_ci/** 5610a46c0ec8Sopenharmony_ci * @ingroup config 5611a46c0ec8Sopenharmony_ci * 5612a46c0ec8Sopenharmony_ci * Get the default left-handed configuration of the device. 5613a46c0ec8Sopenharmony_ci * 5614a46c0ec8Sopenharmony_ci * @param device The device to configure 5615a46c0ec8Sopenharmony_ci * @return Zero if the device is in right-handed mode by default, or non-zero 5616a46c0ec8Sopenharmony_ci * if the device is in left-handed mode by default 5617a46c0ec8Sopenharmony_ci * 5618a46c0ec8Sopenharmony_ci * @see libinput_device_config_left_handed_is_available 5619a46c0ec8Sopenharmony_ci * @see libinput_device_config_left_handed_set 5620a46c0ec8Sopenharmony_ci * @see libinput_device_config_left_handed_get 5621a46c0ec8Sopenharmony_ci */ 5622a46c0ec8Sopenharmony_ciint 5623a46c0ec8Sopenharmony_cilibinput_device_config_left_handed_get_default(struct libinput_device *device); 5624a46c0ec8Sopenharmony_ci 5625a46c0ec8Sopenharmony_ci/** 5626a46c0ec8Sopenharmony_ci * @ingroup config 5627a46c0ec8Sopenharmony_ci * 5628a46c0ec8Sopenharmony_ci * The click method defines when to generate software-emulated 5629a46c0ec8Sopenharmony_ci * buttons, usually on a device that does not have a specific physical 5630a46c0ec8Sopenharmony_ci * button available. 5631a46c0ec8Sopenharmony_ci */ 5632a46c0ec8Sopenharmony_cienum libinput_config_click_method { 5633a46c0ec8Sopenharmony_ci /** 5634a46c0ec8Sopenharmony_ci * Do not send software-emulated button events. This has no effect 5635a46c0ec8Sopenharmony_ci * on events generated by physical buttons. 5636a46c0ec8Sopenharmony_ci */ 5637a46c0ec8Sopenharmony_ci LIBINPUT_CONFIG_CLICK_METHOD_NONE = 0, 5638a46c0ec8Sopenharmony_ci /** 5639a46c0ec8Sopenharmony_ci * Use software-button areas to generate button events. 5640a46c0ec8Sopenharmony_ci */ 5641a46c0ec8Sopenharmony_ci LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS = (1 << 0), 5642a46c0ec8Sopenharmony_ci /** 5643a46c0ec8Sopenharmony_ci * The number of fingers decides which button press to generate. 5644a46c0ec8Sopenharmony_ci */ 5645a46c0ec8Sopenharmony_ci LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER = (1 << 1), 5646a46c0ec8Sopenharmony_ci}; 5647a46c0ec8Sopenharmony_ci 5648a46c0ec8Sopenharmony_ci/** 5649a46c0ec8Sopenharmony_ci * @ingroup config 5650a46c0ec8Sopenharmony_ci * 5651a46c0ec8Sopenharmony_ci * Check which button click methods a device supports. The button click 5652a46c0ec8Sopenharmony_ci * method defines when to generate software-emulated buttons, usually on a 5653a46c0ec8Sopenharmony_ci * device that does not have a specific physical button available. 5654a46c0ec8Sopenharmony_ci * 5655a46c0ec8Sopenharmony_ci * @param device The device to configure 5656a46c0ec8Sopenharmony_ci * 5657a46c0ec8Sopenharmony_ci * @return A bitmask of possible methods. 5658a46c0ec8Sopenharmony_ci * 5659a46c0ec8Sopenharmony_ci * @see libinput_device_config_click_get_methods 5660a46c0ec8Sopenharmony_ci * @see libinput_device_config_click_set_method 5661a46c0ec8Sopenharmony_ci * @see libinput_device_config_click_get_method 5662a46c0ec8Sopenharmony_ci */ 5663a46c0ec8Sopenharmony_ciuint32_t 5664a46c0ec8Sopenharmony_cilibinput_device_config_click_get_methods(struct libinput_device *device); 5665a46c0ec8Sopenharmony_ci 5666a46c0ec8Sopenharmony_ci/** 5667a46c0ec8Sopenharmony_ci * @ingroup config 5668a46c0ec8Sopenharmony_ci * 5669a46c0ec8Sopenharmony_ci * Set the button click method for this device. The button click 5670a46c0ec8Sopenharmony_ci * method defines when to generate software-emulated buttons, usually on a 5671a46c0ec8Sopenharmony_ci * device that does not have a specific physical button available. 5672a46c0ec8Sopenharmony_ci * 5673a46c0ec8Sopenharmony_ci * @note The selected click method may not take effect immediately. The 5674a46c0ec8Sopenharmony_ci * device may require changing to a neutral state first before activating 5675a46c0ec8Sopenharmony_ci * the new method. 5676a46c0ec8Sopenharmony_ci * 5677a46c0ec8Sopenharmony_ci * @param device The device to configure 5678a46c0ec8Sopenharmony_ci * @param method The button click method 5679a46c0ec8Sopenharmony_ci * 5680a46c0ec8Sopenharmony_ci * @return A config status code 5681a46c0ec8Sopenharmony_ci * 5682a46c0ec8Sopenharmony_ci * @see libinput_device_config_click_get_methods 5683a46c0ec8Sopenharmony_ci * @see libinput_device_config_click_get_method 5684a46c0ec8Sopenharmony_ci * @see libinput_device_config_click_get_default_method 5685a46c0ec8Sopenharmony_ci */ 5686a46c0ec8Sopenharmony_cienum libinput_config_status 5687a46c0ec8Sopenharmony_cilibinput_device_config_click_set_method(struct libinput_device *device, 5688a46c0ec8Sopenharmony_ci enum libinput_config_click_method method); 5689a46c0ec8Sopenharmony_ci/** 5690a46c0ec8Sopenharmony_ci * @ingroup config 5691a46c0ec8Sopenharmony_ci * 5692a46c0ec8Sopenharmony_ci * Get the button click method for this device. The button click 5693a46c0ec8Sopenharmony_ci * method defines when to generate software-emulated buttons, usually on a 5694a46c0ec8Sopenharmony_ci * device that does not have a specific physical button available. 5695a46c0ec8Sopenharmony_ci * 5696a46c0ec8Sopenharmony_ci * @param device The device to configure 5697a46c0ec8Sopenharmony_ci * 5698a46c0ec8Sopenharmony_ci * @return The current button click method for this device 5699a46c0ec8Sopenharmony_ci * 5700a46c0ec8Sopenharmony_ci * @see libinput_device_config_click_get_methods 5701a46c0ec8Sopenharmony_ci * @see libinput_device_config_click_set_method 5702a46c0ec8Sopenharmony_ci * @see libinput_device_config_click_get_default_method 5703a46c0ec8Sopenharmony_ci */ 5704a46c0ec8Sopenharmony_cienum libinput_config_click_method 5705a46c0ec8Sopenharmony_cilibinput_device_config_click_get_method(struct libinput_device *device); 5706a46c0ec8Sopenharmony_ci 5707a46c0ec8Sopenharmony_ci/** 5708a46c0ec8Sopenharmony_ci * @ingroup config 5709a46c0ec8Sopenharmony_ci * 5710a46c0ec8Sopenharmony_ci * Get the default button click method for this device. The button click 5711a46c0ec8Sopenharmony_ci * method defines when to generate software-emulated buttons, usually on a 5712a46c0ec8Sopenharmony_ci * device that does not have a specific physical button available. 5713a46c0ec8Sopenharmony_ci * 5714a46c0ec8Sopenharmony_ci * @param device The device to configure 5715a46c0ec8Sopenharmony_ci * 5716a46c0ec8Sopenharmony_ci * @return The default button click method for this device 5717a46c0ec8Sopenharmony_ci * 5718a46c0ec8Sopenharmony_ci * @see libinput_device_config_click_get_methods 5719a46c0ec8Sopenharmony_ci * @see libinput_device_config_click_set_method 5720a46c0ec8Sopenharmony_ci * @see libinput_device_config_click_get_method 5721a46c0ec8Sopenharmony_ci */ 5722a46c0ec8Sopenharmony_cienum libinput_config_click_method 5723a46c0ec8Sopenharmony_cilibinput_device_config_click_get_default_method(struct libinput_device *device); 5724a46c0ec8Sopenharmony_ci 5725a46c0ec8Sopenharmony_ci/** 5726a46c0ec8Sopenharmony_ci * @ingroup config 5727a46c0ec8Sopenharmony_ci */ 5728a46c0ec8Sopenharmony_cienum libinput_config_middle_emulation_state { 5729a46c0ec8Sopenharmony_ci /** 5730a46c0ec8Sopenharmony_ci * Middle mouse button emulation is to be disabled, or 5731a46c0ec8Sopenharmony_ci * is currently disabled. 5732a46c0ec8Sopenharmony_ci */ 5733a46c0ec8Sopenharmony_ci LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED, 5734a46c0ec8Sopenharmony_ci /** 5735a46c0ec8Sopenharmony_ci * Middle mouse button emulation is to be enabled, or 5736a46c0ec8Sopenharmony_ci * is currently enabled. 5737a46c0ec8Sopenharmony_ci */ 5738a46c0ec8Sopenharmony_ci LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED, 5739a46c0ec8Sopenharmony_ci}; 5740a46c0ec8Sopenharmony_ci 5741a46c0ec8Sopenharmony_ci/** 5742a46c0ec8Sopenharmony_ci * @ingroup config 5743a46c0ec8Sopenharmony_ci * 5744a46c0ec8Sopenharmony_ci * Check if middle mouse button emulation configuration is available on this 5745a46c0ec8Sopenharmony_ci * device. See libinput_device_config_middle_emulation_set_enabled() for 5746a46c0ec8Sopenharmony_ci * more details. 5747a46c0ec8Sopenharmony_ci * 5748a46c0ec8Sopenharmony_ci * @note Some devices provide middle mouse button emulation but do not allow 5749a46c0ec8Sopenharmony_ci * enabling/disabling that emulation. These devices return zero in 5750a46c0ec8Sopenharmony_ci * libinput_device_config_middle_emulation_is_available(). 5751a46c0ec8Sopenharmony_ci * 5752a46c0ec8Sopenharmony_ci * @param device The device to query 5753a46c0ec8Sopenharmony_ci * 5754a46c0ec8Sopenharmony_ci * @return Non-zero if middle mouse button emulation is available and can be 5755a46c0ec8Sopenharmony_ci * configured, zero otherwise. 5756a46c0ec8Sopenharmony_ci * 5757a46c0ec8Sopenharmony_ci * @see libinput_device_config_middle_emulation_set_enabled 5758a46c0ec8Sopenharmony_ci * @see libinput_device_config_middle_emulation_get_enabled 5759a46c0ec8Sopenharmony_ci * @see libinput_device_config_middle_emulation_get_default_enabled 5760a46c0ec8Sopenharmony_ci */ 5761a46c0ec8Sopenharmony_ciint 5762a46c0ec8Sopenharmony_cilibinput_device_config_middle_emulation_is_available( 5763a46c0ec8Sopenharmony_ci struct libinput_device *device); 5764a46c0ec8Sopenharmony_ci 5765a46c0ec8Sopenharmony_ci/** 5766a46c0ec8Sopenharmony_ci * @ingroup config 5767a46c0ec8Sopenharmony_ci * 5768a46c0ec8Sopenharmony_ci * Enable or disable middle button emulation on this device. When enabled, a 5769a46c0ec8Sopenharmony_ci * simultaneous press of the left and right button generates a middle mouse 5770a46c0ec8Sopenharmony_ci * button event. Releasing the buttons generates a middle mouse button 5771a46c0ec8Sopenharmony_ci * release, the left and right button events are discarded otherwise. 5772a46c0ec8Sopenharmony_ci * 5773a46c0ec8Sopenharmony_ci * See the libinput documentation for more details. 5774a46c0ec8Sopenharmony_ci * 5775a46c0ec8Sopenharmony_ci * @param device The device to configure 5776a46c0ec8Sopenharmony_ci * @param enable @ref LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED to 5777a46c0ec8Sopenharmony_ci * disable, @ref LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED To enable 5778a46c0ec8Sopenharmony_ci * middle button emulation. 5779a46c0ec8Sopenharmony_ci * 5780a46c0ec8Sopenharmony_ci * @return A config status code. Disabling middle button emulation on a 5781a46c0ec8Sopenharmony_ci * device that does not support middle button emulation always succeeds. 5782a46c0ec8Sopenharmony_ci * 5783a46c0ec8Sopenharmony_ci * @see libinput_device_config_middle_emulation_is_available 5784a46c0ec8Sopenharmony_ci * @see libinput_device_config_middle_emulation_get_enabled 5785a46c0ec8Sopenharmony_ci * @see libinput_device_config_middle_emulation_get_default_enabled 5786a46c0ec8Sopenharmony_ci */ 5787a46c0ec8Sopenharmony_cienum libinput_config_status 5788a46c0ec8Sopenharmony_cilibinput_device_config_middle_emulation_set_enabled( 5789a46c0ec8Sopenharmony_ci struct libinput_device *device, 5790a46c0ec8Sopenharmony_ci enum libinput_config_middle_emulation_state enable); 5791a46c0ec8Sopenharmony_ci 5792a46c0ec8Sopenharmony_ci/** 5793a46c0ec8Sopenharmony_ci * @ingroup config 5794a46c0ec8Sopenharmony_ci * 5795a46c0ec8Sopenharmony_ci * Check if configurable middle button emulation is enabled on this device. 5796a46c0ec8Sopenharmony_ci * See libinput_device_config_middle_emulation_set_enabled() for more 5797a46c0ec8Sopenharmony_ci * details. 5798a46c0ec8Sopenharmony_ci * 5799a46c0ec8Sopenharmony_ci * If the device does not have configurable middle button emulation, this 5800a46c0ec8Sopenharmony_ci * function returns @ref LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED. 5801a46c0ec8Sopenharmony_ci * 5802a46c0ec8Sopenharmony_ci * @note Some devices provide middle mouse button emulation but do not allow 5803a46c0ec8Sopenharmony_ci * enabling/disabling that emulation. These devices always return @ref 5804a46c0ec8Sopenharmony_ci * LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED. 5805a46c0ec8Sopenharmony_ci * 5806a46c0ec8Sopenharmony_ci * @param device The device to configure 5807a46c0ec8Sopenharmony_ci * @return @ref LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED if disabled 5808a46c0ec8Sopenharmony_ci * or not available/configurable, @ref 5809a46c0ec8Sopenharmony_ci * LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED If enabled. 5810a46c0ec8Sopenharmony_ci * 5811a46c0ec8Sopenharmony_ci * @see libinput_device_config_middle_emulation_is_available 5812a46c0ec8Sopenharmony_ci * @see libinput_device_config_middle_emulation_set_enabled 5813a46c0ec8Sopenharmony_ci * @see libinput_device_config_middle_emulation_get_default_enabled 5814a46c0ec8Sopenharmony_ci */ 5815a46c0ec8Sopenharmony_cienum libinput_config_middle_emulation_state 5816a46c0ec8Sopenharmony_cilibinput_device_config_middle_emulation_get_enabled( 5817a46c0ec8Sopenharmony_ci struct libinput_device *device); 5818a46c0ec8Sopenharmony_ci 5819a46c0ec8Sopenharmony_ci/** 5820a46c0ec8Sopenharmony_ci * @ingroup config 5821a46c0ec8Sopenharmony_ci * 5822a46c0ec8Sopenharmony_ci * Check if configurable middle button emulation is enabled by default on 5823a46c0ec8Sopenharmony_ci * this device. See libinput_device_config_middle_emulation_set_enabled() 5824a46c0ec8Sopenharmony_ci * for more details. 5825a46c0ec8Sopenharmony_ci * 5826a46c0ec8Sopenharmony_ci * If the device does not have configurable middle button 5827a46c0ec8Sopenharmony_ci * emulation, this function returns @ref 5828a46c0ec8Sopenharmony_ci * LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED. 5829a46c0ec8Sopenharmony_ci * 5830a46c0ec8Sopenharmony_ci * @note Some devices provide middle mouse button emulation but do not allow 5831a46c0ec8Sopenharmony_ci * enabling/disabling that emulation. These devices always return @ref 5832a46c0ec8Sopenharmony_ci * LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED. 5833a46c0ec8Sopenharmony_ci * 5834a46c0ec8Sopenharmony_ci * @param device The device to configure 5835a46c0ec8Sopenharmony_ci * @return @ref LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED If disabled 5836a46c0ec8Sopenharmony_ci * or not available, @ref LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED if 5837a46c0ec8Sopenharmony_ci * enabled. 5838a46c0ec8Sopenharmony_ci * 5839a46c0ec8Sopenharmony_ci * @see libinput_device_config_middle_emulation_is_available 5840a46c0ec8Sopenharmony_ci * @see libinput_device_config_middle_emulation_set_enabled 5841a46c0ec8Sopenharmony_ci * @see libinput_device_config_middle_emulation_get_enabled 5842a46c0ec8Sopenharmony_ci */ 5843a46c0ec8Sopenharmony_cienum libinput_config_middle_emulation_state 5844a46c0ec8Sopenharmony_cilibinput_device_config_middle_emulation_get_default_enabled( 5845a46c0ec8Sopenharmony_ci struct libinput_device *device); 5846a46c0ec8Sopenharmony_ci 5847a46c0ec8Sopenharmony_ci/** 5848a46c0ec8Sopenharmony_ci * @ingroup config 5849a46c0ec8Sopenharmony_ci * 5850a46c0ec8Sopenharmony_ci * The scroll method of a device selects when to generate scroll axis events 5851a46c0ec8Sopenharmony_ci * instead of pointer motion events. 5852a46c0ec8Sopenharmony_ci */ 5853a46c0ec8Sopenharmony_cienum libinput_config_scroll_method { 5854a46c0ec8Sopenharmony_ci /** 5855a46c0ec8Sopenharmony_ci * Never send scroll events instead of pointer motion events. 5856a46c0ec8Sopenharmony_ci * This has no effect on events generated by scroll wheels. 5857a46c0ec8Sopenharmony_ci */ 5858a46c0ec8Sopenharmony_ci LIBINPUT_CONFIG_SCROLL_NO_SCROLL = 0, 5859a46c0ec8Sopenharmony_ci /** 5860a46c0ec8Sopenharmony_ci * Send scroll events when two fingers are logically down on the 5861a46c0ec8Sopenharmony_ci * device. 5862a46c0ec8Sopenharmony_ci */ 5863a46c0ec8Sopenharmony_ci LIBINPUT_CONFIG_SCROLL_2FG = (1 << 0), 5864a46c0ec8Sopenharmony_ci /** 5865a46c0ec8Sopenharmony_ci * Send scroll events when a finger moves along the bottom or 5866a46c0ec8Sopenharmony_ci * right edge of a device. 5867a46c0ec8Sopenharmony_ci */ 5868a46c0ec8Sopenharmony_ci LIBINPUT_CONFIG_SCROLL_EDGE = (1 << 1), 5869a46c0ec8Sopenharmony_ci /** 5870a46c0ec8Sopenharmony_ci * Send scroll events when a button is down and the device moves 5871a46c0ec8Sopenharmony_ci * along a scroll-capable axis. 5872a46c0ec8Sopenharmony_ci */ 5873a46c0ec8Sopenharmony_ci LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN = (1 << 2), 5874a46c0ec8Sopenharmony_ci}; 5875a46c0ec8Sopenharmony_ci 5876a46c0ec8Sopenharmony_ci/** 5877a46c0ec8Sopenharmony_ci * @ingroup config 5878a46c0ec8Sopenharmony_ci * 5879a46c0ec8Sopenharmony_ci * Check which scroll methods a device supports. The method defines when to 5880a46c0ec8Sopenharmony_ci * generate scroll axis events instead of pointer motion events. 5881a46c0ec8Sopenharmony_ci * 5882a46c0ec8Sopenharmony_ci * @param device The device to configure 5883a46c0ec8Sopenharmony_ci * 5884a46c0ec8Sopenharmony_ci * @return A bitmask of possible methods. 5885a46c0ec8Sopenharmony_ci * 5886a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_set_method 5887a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_method 5888a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_default_method 5889a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_set_button 5890a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_button 5891a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_default_button 5892a46c0ec8Sopenharmony_ci */ 5893a46c0ec8Sopenharmony_ciuint32_t 5894a46c0ec8Sopenharmony_cilibinput_device_config_scroll_get_methods(struct libinput_device *device); 5895a46c0ec8Sopenharmony_ci 5896a46c0ec8Sopenharmony_ci/** 5897a46c0ec8Sopenharmony_ci * @ingroup config 5898a46c0ec8Sopenharmony_ci * 5899a46c0ec8Sopenharmony_ci * Set the scroll method for this device. The method defines when to 5900a46c0ec8Sopenharmony_ci * generate scroll axis events instead of pointer motion events. 5901a46c0ec8Sopenharmony_ci * 5902a46c0ec8Sopenharmony_ci * @note Setting @ref LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN enables 5903a46c0ec8Sopenharmony_ci * the scroll method, but scrolling is only activated when the configured 5904a46c0ec8Sopenharmony_ci * button is held down. If no button is set, i.e. 5905a46c0ec8Sopenharmony_ci * libinput_device_config_scroll_get_button() returns 0, scrolling 5906a46c0ec8Sopenharmony_ci * cannot activate. 5907a46c0ec8Sopenharmony_ci * 5908a46c0ec8Sopenharmony_ci * @param device The device to configure 5909a46c0ec8Sopenharmony_ci * @param method The scroll method for this device. 5910a46c0ec8Sopenharmony_ci * 5911a46c0ec8Sopenharmony_ci * @return A config status code. 5912a46c0ec8Sopenharmony_ci * 5913a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_methods 5914a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_method 5915a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_default_method 5916a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_set_button 5917a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_button 5918a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_default_button 5919a46c0ec8Sopenharmony_ci */ 5920a46c0ec8Sopenharmony_cienum libinput_config_status 5921a46c0ec8Sopenharmony_cilibinput_device_config_scroll_set_method(struct libinput_device *device, 5922a46c0ec8Sopenharmony_ci enum libinput_config_scroll_method method); 5923a46c0ec8Sopenharmony_ci 5924a46c0ec8Sopenharmony_ci/** 5925a46c0ec8Sopenharmony_ci * @ingroup config 5926a46c0ec8Sopenharmony_ci * 5927a46c0ec8Sopenharmony_ci * Get the scroll method for this device. The method defines when to 5928a46c0ec8Sopenharmony_ci * generate scroll axis events instead of pointer motion events. 5929a46c0ec8Sopenharmony_ci * 5930a46c0ec8Sopenharmony_ci * @param device The device to configure 5931a46c0ec8Sopenharmony_ci * @return The current scroll method for this device. 5932a46c0ec8Sopenharmony_ci * 5933a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_methods 5934a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_set_method 5935a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_default_method 5936a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_set_button 5937a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_button 5938a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_default_button 5939a46c0ec8Sopenharmony_ci */ 5940a46c0ec8Sopenharmony_cienum libinput_config_scroll_method 5941a46c0ec8Sopenharmony_cilibinput_device_config_scroll_get_method(struct libinput_device *device); 5942a46c0ec8Sopenharmony_ci 5943a46c0ec8Sopenharmony_ci/** 5944a46c0ec8Sopenharmony_ci * @ingroup config 5945a46c0ec8Sopenharmony_ci * 5946a46c0ec8Sopenharmony_ci * Get the default scroll method for this device. The method defines when to 5947a46c0ec8Sopenharmony_ci * generate scroll axis events instead of pointer motion events. 5948a46c0ec8Sopenharmony_ci * 5949a46c0ec8Sopenharmony_ci * @param device The device to configure 5950a46c0ec8Sopenharmony_ci * @return The default scroll method for this device. 5951a46c0ec8Sopenharmony_ci * 5952a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_methods 5953a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_set_method 5954a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_method 5955a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_set_button 5956a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_button 5957a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_default_button 5958a46c0ec8Sopenharmony_ci */ 5959a46c0ec8Sopenharmony_cienum libinput_config_scroll_method 5960a46c0ec8Sopenharmony_cilibinput_device_config_scroll_get_default_method(struct libinput_device *device); 5961a46c0ec8Sopenharmony_ci 5962a46c0ec8Sopenharmony_ci/** 5963a46c0ec8Sopenharmony_ci * @ingroup config 5964a46c0ec8Sopenharmony_ci * 5965a46c0ec8Sopenharmony_ci * Set the button for the @ref LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN method 5966a46c0ec8Sopenharmony_ci * for this device. 5967a46c0ec8Sopenharmony_ci * 5968a46c0ec8Sopenharmony_ci * When the current scroll method is set to @ref 5969a46c0ec8Sopenharmony_ci * LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN, no button press/release events 5970a46c0ec8Sopenharmony_ci * will be send for the configured button. 5971a46c0ec8Sopenharmony_ci * 5972a46c0ec8Sopenharmony_ci * When the configured button is pressed, any motion events along a 5973a46c0ec8Sopenharmony_ci * scroll-capable axis are turned into scroll axis events. 5974a46c0ec8Sopenharmony_ci * 5975a46c0ec8Sopenharmony_ci * @note Setting the button does not change the scroll method. To change the 5976a46c0ec8Sopenharmony_ci * scroll method call libinput_device_config_scroll_set_method(). 5977a46c0ec8Sopenharmony_ci * 5978a46c0ec8Sopenharmony_ci * If the button is 0, button scrolling is effectively disabled. 5979a46c0ec8Sopenharmony_ci * 5980a46c0ec8Sopenharmony_ci * @param device The device to configure 5981a46c0ec8Sopenharmony_ci * @param button The button which when pressed switches to sending scroll events 5982a46c0ec8Sopenharmony_ci * 5983a46c0ec8Sopenharmony_ci * @return A config status code 5984a46c0ec8Sopenharmony_ci * @retval LIBINPUT_CONFIG_STATUS_SUCCESS On success 5985a46c0ec8Sopenharmony_ci * @retval LIBINPUT_CONFIG_STATUS_UNSUPPORTED If @ref 5986a46c0ec8Sopenharmony_ci * LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN is not supported 5987a46c0ec8Sopenharmony_ci * @retval LIBINPUT_CONFIG_STATUS_INVALID The given button does not 5988a46c0ec8Sopenharmony_ci * exist on this device 5989a46c0ec8Sopenharmony_ci * 5990a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_methods 5991a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_set_method 5992a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_method 5993a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_default_method 5994a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_button 5995a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_default_button 5996a46c0ec8Sopenharmony_ci */ 5997a46c0ec8Sopenharmony_cienum libinput_config_status 5998a46c0ec8Sopenharmony_cilibinput_device_config_scroll_set_button(struct libinput_device *device, 5999a46c0ec8Sopenharmony_ci uint32_t button); 6000a46c0ec8Sopenharmony_ci 6001a46c0ec8Sopenharmony_ci/** 6002a46c0ec8Sopenharmony_ci * @ingroup config 6003a46c0ec8Sopenharmony_ci * 6004a46c0ec8Sopenharmony_ci * Get the button for the @ref LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN method 6005a46c0ec8Sopenharmony_ci * for this device. 6006a46c0ec8Sopenharmony_ci * 6007a46c0ec8Sopenharmony_ci * If @ref LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN scroll method is not 6008a46c0ec8Sopenharmony_ci * supported, or no button is set, this function returns 0. 6009a46c0ec8Sopenharmony_ci * 6010a46c0ec8Sopenharmony_ci * @note The return value is independent of the currently selected 6011a46c0ec8Sopenharmony_ci * scroll-method. For button scrolling to activate, a device must have the 6012a46c0ec8Sopenharmony_ci * @ref LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN method enabled, and a non-zero 6013a46c0ec8Sopenharmony_ci * button set as scroll button. 6014a46c0ec8Sopenharmony_ci * 6015a46c0ec8Sopenharmony_ci * @param device The device to configure 6016a46c0ec8Sopenharmony_ci * @return The button which when pressed switches to sending scroll events 6017a46c0ec8Sopenharmony_ci * 6018a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_methods 6019a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_set_method 6020a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_method 6021a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_default_method 6022a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_set_button 6023a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_default_button 6024a46c0ec8Sopenharmony_ci */ 6025a46c0ec8Sopenharmony_ciuint32_t 6026a46c0ec8Sopenharmony_cilibinput_device_config_scroll_get_button(struct libinput_device *device); 6027a46c0ec8Sopenharmony_ci 6028a46c0ec8Sopenharmony_ci/** 6029a46c0ec8Sopenharmony_ci * @ingroup config 6030a46c0ec8Sopenharmony_ci * 6031a46c0ec8Sopenharmony_ci * Get the default button for the @ref LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN 6032a46c0ec8Sopenharmony_ci * method for this device. 6033a46c0ec8Sopenharmony_ci * 6034a46c0ec8Sopenharmony_ci * If @ref LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN scroll method is not supported, 6035a46c0ec8Sopenharmony_ci * or no default button is set, this function returns 0. 6036a46c0ec8Sopenharmony_ci * 6037a46c0ec8Sopenharmony_ci * @param device The device to configure 6038a46c0ec8Sopenharmony_ci * @return The default button for the @ref 6039a46c0ec8Sopenharmony_ci * LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN method 6040a46c0ec8Sopenharmony_ci * 6041a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_methods 6042a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_set_method 6043a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_method 6044a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_default_method 6045a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_set_button 6046a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_button 6047a46c0ec8Sopenharmony_ci */ 6048a46c0ec8Sopenharmony_ciuint32_t 6049a46c0ec8Sopenharmony_cilibinput_device_config_scroll_get_default_button(struct libinput_device *device); 6050a46c0ec8Sopenharmony_ci 6051a46c0ec8Sopenharmony_cienum libinput_config_scroll_button_lock_state { 6052a46c0ec8Sopenharmony_ci LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_DISABLED, 6053a46c0ec8Sopenharmony_ci LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_ENABLED, 6054a46c0ec8Sopenharmony_ci}; 6055a46c0ec8Sopenharmony_ci 6056a46c0ec8Sopenharmony_ci/** 6057a46c0ec8Sopenharmony_ci * @ingroup config 6058a46c0ec8Sopenharmony_ci * 6059a46c0ec8Sopenharmony_ci * Set the scroll button lock. If the state is 6060a46c0ec8Sopenharmony_ci * @ref LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_DISABLED, the button must 6061a46c0ec8Sopenharmony_ci * physically be held down for button scrolling to work. 6062a46c0ec8Sopenharmony_ci * If the state is 6063a46c0ec8Sopenharmony_ci * @ref LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_ENABLED, the button is considered 6064a46c0ec8Sopenharmony_ci * logically down after the first press and release sequence, and logically 6065a46c0ec8Sopenharmony_ci * up after the second press and release sequence. 6066a46c0ec8Sopenharmony_ci * 6067a46c0ec8Sopenharmony_ci * @param device The device to configure 6068a46c0ec8Sopenharmony_ci * @param state The state to set the scroll button lock to 6069a46c0ec8Sopenharmony_ci * 6070a46c0ec8Sopenharmony_ci * @return A config status code. Disabling the scroll button lock on 6071a46c0ec8Sopenharmony_ci * device that does not support button scrolling always succeeds. 6072a46c0ec8Sopenharmony_ci * 6073a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_set_button 6074a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_button 6075a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_default_button 6076a46c0ec8Sopenharmony_ci */ 6077a46c0ec8Sopenharmony_cienum libinput_config_status 6078a46c0ec8Sopenharmony_cilibinput_device_config_scroll_set_button_lock(struct libinput_device *device, 6079a46c0ec8Sopenharmony_ci enum libinput_config_scroll_button_lock_state state); 6080a46c0ec8Sopenharmony_ci 6081a46c0ec8Sopenharmony_ci/** 6082a46c0ec8Sopenharmony_ci * @ingroup config 6083a46c0ec8Sopenharmony_ci * 6084a46c0ec8Sopenharmony_ci * Get the current scroll button lock state. 6085a46c0ec8Sopenharmony_ci * 6086a46c0ec8Sopenharmony_ci * If @ref LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN scroll method is not 6087a46c0ec8Sopenharmony_ci * supported, or no button is set, this function returns @ref 6088a46c0ec8Sopenharmony_ci * LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_DISABLED. 6089a46c0ec8Sopenharmony_ci * 6090a46c0ec8Sopenharmony_ci * @note The return value is independent of the currently selected 6091a46c0ec8Sopenharmony_ci * scroll-method. For the scroll button lock to activate, a device must have 6092a46c0ec8Sopenharmony_ci * the @ref LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN method enabled, and a 6093a46c0ec8Sopenharmony_ci * non-zero button set as scroll button. 6094a46c0ec8Sopenharmony_ci * 6095a46c0ec8Sopenharmony_ci * @param device The device to configure 6096a46c0ec8Sopenharmony_ci * @return The scroll button lock state 6097a46c0ec8Sopenharmony_ci * 6098a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_set_button 6099a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_set_button_lock 6100a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_button_lock 6101a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_default_button_lock 6102a46c0ec8Sopenharmony_ci */ 6103a46c0ec8Sopenharmony_cienum libinput_config_scroll_button_lock_state 6104a46c0ec8Sopenharmony_cilibinput_device_config_scroll_get_button_lock(struct libinput_device *device); 6105a46c0ec8Sopenharmony_ci 6106a46c0ec8Sopenharmony_ci/** 6107a46c0ec8Sopenharmony_ci * @ingroup config 6108a46c0ec8Sopenharmony_ci * 6109a46c0ec8Sopenharmony_ci * Get the default scroll button lock state. 6110a46c0ec8Sopenharmony_ci * 6111a46c0ec8Sopenharmony_ci * If @ref LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN scroll method is not 6112a46c0ec8Sopenharmony_ci * supported, or no button is set, this function returns @ref 6113a46c0ec8Sopenharmony_ci * LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_DISABLED. 6114a46c0ec8Sopenharmony_ci * 6115a46c0ec8Sopenharmony_ci * @param device The device to configure 6116a46c0ec8Sopenharmony_ci * @return The default scroll button lock state 6117a46c0ec8Sopenharmony_ci * 6118a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_set_button 6119a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_set_button_lock 6120a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_button_lock 6121a46c0ec8Sopenharmony_ci * @see libinput_device_config_scroll_get_default_button_lock 6122a46c0ec8Sopenharmony_ci */ 6123a46c0ec8Sopenharmony_cienum libinput_config_scroll_button_lock_state 6124a46c0ec8Sopenharmony_cilibinput_device_config_scroll_get_default_button_lock(struct libinput_device *device); 6125a46c0ec8Sopenharmony_ci 6126a46c0ec8Sopenharmony_ci/** 6127a46c0ec8Sopenharmony_ci * @ingroup config 6128a46c0ec8Sopenharmony_ci * 6129a46c0ec8Sopenharmony_ci * Possible states for the disable-while-typing feature. 6130a46c0ec8Sopenharmony_ci */ 6131a46c0ec8Sopenharmony_cienum libinput_config_dwt_state { 6132a46c0ec8Sopenharmony_ci LIBINPUT_CONFIG_DWT_DISABLED, 6133a46c0ec8Sopenharmony_ci LIBINPUT_CONFIG_DWT_ENABLED, 6134a46c0ec8Sopenharmony_ci}; 6135a46c0ec8Sopenharmony_ci 6136a46c0ec8Sopenharmony_ci/** 6137a46c0ec8Sopenharmony_ci * @ingroup config 6138a46c0ec8Sopenharmony_ci * 6139a46c0ec8Sopenharmony_ci * Check if this device supports configurable disable-while-typing feature. 6140a46c0ec8Sopenharmony_ci * This feature is usually available on built-in touchpads and disables the 6141a46c0ec8Sopenharmony_ci * touchpad while typing. See the libinput documentation for details. 6142a46c0ec8Sopenharmony_ci * 6143a46c0ec8Sopenharmony_ci * @param device The device to configure 6144a46c0ec8Sopenharmony_ci * @return 0 if this device does not support disable-while-typing, or 1 6145a46c0ec8Sopenharmony_ci * otherwise. 6146a46c0ec8Sopenharmony_ci * 6147a46c0ec8Sopenharmony_ci * @see libinput_device_config_dwt_set_enabled 6148a46c0ec8Sopenharmony_ci * @see libinput_device_config_dwt_get_enabled 6149a46c0ec8Sopenharmony_ci * @see libinput_device_config_dwt_get_default_enabled 6150a46c0ec8Sopenharmony_ci */ 6151a46c0ec8Sopenharmony_ciint 6152a46c0ec8Sopenharmony_cilibinput_device_config_dwt_is_available(struct libinput_device *device); 6153a46c0ec8Sopenharmony_ci 6154a46c0ec8Sopenharmony_ci/** 6155a46c0ec8Sopenharmony_ci * @ingroup config 6156a46c0ec8Sopenharmony_ci * 6157a46c0ec8Sopenharmony_ci * Enable or disable the disable-while-typing feature. When enabled, the 6158a46c0ec8Sopenharmony_ci * device will be disabled while typing and for a short period after. See 6159a46c0ec8Sopenharmony_ci * the libinput documentation for details. 6160a46c0ec8Sopenharmony_ci * 6161a46c0ec8Sopenharmony_ci * @note Enabling or disabling disable-while-typing may not take effect 6162a46c0ec8Sopenharmony_ci * immediately. 6163a46c0ec8Sopenharmony_ci * 6164a46c0ec8Sopenharmony_ci * @param device The device to configure 6165a46c0ec8Sopenharmony_ci * @param enable @ref LIBINPUT_CONFIG_DWT_DISABLED to disable 6166a46c0ec8Sopenharmony_ci * disable-while-typing, @ref LIBINPUT_CONFIG_DWT_ENABLED to enable 6167a46c0ec8Sopenharmony_ci * 6168a46c0ec8Sopenharmony_ci * @return A config status code. Disabling disable-while-typing on a 6169a46c0ec8Sopenharmony_ci * device that does not support the feature always succeeds. 6170a46c0ec8Sopenharmony_ci * 6171a46c0ec8Sopenharmony_ci * @see libinput_device_config_dwt_is_available 6172a46c0ec8Sopenharmony_ci * @see libinput_device_config_dwt_get_enabled 6173a46c0ec8Sopenharmony_ci * @see libinput_device_config_dwt_get_default_enabled 6174a46c0ec8Sopenharmony_ci */ 6175a46c0ec8Sopenharmony_cienum libinput_config_status 6176a46c0ec8Sopenharmony_cilibinput_device_config_dwt_set_enabled(struct libinput_device *device, 6177a46c0ec8Sopenharmony_ci enum libinput_config_dwt_state enable); 6178a46c0ec8Sopenharmony_ci 6179a46c0ec8Sopenharmony_ci/** 6180a46c0ec8Sopenharmony_ci * @ingroup config 6181a46c0ec8Sopenharmony_ci * 6182a46c0ec8Sopenharmony_ci * Check if the disable-while typing feature is currently enabled on this 6183a46c0ec8Sopenharmony_ci * device. If the device does not support disable-while-typing, this 6184a46c0ec8Sopenharmony_ci * function returns @ref LIBINPUT_CONFIG_DWT_DISABLED. 6185a46c0ec8Sopenharmony_ci * 6186a46c0ec8Sopenharmony_ci * @param device The device to configure 6187a46c0ec8Sopenharmony_ci * @return @ref LIBINPUT_CONFIG_DWT_DISABLED if disabled, @ref 6188a46c0ec8Sopenharmony_ci * LIBINPUT_CONFIG_DWT_ENABLED if enabled. 6189a46c0ec8Sopenharmony_ci * 6190a46c0ec8Sopenharmony_ci * @see libinput_device_config_dwt_is_available 6191a46c0ec8Sopenharmony_ci * @see libinput_device_config_dwt_set_enabled 6192a46c0ec8Sopenharmony_ci * @see libinput_device_config_dwt_get_default_enabled 6193a46c0ec8Sopenharmony_ci */ 6194a46c0ec8Sopenharmony_cienum libinput_config_dwt_state 6195a46c0ec8Sopenharmony_cilibinput_device_config_dwt_get_enabled(struct libinput_device *device); 6196a46c0ec8Sopenharmony_ci 6197a46c0ec8Sopenharmony_ci/** 6198a46c0ec8Sopenharmony_ci * @ingroup config 6199a46c0ec8Sopenharmony_ci * 6200a46c0ec8Sopenharmony_ci * Check if the disable-while typing feature is enabled on this device by 6201a46c0ec8Sopenharmony_ci * default. If the device does not support disable-while-typing, this 6202a46c0ec8Sopenharmony_ci * function returns @ref LIBINPUT_CONFIG_DWT_DISABLED. 6203a46c0ec8Sopenharmony_ci * 6204a46c0ec8Sopenharmony_ci * @param device The device to configure 6205a46c0ec8Sopenharmony_ci * @return @ref LIBINPUT_CONFIG_DWT_DISABLED if disabled, @ref 6206a46c0ec8Sopenharmony_ci * LIBINPUT_CONFIG_DWT_ENABLED if enabled. 6207a46c0ec8Sopenharmony_ci * 6208a46c0ec8Sopenharmony_ci * @see libinput_device_config_dwt_is_available 6209a46c0ec8Sopenharmony_ci * @see libinput_device_config_dwt_set_enabled 6210a46c0ec8Sopenharmony_ci * @see libinput_device_config_dwt_get_enabled 6211a46c0ec8Sopenharmony_ci */ 6212a46c0ec8Sopenharmony_cienum libinput_config_dwt_state 6213a46c0ec8Sopenharmony_cilibinput_device_config_dwt_get_default_enabled(struct libinput_device *device); 6214a46c0ec8Sopenharmony_ci 6215a46c0ec8Sopenharmony_ci/** 6216a46c0ec8Sopenharmony_ci * @ingroup config 6217a46c0ec8Sopenharmony_ci * 6218a46c0ec8Sopenharmony_ci * Possible states for the disable-while-trackpointing feature. 6219a46c0ec8Sopenharmony_ci * 6220a46c0ec8Sopenharmony_ci * @since 1.21 6221a46c0ec8Sopenharmony_ci */ 6222a46c0ec8Sopenharmony_cienum libinput_config_dwtp_state { 6223a46c0ec8Sopenharmony_ci LIBINPUT_CONFIG_DWTP_DISABLED, 6224a46c0ec8Sopenharmony_ci LIBINPUT_CONFIG_DWTP_ENABLED, 6225a46c0ec8Sopenharmony_ci}; 6226a46c0ec8Sopenharmony_ci 6227a46c0ec8Sopenharmony_ci/** 6228a46c0ec8Sopenharmony_ci * @ingroup config 6229a46c0ec8Sopenharmony_ci * 6230a46c0ec8Sopenharmony_ci * Check if this device supports configurable disable-while-trackpointing 6231a46c0ec8Sopenharmony_ci * feature. This feature is usually available on Thinkpads and disables the 6232a46c0ec8Sopenharmony_ci * touchpad while using the trackpoint. See the libinput documentation for 6233a46c0ec8Sopenharmony_ci * details. 6234a46c0ec8Sopenharmony_ci * 6235a46c0ec8Sopenharmony_ci * @param device The device to configure 6236a46c0ec8Sopenharmony_ci * @return 0 if this device does not support disable-while-trackpointing, or 1 6237a46c0ec8Sopenharmony_ci * otherwise. 6238a46c0ec8Sopenharmony_ci * 6239a46c0ec8Sopenharmony_ci * @see libinput_device_config_dwtp_set_enabled 6240a46c0ec8Sopenharmony_ci * @see libinput_device_config_dwtp_get_enabled 6241a46c0ec8Sopenharmony_ci * @see libinput_device_config_dwtp_get_default_enabled 6242a46c0ec8Sopenharmony_ci * 6243a46c0ec8Sopenharmony_ci * @since 1.21 6244a46c0ec8Sopenharmony_ci */ 6245a46c0ec8Sopenharmony_ciint 6246a46c0ec8Sopenharmony_cilibinput_device_config_dwtp_is_available(struct libinput_device *device); 6247a46c0ec8Sopenharmony_ci 6248a46c0ec8Sopenharmony_ci/** 6249a46c0ec8Sopenharmony_ci * @ingroup config 6250a46c0ec8Sopenharmony_ci * 6251a46c0ec8Sopenharmony_ci * Enable or disable the disable-while-trackpointing feature. When enabled, the 6252a46c0ec8Sopenharmony_ci * device will be disabled while using the trackpoint and for a short period 6253a46c0ec8Sopenharmony_ci * after. See the libinput documentation for details. 6254a46c0ec8Sopenharmony_ci * 6255a46c0ec8Sopenharmony_ci * @note Enabling or disabling disable-while-trackpointing may not take effect 6256a46c0ec8Sopenharmony_ci * immediately. 6257a46c0ec8Sopenharmony_ci * 6258a46c0ec8Sopenharmony_ci * @param device The device to configure 6259a46c0ec8Sopenharmony_ci * @param enable @ref LIBINPUT_CONFIG_DWTP_DISABLED to disable 6260a46c0ec8Sopenharmony_ci * disable-while-trackpointing, @ref LIBINPUT_CONFIG_DWTP_ENABLED to enable 6261a46c0ec8Sopenharmony_ci * 6262a46c0ec8Sopenharmony_ci * @return A config status code. Disabling disable-while-trackpointing on a 6263a46c0ec8Sopenharmony_ci * device that does not support the feature always succeeds. 6264a46c0ec8Sopenharmony_ci * 6265a46c0ec8Sopenharmony_ci * @see libinput_device_config_dwtp_is_available 6266a46c0ec8Sopenharmony_ci * @see libinput_device_config_dwtp_get_enabled 6267a46c0ec8Sopenharmony_ci * @see libinput_device_config_dwtp_get_default_enabled 6268a46c0ec8Sopenharmony_ci * 6269a46c0ec8Sopenharmony_ci * @since 1.21 6270a46c0ec8Sopenharmony_ci */ 6271a46c0ec8Sopenharmony_cienum libinput_config_status 6272a46c0ec8Sopenharmony_cilibinput_device_config_dwtp_set_enabled(struct libinput_device *device, 6273a46c0ec8Sopenharmony_ci enum libinput_config_dwtp_state enable); 6274a46c0ec8Sopenharmony_ci 6275a46c0ec8Sopenharmony_ci/** 6276a46c0ec8Sopenharmony_ci * @ingroup config 6277a46c0ec8Sopenharmony_ci * 6278a46c0ec8Sopenharmony_ci * Check if the disable-while trackpointing feature is currently enabled on 6279a46c0ec8Sopenharmony_ci * this device. If the device does not support disable-while-trackpointing, 6280a46c0ec8Sopenharmony_ci * this function returns @ref LIBINPUT_CONFIG_DWTP_DISABLED. 6281a46c0ec8Sopenharmony_ci * 6282a46c0ec8Sopenharmony_ci * @param device The device to configure 6283a46c0ec8Sopenharmony_ci * @return @ref LIBINPUT_CONFIG_DWTP_DISABLED if disabled, @ref 6284a46c0ec8Sopenharmony_ci * LIBINPUT_CONFIG_DWTP_ENABLED if enabled. 6285a46c0ec8Sopenharmony_ci * 6286a46c0ec8Sopenharmony_ci * @see libinput_device_config_dwtp_is_available 6287a46c0ec8Sopenharmony_ci * @see libinput_device_config_dwtp_set_enabled 6288a46c0ec8Sopenharmony_ci * @see libinput_device_config_dwtp_get_default_enabled 6289a46c0ec8Sopenharmony_ci * 6290a46c0ec8Sopenharmony_ci * @since 1.21 6291a46c0ec8Sopenharmony_ci */ 6292a46c0ec8Sopenharmony_cienum libinput_config_dwtp_state 6293a46c0ec8Sopenharmony_cilibinput_device_config_dwtp_get_enabled(struct libinput_device *device); 6294a46c0ec8Sopenharmony_ci 6295a46c0ec8Sopenharmony_ci/** 6296a46c0ec8Sopenharmony_ci * @ingroup config 6297a46c0ec8Sopenharmony_ci * 6298a46c0ec8Sopenharmony_ci * Check if the disable-while trackpointing feature is enabled on this device 6299a46c0ec8Sopenharmony_ci * by default. If the device does not support disable-while-trackpointing, this 6300a46c0ec8Sopenharmony_ci * function returns @ref LIBINPUT_CONFIG_DWTP_DISABLED. 6301a46c0ec8Sopenharmony_ci * 6302a46c0ec8Sopenharmony_ci * @param device The device to configure 6303a46c0ec8Sopenharmony_ci * @return @ref LIBINPUT_CONFIG_DWTP_DISABLED if disabled, @ref 6304a46c0ec8Sopenharmony_ci * LIBINPUT_CONFIG_DWTP_ENABLED if enabled. 6305a46c0ec8Sopenharmony_ci * 6306a46c0ec8Sopenharmony_ci * @see libinput_device_config_dwtp_is_available 6307a46c0ec8Sopenharmony_ci * @see libinput_device_config_dwtp_set_enabled 6308a46c0ec8Sopenharmony_ci * @see libinput_device_config_dwtp_get_enabled 6309a46c0ec8Sopenharmony_ci * 6310a46c0ec8Sopenharmony_ci * @since 1.21 6311a46c0ec8Sopenharmony_ci */ 6312a46c0ec8Sopenharmony_cienum libinput_config_dwtp_state 6313a46c0ec8Sopenharmony_cilibinput_device_config_dwtp_get_default_enabled(struct libinput_device *device); 6314a46c0ec8Sopenharmony_ci 6315a46c0ec8Sopenharmony_ci/** 6316a46c0ec8Sopenharmony_ci * @ingroup config 6317a46c0ec8Sopenharmony_ci * 6318a46c0ec8Sopenharmony_ci * Check whether a device can have a custom rotation applied. 6319a46c0ec8Sopenharmony_ci * 6320a46c0ec8Sopenharmony_ci * @param device The device to configure 6321a46c0ec8Sopenharmony_ci * @return Non-zero if a device can be rotated, zero otherwise. 6322a46c0ec8Sopenharmony_ci * 6323a46c0ec8Sopenharmony_ci * @see libinput_device_config_rotation_set_angle 6324a46c0ec8Sopenharmony_ci * @see libinput_device_config_rotation_get_angle 6325a46c0ec8Sopenharmony_ci * @see libinput_device_config_rotation_get_default_angle 6326a46c0ec8Sopenharmony_ci * 6327a46c0ec8Sopenharmony_ci * @since 1.4 6328a46c0ec8Sopenharmony_ci */ 6329a46c0ec8Sopenharmony_ciint 6330a46c0ec8Sopenharmony_cilibinput_device_config_rotation_is_available(struct libinput_device *device); 6331a46c0ec8Sopenharmony_ci 6332a46c0ec8Sopenharmony_ci/** 6333a46c0ec8Sopenharmony_ci * @ingroup config 6334a46c0ec8Sopenharmony_ci * 6335a46c0ec8Sopenharmony_ci * Set the rotation of a device in degrees clockwise off the logical neutral 6336a46c0ec8Sopenharmony_ci * position. Any subsequent motion events are adjusted according to the 6337a46c0ec8Sopenharmony_ci * given angle. 6338a46c0ec8Sopenharmony_ci * 6339a46c0ec8Sopenharmony_ci * The angle has to be in the range of [0, 360[ degrees, otherwise this 6340a46c0ec8Sopenharmony_ci * function returns LIBINPUT_CONFIG_STATUS_INVALID. If the angle is a 6341a46c0ec8Sopenharmony_ci * multiple of 360 or negative, the caller must ensure the correct ranging 6342a46c0ec8Sopenharmony_ci * before calling this function. 6343a46c0ec8Sopenharmony_ci * 6344a46c0ec8Sopenharmony_ci * The rotation angle is applied to all motion events emitted by the device. 6345a46c0ec8Sopenharmony_ci * Thus, rotating the device also changes the angle required or presented by 6346a46c0ec8Sopenharmony_ci * scrolling, gestures, etc. 6347a46c0ec8Sopenharmony_ci * 6348a46c0ec8Sopenharmony_ci * @param device The device to configure 6349a46c0ec8Sopenharmony_ci * @param degrees_cw The angle in degrees clockwise 6350a46c0ec8Sopenharmony_ci * @return A config status code. Setting a rotation of 0 degrees on a 6351a46c0ec8Sopenharmony_ci * device that does not support rotation always succeeds. 6352a46c0ec8Sopenharmony_ci * 6353a46c0ec8Sopenharmony_ci * @see libinput_device_config_rotation_is_available 6354a46c0ec8Sopenharmony_ci * @see libinput_device_config_rotation_get_angle 6355a46c0ec8Sopenharmony_ci * @see libinput_device_config_rotation_get_default_angle 6356a46c0ec8Sopenharmony_ci * 6357a46c0ec8Sopenharmony_ci * @since 1.4 6358a46c0ec8Sopenharmony_ci */ 6359a46c0ec8Sopenharmony_cienum libinput_config_status 6360a46c0ec8Sopenharmony_cilibinput_device_config_rotation_set_angle(struct libinput_device *device, 6361a46c0ec8Sopenharmony_ci unsigned int degrees_cw); 6362a46c0ec8Sopenharmony_ci 6363a46c0ec8Sopenharmony_ci/** 6364a46c0ec8Sopenharmony_ci * @ingroup config 6365a46c0ec8Sopenharmony_ci * 6366a46c0ec8Sopenharmony_ci * Get the current rotation of a device in degrees clockwise off the logical 6367a46c0ec8Sopenharmony_ci * neutral position. If this device does not support rotation, the return 6368a46c0ec8Sopenharmony_ci * value is always 0. 6369a46c0ec8Sopenharmony_ci * 6370a46c0ec8Sopenharmony_ci * @param device The device to configure 6371a46c0ec8Sopenharmony_ci * @return The angle in degrees clockwise 6372a46c0ec8Sopenharmony_ci * 6373a46c0ec8Sopenharmony_ci * @see libinput_device_config_rotation_is_available 6374a46c0ec8Sopenharmony_ci * @see libinput_device_config_rotation_set_angle 6375a46c0ec8Sopenharmony_ci * @see libinput_device_config_rotation_get_default_angle 6376a46c0ec8Sopenharmony_ci * 6377a46c0ec8Sopenharmony_ci * @since 1.4 6378a46c0ec8Sopenharmony_ci */ 6379a46c0ec8Sopenharmony_ciunsigned int 6380a46c0ec8Sopenharmony_cilibinput_device_config_rotation_get_angle(struct libinput_device *device); 6381a46c0ec8Sopenharmony_ci 6382a46c0ec8Sopenharmony_ci/** 6383a46c0ec8Sopenharmony_ci * @ingroup config 6384a46c0ec8Sopenharmony_ci * 6385a46c0ec8Sopenharmony_ci * Get the default rotation of a device in degrees clockwise off the logical 6386a46c0ec8Sopenharmony_ci * neutral position. If this device does not support rotation, the return 6387a46c0ec8Sopenharmony_ci * value is always 0. 6388a46c0ec8Sopenharmony_ci * 6389a46c0ec8Sopenharmony_ci * @param device The device to configure 6390a46c0ec8Sopenharmony_ci * @return The default angle in degrees clockwise 6391a46c0ec8Sopenharmony_ci * 6392a46c0ec8Sopenharmony_ci * @see libinput_device_config_rotation_is_available 6393a46c0ec8Sopenharmony_ci * @see libinput_device_config_rotation_set_angle 6394a46c0ec8Sopenharmony_ci * @see libinput_device_config_rotation_get_angle 6395a46c0ec8Sopenharmony_ci * 6396a46c0ec8Sopenharmony_ci * @since 1.4 6397a46c0ec8Sopenharmony_ci */ 6398a46c0ec8Sopenharmony_ciunsigned int 6399a46c0ec8Sopenharmony_cilibinput_device_config_rotation_get_default_angle(struct libinput_device *device); 6400a46c0ec8Sopenharmony_ci 6401a46c0ec8Sopenharmony_ci#ifdef __cplusplus 6402a46c0ec8Sopenharmony_ci} 6403a46c0ec8Sopenharmony_ci#endif 6404a46c0ec8Sopenharmony_ci#endif /* LIBINPUT_H */ 6405