|
libei 1.6.0
A library for Emulated Input
|
The sender client API is available only to clients created with ei_new_sender(). More...
Functions | |
| void | ei_device_start_emulating (struct ei_device *device, uint32_t sequence) |
| Notify the EIS implementation that the given device is about to start sending events. | |
| void | ei_device_stop_emulating (struct ei_device *device) |
| Notify the EIS implementation that the given device is no longer sending events. | |
| void | ei_device_frame (struct ei_device *device, uint64_t time) |
| Generate a frame event to group the current set of events into a logical hardware event. | |
| void | ei_device_pointer_motion (struct ei_device *device, double x, double y) |
| Generate a relative motion event on a device with the EI_DEVICE_CAP_POINTER capability. | |
| void | ei_device_pointer_motion_absolute (struct ei_device *device, double x, double y) |
| Generate an absolute motion event on a device with the EI_DEVICE_CAP_POINTER_ABSOLUTE capability. | |
| void | ei_device_button_button (struct ei_device *device, uint32_t button, bool is_press) |
| Generate a button event on a device with the EI_DEVICE_CAP_BUTTON capability. | |
| void | ei_device_scroll_delta (struct ei_device *device, double x, double y) |
| Generate a smooth (pixel-precise) scroll event on a device with the EI_DEVICE_CAP_SCROLL capability. | |
| void | ei_device_scroll_discrete (struct ei_device *device, int32_t x, int32_t y) |
| Generate a discrete scroll event on a device with the EI_DEVICE_CAP_SCROLL capability. | |
| void | ei_device_scroll_stop (struct ei_device *device, bool stop_x, bool stop_y) |
| Generate a scroll stop event on a device with the EI_DEVICE_CAP_SCROLL capability. | |
| void | ei_device_scroll_cancel (struct ei_device *device, bool cancel_x, bool cancel_y) |
| Generate a scroll cancel event on a device with the EI_DEVICE_CAP_SCROLL capability. | |
| void | ei_device_keyboard_key (struct ei_device *device, uint32_t keycode, bool is_press) |
| Generate a key event on a device with the EI_DEVICE_CAP_KEYBOARD capability. | |
| void | ei_device_text_keysym (struct ei_device *device, uint32_t keysym, bool is_press) |
| Generate a key event on a device with the EI_DEVICE_CAP_TEXT capability. | |
| void | ei_device_text_utf8 (struct ei_device *device, const char *utf8) |
| Generate a UTF-8 text event on a device with the EI_DEVICE_CAP_TEXT capability. | |
| void | ei_device_text_utf8_with_length (struct ei_device *device, const char *text, size_t length) |
| Generate a UTF-8 text event on a device with the EI_DEVICE_CAP_TEXT capability. | |
| struct ei_touch * | ei_device_touch_new (struct ei_device *device) |
| Initiate a new touch on a device with the EI_DEVICE_CAP_TOUCH capability. | |
| void | ei_touch_down (struct ei_touch *touch, double x, double y) |
| This function can only be called once on an ei_touch object. | |
| void | ei_touch_motion (struct ei_touch *touch, double x, double y) |
| Move this touch to the new coordinates. | |
| void | ei_touch_up (struct ei_touch *touch) |
| Release this touch. | |
| void | ei_touch_cancel (struct ei_touch *touch) |
| Cancel this touch. | |
| struct ei_touch * | ei_touch_ref (struct ei_touch *touch) |
| Increase the refcount of this struct by one. | |
| struct ei_touch * | ei_touch_unref (struct ei_touch *touch) |
| Decrease the refcount of this struct by one. | |
| void | ei_touch_set_user_data (struct ei_touch *touch, void *user_data) |
| Set a custom data pointer for this context. | |
| void * | ei_touch_get_user_data (struct ei_touch *touch) |
| Return the custom data pointer for this context. | |
| struct ei_device * | ei_touch_get_device (struct ei_touch *touch) |
| void | ei_device_swipe_begin (struct ei_device *device, uint32_t nfingers) |
| Begin a new swipe gesture on a device with the EI_DEVICE_CAP_GESTURES capability. | |
| void | ei_device_swipe_update (struct ei_device *device, double dx, double dy) |
| Update the current swipe gesture's position by the given relative delta. | |
| void | ei_device_swipe_end (struct ei_device *device) |
| End the current swipe gesture. | |
| void | ei_device_swipe_cancel (struct ei_device *device) |
| Cancel the current swipe gesture. | |
| void | ei_device_pinch_begin (struct ei_device *device, uint32_t nfingers) |
| Begin a new pinch gesture on a device with the EI_DEVICE_CAP_GESTURES capability. | |
| void | ei_device_pinch_update (struct ei_device *device, double dx, double dy, double scale, double rotation) |
| Update the current pinch gesture's position by the given relative delta, with the given absolute scale and relative rotation. | |
| void | ei_device_pinch_end (struct ei_device *device) |
| End the current pinch gesture. | |
| void | ei_device_pinch_cancel (struct ei_device *device) |
| Cancel the current pinch gesture. | |
| void | ei_device_hold_begin (struct ei_device *device, uint32_t nfingers) |
| Begin a new hold gesture on a device with the EI_DEVICE_CAP_GESTURES capability. | |
| void | ei_device_hold_end (struct ei_device *device) |
| End the current hold gesture. | |
| void | ei_device_hold_cancel (struct ei_device *device) |
| Cancel the current hold gesture. | |
| void | ei_event_device_bind_stylus_capability (struct ei_event *event, enum ei_stylus_capability capability) |
| Bind to the given stylus capability for the device associated with this EI_EVENT_DEVICE_ADDED event. | |
| void | ei_device_stylus_proximity_in (struct ei_device *device) |
| Notify the server that the stylus has entered proximity of its digitizer. | |
| void | ei_device_stylus_proximity_out (struct ei_device *device) |
| Notify the server that the stylus has left proximity of its digitizer. | |
| void | ei_device_stylus_erase_start (struct ei_device *device) |
| Notify the server that the stylus's eraser feature has been activated. | |
| void | ei_device_stylus_erase_stop (struct ei_device *device) |
| Notify the server that the stylus's eraser feature has been deactivated. | |
| void | ei_device_stylus_tip_down (struct ei_device *device) |
| Notify the server that the stylus has come into logical contact with its digitizer. | |
| void | ei_device_stylus_tip_up (struct ei_device *device) |
| Notify the server that the stylus has left logical contact with its digitizer. | |
| void | ei_device_stylus_motion (struct ei_device *device, double x, double y) |
| Notify the server that the stylus has moved to the given absolute position. | |
| void | ei_device_stylus_pressure (struct ei_device *device, double pressure) |
| Notify the server of the stylus pressure as a normalized value in the range [0.0, 1.0] where 0.0 is no pressure and 1.0 is maximum pressure. | |
| void | ei_device_stylus_distance (struct ei_device *device, double distance) |
| Notify the server of the distance between the stylus and its digitizer as a normalized value in the range [0.0, 1.0] where 0.0 is physical contact and 1.0 is maximum distance. | |
| void | ei_device_stylus_tilt (struct ei_device *device, double tilt_x, double tilt_y) |
| Notify the server of the stylus tilt angles in degrees. | |
| void | ei_device_stylus_rotation (struct ei_device *device, double rotation) |
| Notify the server of the stylus barrel rotation angle in degrees. | |
| void | ei_device_stylus_airbrush_flow (struct ei_device *device, double flow) |
| Notify the server of the airbrush flow control position as a normalized value in the range [0.0, 1.0] where 0.0 is fully off and 1.0 is fully on. | |
| bool | ei_event_device_has_stylus_capability (struct ei_event *event, enum ei_stylus_capability capability) |
| Return true if the device associated with this EI_EVENT_DEVICE_ADDED event has the given stylus capability. | |
The sender client API is available only to clients created with ei_new_sender().
For those clients the EIS implementation creates devices but it is the libei client that sends events to EIS implementation. The primary use-case is input emulation from a client, akin to xdotool.
It is a client bug to call any of these functions for a client created with ei_new_receiver().
| void ei_device_button_button | ( | struct ei_device * | device, |
| uint32_t | button, | ||
| bool | is_press ) |
Generate a button event on a device with the EI_DEVICE_CAP_BUTTON capability.
Button codes must match the defines in linux/input-event-codes.h
This method is only available on an ei sender context.
| device | The EI device |
| button | The button code |
| is_press | true for button press, false for button release |
| void ei_device_frame | ( | struct ei_device * | device, |
| uint64_t | time ) |
Generate a frame event to group the current set of events into a logical hardware event.
This function must be called after any other event has been generated.
The given timestamp applies to all events in the current frame. The timestamp must be in microseconds of CLOCK_MONOTONIC, use the return value of ei_now() to get a compatible timestamp.
This method is only available on an ei sender context.
| void ei_device_hold_begin | ( | struct ei_device * | device, |
| uint32_t | nfingers ) |
Begin a new hold gesture on a device with the EI_DEVICE_CAP_GESTURES capability.
Only one hold gesture may be active at a time.
This method is only available on an ei sender context.
| device | A device with EI_DEVICE_CAP_GESTURES capability |
| nfingers | The number of fingers, must be between 1 and 5 (inclusive) |
| void ei_device_hold_cancel | ( | struct ei_device * | device | ) |
Cancel the current hold gesture.
| void ei_device_hold_end | ( | struct ei_device * | device | ) |
End the current hold gesture.
| void ei_device_keyboard_key | ( | struct ei_device * | device, |
| uint32_t | keycode, | ||
| bool | is_press ) |
Generate a key event on a device with the EI_DEVICE_CAP_KEYBOARD capability.
Keys use the evdev scan codes as defined in linux/input-event-codes.h.
Note that this is a keymap-independent key code, equivalent to the scancode a physical keyboard would produce. To generate a specific key symbol, a client must look at the keymap returned by ei_device_keyboard_get_keymap() and generate the appropriate keycodes.
This method is only available on an ei sender context.
| device | The EI device |
| keycode | The key code |
| is_press | true for key down, false for key up |
| void ei_device_pinch_begin | ( | struct ei_device * | device, |
| uint32_t | nfingers ) |
Begin a new pinch gesture on a device with the EI_DEVICE_CAP_GESTURES capability.
Only one pinch gesture may be active at a time.
This method is only available on an ei sender context.
| device | A device with EI_DEVICE_CAP_GESTURES capability |
| nfingers | The number of fingers, must be between 2 and 5 (inclusive) |
| void ei_device_pinch_cancel | ( | struct ei_device * | device | ) |
Cancel the current pinch gesture.
| void ei_device_pinch_end | ( | struct ei_device * | device | ) |
End the current pinch gesture.
| void ei_device_pinch_update | ( | struct ei_device * | device, |
| double | dx, | ||
| double | dy, | ||
| double | scale, | ||
| double | rotation ) |
Update the current pinch gesture's position by the given relative delta, with the given absolute scale and relative rotation.
| void ei_device_pointer_motion | ( | struct ei_device * | device, |
| double | x, | ||
| double | y ) |
Generate a relative motion event on a device with the EI_DEVICE_CAP_POINTER capability.
This method is only available on an ei sender context.
| device | The EI device |
| x | The x movement in logical pixels or mm, depending on the device type |
| y | The y movement in logical pixels or mm, depending on the device type |
| void ei_device_pointer_motion_absolute | ( | struct ei_device * | device, |
| double | x, | ||
| double | y ) |
Generate an absolute motion event on a device with the EI_DEVICE_CAP_POINTER_ABSOLUTE capability.
The x/y coordinate must be within the device's regions or the event is silently discarded.
This method is only available on an ei sender context.
| device | The EI device |
| x | The x position in logical pixels or mm, depending on the device type |
| y | The y position in logical pixels or mm, depending on the device type |
| void ei_device_scroll_cancel | ( | struct ei_device * | device, |
| bool | cancel_x, | ||
| bool | cancel_y ) |
Generate a scroll cancel event on a device with the EI_DEVICE_CAP_SCROLL capability.
A scroll cancel event notifies the server that a scroll motion previously triggered with ei_device_scroll_delta() or ei_device_scroll_discrete() has ceased and no further events should be sent.
This event indicates that the interaction has stopped to the point where further (server-emulated) scroll events from this device are wrong.
Use ei_device_scroll_stop() to signal that the interaction has stopped but a server may emulate further scroll events.
Calling ei_device_scroll_cancel() after ei_device_scroll_stop() without any of ei_device_scroll_delta() or ei_device_scroll_discrete() in between is permitted.
libei keeps track of the scroll axis and filters duplicate calls to ei_device_scroll_cancel() for the same axis. A nonzero scroll or scroll-discrete value is required for the given axis to re-start scrolling for that axis.
This method is only available on an ei sender context.
| void ei_device_scroll_delta | ( | struct ei_device * | device, |
| double | x, | ||
| double | y ) |
Generate a smooth (pixel-precise) scroll event on a device with the EI_DEVICE_CAP_SCROLL capability.
This method is only available on an ei sender context.
| device | The EI device |
| x | The x scroll distance in logical pixels or mm, depending on the device type |
| y | The y scroll distance in logical pixels or mm, depending on the device type |
| void ei_device_scroll_discrete | ( | struct ei_device * | device, |
| int32_t | x, | ||
| int32_t | y ) |
Generate a discrete scroll event on a device with the EI_DEVICE_CAP_SCROLL capability.
A discrete scroll event is based logical scroll units (equivalent to one mouse wheel click). The value for one scroll unit is 120, a fraction or multiple thereof represents a fraction or multiple of a wheel click.
This method is only available on an ei sender context.
| device | The EI device |
| x | The x scroll distance in fractions or multiples of 120 |
| y | The y scroll distance in fractions or multiples of 120 |
| void ei_device_scroll_stop | ( | struct ei_device * | device, |
| bool | stop_x, | ||
| bool | stop_y ) |
Generate a scroll stop event on a device with the EI_DEVICE_CAP_SCROLL capability.
A scroll stop event notifies the server that the interaction causing a scroll motion previously triggered with ei_device_scroll_delta() or ei_device_scroll_discrete() has stopped. For example, if all fingers are lifted off a touchpad, two-finger scrolling has logically stopped.
The server may use this information to e.g. start kinetic scrolling previously based on the previous finger speed.
Use ei_device_scroll_cancel() to signal that the scroll motion has completely stopped.
Calling ei_device_scroll_stop() after ei_device_scroll_cancel() without any of ei_device_scroll_delta() or ei_device_scroll_discrete() in between indicates a client logic bug.
libei keeps track of the scroll axis and filters duplicate calls to ei_device_scroll_stop() for the same axis. A nonzero scroll or scroll-discrete value is required for the given axis to re-start scrolling for that axis.
This method is only available on an ei sender context.
| void ei_device_start_emulating | ( | struct ei_device * | device, |
| uint32_t | sequence ) |
Notify the EIS implementation that the given device is about to start sending events.
This should be seen more as a transactional boundary than a time-based boundary. The primary use-cases for this are to allow for setup on the EIS implementation side and/or UI updates to indicate that a device is sending events now and for out-of-band information to sync with a given event sequence.
There is no actual requirement that events start immediately once emulation starts and there is no requirement that a client calls ei_device_stop_emulating() after the most recent events.
For example, in a synergy-like use-case the client would call ei_device_start_emulating() once the pointer moves into the screen and ei_device_stop_emulating() once the pointer moves out of the screen.
Sending events before ei_device_start_emulating() or after ei_device_stop_emulating() is a client bug.
The sequence number identifies this transaction between start/stop emulating. It must go up by at least 1 on each call to ei_device_start_emulating(). Wraparound must be handled by the EIS implementation but Callers must ensure that detection of wraparound is reasonable.
This method is only available on an ei sender context.
| void ei_device_stop_emulating | ( | struct ei_device * | device | ) |
Notify the EIS implementation that the given device is no longer sending events.
See ei_device_start_emulating() for details.
If the device is not logically in a neutral state, that state is left as-is. It is the caller's responsibility to release any buttons, keys, touch sequences, etc. when stopping emulation to avoid adverse side effects.
This method is only available on an ei sender context.
| void ei_device_stylus_airbrush_flow | ( | struct ei_device * | device, |
| double | flow ) |
Notify the server of the airbrush flow control position as a normalized value in the range [0.0, 1.0] where 0.0 is fully off and 1.0 is fully on.
This event must be in the same frame as proximity_in if the capability is bound. It may also be sent when the stylus is already in proximity or in the same frame as the proximity out event. It must not be sent when the stylus is out of proximity.
The EI_STYLUS_CAP_AIRBRUSH_FLOW capability must be bound.
| device | A device with EI_DEVICE_CAP_STYLUS capability |
| flow | The airbrush flow, normalized to [0.0, 1.0] |
| void ei_device_stylus_distance | ( | struct ei_device * | device, |
| double | distance ) |
Notify the server of the distance between the stylus and its digitizer as a normalized value in the range [0.0, 1.0] where 0.0 is physical contact and 1.0 is maximum distance.
This event must be in the same frame as proximity_in if the capability is bound. It may also be sent when the stylus is already in proximity or in the same frame as the proximity out event. It must not be sent when the stylus is out of proximity.
The EI_STYLUS_CAP_DISTANCE capability must be bound.
| device | A device with EI_DEVICE_CAP_STYLUS capability |
| distance | The distance, normalized to [0.0, 1.0] |
| void ei_device_stylus_erase_start | ( | struct ei_device * | device | ) |
Notify the server that the stylus's eraser feature has been activated.
This event may be sent when the stylus is already in proximity or in the same frame as the proximity in event. It must not be sent when the stylus is out of proximity or in the same frame as the proximity out event.
The EI_STYLUS_CAP_ERASE capability must be bound.
| device | A device with EI_DEVICE_CAP_STYLUS capability |
| void ei_device_stylus_erase_stop | ( | struct ei_device * | device | ) |
Notify the server that the stylus's eraser feature has been deactivated.
This event may be sent when the stylus is already in proximity or in the same frame as the proximity out event. It must not be sent when the stylus is out of proximity or in the same frame as the proximity in event.
The EI_STYLUS_CAP_ERASE capability must be bound.
| device | A device with EI_DEVICE_CAP_STYLUS capability |
| void ei_device_stylus_motion | ( | struct ei_device * | device, |
| double | x, | ||
| double | y ) |
Notify the server that the stylus has moved to the given absolute position.
The coordinates are in mm for physical devices and pixels for virtual devices.
This event must be in the same frame as proximity_in. It may also be sent when the stylus is already in proximity or in the same frame as the proximity out event. It must not be sent when the stylus is out of proximity.
| device | A device with EI_DEVICE_CAP_STYLUS capability |
| x | The absolute x position |
| y | The absolute y position |
| void ei_device_stylus_pressure | ( | struct ei_device * | device, |
| double | pressure ) |
Notify the server of the stylus pressure as a normalized value in the range [0.0, 1.0] where 0.0 is no pressure and 1.0 is maximum pressure.
This event must be in the same frame as proximity_in if the capability is bound. It may also be sent when the stylus is already in proximity or in the same frame as the proximity out event. It must not be sent when the stylus is out of proximity.
The EI_STYLUS_CAP_PRESSURE capability must be bound.
| device | A device with EI_DEVICE_CAP_STYLUS capability |
| pressure | The pressure, normalized to [0.0, 1.0] |
| void ei_device_stylus_proximity_in | ( | struct ei_device * | device | ) |
Notify the server that the stylus has entered proximity of its digitizer.
The frame containing this call must also contain a ei_device_stylus_motion() call and one corresponding call for each bound capability.
It is a protocol violation to call this while the stylus is already in or entering proximity.
| device | A device with EI_DEVICE_CAP_STYLUS capability |
| void ei_device_stylus_proximity_out | ( | struct ei_device * | device | ) |
Notify the server that the stylus has left proximity of its digitizer.
After the frame is processed, all state (tip up/down, axis values) is invalid.
The frame containing this call may include a final update of the stylus state (position, tilt, etc.). A caller must not use the final update of the stylus state to attempt to reset values. For example, some hardware will send a final zero state for all axes on proximity out - do not emulate this, leave out the updates altogether in this case.
It is a protocol violation to call this while the stylus is already leaving or out of proximity.
| device | A device with EI_DEVICE_CAP_STYLUS capability |
| void ei_device_stylus_rotation | ( | struct ei_device * | device, |
| double | rotation ) |
Notify the server of the stylus barrel rotation angle in degrees.
The value is in the range [0.0, 360.0) where 0.0 is the neutral rotation and angles increase clockwise.
This event must be in the same frame as proximity_in if the capability is bound. It may also be sent when the stylus is already in proximity or in the same frame as the proximity out event. It must not be sent when the stylus is out of proximity.
The EI_STYLUS_CAP_ROTATION capability must be bound.
| device | A device with EI_DEVICE_CAP_STYLUS capability |
| rotation | The barrel rotation, in degrees |
| void ei_device_stylus_tilt | ( | struct ei_device * | device, |
| double | tilt_x, | ||
| double | tilt_y ) |
Notify the server of the stylus tilt angles in degrees.
Each angle is in the range [-90.0, +90.0] and measured relative to the digitizer's Z axis.
This event must be in the same frame as proximity_in if the capability is bound. It may also be sent when the stylus is already in proximity or in the same frame as the proximity out event. It must not be sent when the stylus is out of proximity.
The EI_STYLUS_CAP_TILT capability must be bound.
| device | A device with EI_DEVICE_CAP_STYLUS capability |
| tilt_x | The tilt along the X axis, in degrees |
| tilt_y | The tilt along the Y axis, in degrees |
| void ei_device_stylus_tip_down | ( | struct ei_device * | device | ) |
Notify the server that the stylus has come into logical contact with its digitizer.
This event may be sent when the stylus is already in proximity or in the same frame as the proximity in event. It must not be sent when the stylus is out of proximity or in the same frame as the proximity out event.
| device | A device with EI_DEVICE_CAP_STYLUS capability |
| void ei_device_stylus_tip_up | ( | struct ei_device * | device | ) |
Notify the server that the stylus has left logical contact with its digitizer.
This event may be sent when the stylus is already in proximity or in the same frame as the proximity out event. It must not be sent when the stylus is out of proximity or in the same frame as the proximity in event.
| device | A device with EI_DEVICE_CAP_STYLUS capability |
| void ei_device_swipe_begin | ( | struct ei_device * | device, |
| uint32_t | nfingers ) |
Begin a new swipe gesture on a device with the EI_DEVICE_CAP_GESTURES capability.
Only one swipe gesture may be active at a time.
This method is only available on an ei sender context.
| device | A device with EI_DEVICE_CAP_GESTURES capability |
| nfingers | The number of fingers, must be between 1 and 5 (inclusive) |
| void ei_device_swipe_cancel | ( | struct ei_device * | device | ) |
Cancel the current swipe gesture.
| void ei_device_swipe_end | ( | struct ei_device * | device | ) |
End the current swipe gesture.
| void ei_device_swipe_update | ( | struct ei_device * | device, |
| double | dx, | ||
| double | dy ) |
Update the current swipe gesture's position by the given relative delta.
| void ei_device_text_keysym | ( | struct ei_device * | device, |
| uint32_t | keysym, | ||
| bool | is_press ) |
Generate a key event on a device with the EI_DEVICE_CAP_TEXT capability.
Keysyms use the XKB-compatible keysyms, see e.g. /usr/include/xkbcommon/xkbcommon-keysyms.h for a list of key syms
Note that this keysym is independent of any keymap and the keysym may not exist on any active keymap on any device. For example, a device with both EI_DEVICE_CAP_TEXT and EI_DEVICE_CAP_KEYBOARD is not limited to sending keysyms only present on the keymap.
This method is only available on an ei sender context.
| device | The EI device |
| keysym | The keysym |
| is_press | true for key down, false for key up |
| void ei_device_text_utf8 | ( | struct ei_device * | device, |
| const char * | utf8 ) |
Generate a UTF-8 text event on a device with the EI_DEVICE_CAP_TEXT capability.
This method is only available on an ei sender context. This method is identical to ei_device_text_utf8_with_length() but calculates the length of the string.
| device | The EI device |
| text | The zero-terminated UTF-8 compatible text |
| void ei_device_text_utf8_with_length | ( | struct ei_device * | device, |
| const char * | text, | ||
| size_t | length ) |
Generate a UTF-8 text event on a device with the EI_DEVICE_CAP_TEXT capability.
This method is only available on an ei sender context.
This method is identical to ei_device_text_utf8() but takes an additional length argument.
| device | The EI device |
| text | The zero-terminated UTF-8 compatible text |
| length | The length of text in bytes, excluding the zero bytes |
Initiate a new touch on a device with the EI_DEVICE_CAP_TOUCH capability.
This touch does not immediately send events, use ei_touch_down(), ei_touch_motion(), and ei_touch_up().
The returned touch has a refcount of at least 1, use ei_touch_unref() to release resources associated with this touch
This method is only available on an ei sender context.
| void ei_event_device_bind_stylus_capability | ( | struct ei_event * | event, |
| enum ei_stylus_capability | capability ) |
Bind to the given stylus capability for the device associated with this EI_EVENT_DEVICE_ADDED event.
This function may be called multiple times to bind to multiple capabilities.
The bound capabilities accumulate in the device and are sent to the server automatically when the device setup completes (i.e. when the EI_EVENT_DEVICE_ADDED event is released by the caller).
If the client does not bind to any capability, stylus events are restricted to proximity in/out, motion and tip down/up only.
It is a protocol violation to bind to a capability not offered by the server for this device; use ei_event_device_has_stylus_capability() to check the offered set.
| event | An event of type EI_EVENT_DEVICE_ADDED |
| capability | The capability to bind |
| bool ei_event_device_has_stylus_capability | ( | struct ei_event * | event, |
| enum ei_stylus_capability | capability ) |
Return true if the device associated with this EI_EVENT_DEVICE_ADDED event has the given stylus capability.
This function is used during device setup to query which capabilities the server offers for a stylus device. Use ei_event_device_bind_stylus_capability() to bind to the desired capabilities.
If the device does not have the EI_DEVICE_CAP_STYLUS capability, this function returns false.
| event | An event of type EI_EVENT_DEVICE_ADDED |
| capability | The capability to check |
| void ei_touch_cancel | ( | struct ei_touch * | touch | ) |
Cancel this touch.
After this call, the touch event becomes inert and no longer responds to either ei_touch_down(), ei_touch_motion() or ei_touch_up() and the caller should call ei_touch_unref().
This is only available if the EIS implementation supports version 2 or later of the ei_touchscreen protocol interface. Otherwise, this function is equivalent to calling ei_touch_up().
| void ei_touch_down | ( | struct ei_touch * | touch, |
| double | x, | ||
| double | y ) |
This function can only be called once on an ei_touch object.
Further calls to ei_touch_down() on the same object are silently ignored.
The x/y coordinate must be within the device's regions or the event is silently discarded.
| touch | A newly created touch |
| x | The x position in logical pixels |
| y | The y position in logical pixels |
| void * ei_touch_get_user_data | ( | struct ei_touch * | touch | ) |
Return the custom data pointer for this context.
libei will not look at or modify the pointer. Use ei_touch_set_user_data() to change the user data.
| void ei_touch_motion | ( | struct ei_touch * | touch, |
| double | x, | ||
| double | y ) |
Move this touch to the new coordinates.
Increase the refcount of this struct by one.
Use ei_touch_unref() to decrease the refcount.
| void ei_touch_set_user_data | ( | struct ei_touch * | touch, |
| void * | user_data ) |
Set a custom data pointer for this context.
libei will not look at or modify the pointer. Use ei_touch_get_user_data() to retrieve a previously set user data.
Decrease the refcount of this struct by one.
When the refcount reaches zero, all allocated resources for this struct are released.
| void ei_touch_up | ( | struct ei_touch * | touch | ) |
Release this touch.
After this call, the touch event becomes inert and no longer responds to either ei_touch_down(), ei_touch_motion() or ei_touch_up() and the caller should call ei_touch_unref().