libei 1.4.0
A library for Emulated Input
API for receiver clients

Functions

uint32_t ei_event_emulating_get_sequence (struct ei_event *event)
 For an event of type EI_EVENT_DEVICE_START_EMULATING, return the sequence number set by the EIS implementation.
 
uint32_t ei_event_keyboard_get_xkb_mods_depressed (struct ei_event *event)
 For an event of type EI_EVENT_KEYBOARD_MODIFIERS, get the mask of currently logically pressed-down modifiers.
 
uint32_t ei_event_keyboard_get_xkb_mods_latched (struct ei_event *event)
 For an event of type EI_EVENT_KEYBOARD_MODIFIERS, get the mask of currently logically latched modifiers.
 
uint32_t ei_event_keyboard_get_xkb_mods_locked (struct ei_event *event)
 For an event of type EI_EVENT_KEYBOARD_MODIFIERS, get the mask of currently logically locked modifiers.
 
uint32_t ei_event_keyboard_get_xkb_group (struct ei_event *event)
 For an event of type EI_EVENT_KEYBOARD_MODIFIERS, get the current effective group.
 
double ei_event_pointer_get_dx (struct ei_event *event)
 For an event of type EI_EVENT_POINTER_MOTION return the relative x movement in logical pixels or mm, depending on the device type.
 
double ei_event_pointer_get_dy (struct ei_event *event)
 For an event of type EI_EVENT_POINTER_MOTION return the relative y movement in logical pixels or mm, depending on the device type.
 
double ei_event_pointer_get_absolute_x (struct ei_event *event)
 For an event of type EI_EVENT_POINTER_MOTION_ABSOLUTE return the x position in logical pixels or mm, depending on the device type.
 
double ei_event_pointer_get_absolute_y (struct ei_event *event)
 For an event of type EI_EVENT_POINTER_MOTION_ABSOLUTE return the y position in logical pixels or mm, depending on the device type.
 
uint32_t ei_event_button_get_button (struct ei_event *event)
 For an event of type EI_EVENT_BUTTON_BUTTON return the button code as defined in linux/input-event-codes.h.
 
bool ei_event_button_get_is_press (struct ei_event *event)
 For an event of type EI_EVENT_BUTTON_BUTTON return true if the event is a button press, false for a release.
 
double ei_event_scroll_get_dx (struct ei_event *event)
 For an event of type EI_EVENT_SCROLL_DELTA return the x scroll distance in logical pixels or mm, depending on the device type.
 
double ei_event_scroll_get_dy (struct ei_event *event)
 For an event of type EI_EVENT_SCROLL_DELTA return the y scroll distance in logical pixels or mm, depending on the device type.
 
bool ei_event_scroll_get_stop_x (struct ei_event *event)
 For an event of type EI_EVENT_SCROLL_CANCEL return whether the x axis has cancelled scrolling.
 
bool ei_event_scroll_get_stop_y (struct ei_event *event)
 For an event of type EI_EVENT_SCROLL_STOP return whether the y axis has stopped scrolling.
 
int32_t ei_event_scroll_get_discrete_dx (struct ei_event *event)
 For an event of type EI_EVENT_SCROLL_DISCRETE return the x scroll distance in fractions or multiples of 120.
 
int32_t ei_event_scroll_get_discrete_dy (struct ei_event *event)
 For an event of type EI_EVENT_SCROLL_DISCRETE return the y scroll distance in fractions or multiples of 120.
 
uint32_t ei_event_keyboard_get_key (struct ei_event *event)
 For an event of type EI_EVENT_KEYBOARD_KEY return the key code (as defined in include/linux/input-event-codes.h).
 
bool ei_event_keyboard_get_key_is_press (struct ei_event *event)
 For an event of type EI_EVENT_KEYBOARD_KEY return true if the event is a key down, false for a release.
 
uint32_t ei_event_touch_get_id (struct ei_event *event)
 For an event of type EI_EVENT_TOUCH_DOWN, EI_EVENT_TOUCH_MOTION, or EI_EVENT_TOUCH_UP, return the tracking ID of the touch.
 
double ei_event_touch_get_x (struct ei_event *event)
 For an event of type EI_EVENT_TOUCH_DOWN, or EI_EVENT_TOUCH_MOTION, return the x coordinate of the touch in logical pixels or mm, depending on the device type.
 
double ei_event_touch_get_y (struct ei_event *event)
 For an event of type EI_EVENT_TOUCH_DOWN, or EI_EVENT_TOUCH_MOTION, return the y coordinate of the touch in logical pixels or mm, depending on the device type.
 
bool ei_event_touch_get_is_cancel (struct ei_event *event)
 For an event of type EI_EVENT_TOUCH_UP return true if the event was cancelled instead of logically released.
 

Detailed Description

The receiver client API is available only to clients created with ei_new_receiver(). For those clients the EIS implemententation creates devices and sends events to the libei client. The primary use-case for this is input capturing, e.g. InputLeap.

It is a client bug to call any of these functions for a client created with ei_new_sender().

Function Documentation

◆ ei_event_button_get_button()

uint32_t ei_event_button_get_button ( struct ei_event * event)

For an event of type EI_EVENT_BUTTON_BUTTON return the button code as defined in linux/input-event-codes.h.

◆ ei_event_button_get_is_press()

bool ei_event_button_get_is_press ( struct ei_event * event)

For an event of type EI_EVENT_BUTTON_BUTTON return true if the event is a button press, false for a release.

◆ ei_event_emulating_get_sequence()

uint32_t ei_event_emulating_get_sequence ( struct ei_event * event)

For an event of type EI_EVENT_DEVICE_START_EMULATING, return the sequence number set by the EIS implementation.

See eis_device_start_emulating() for details.

◆ ei_event_keyboard_get_key()

uint32_t ei_event_keyboard_get_key ( struct ei_event * event)

For an event of type EI_EVENT_KEYBOARD_KEY return the key code (as defined in include/linux/input-event-codes.h).

◆ ei_event_keyboard_get_key_is_press()

bool ei_event_keyboard_get_key_is_press ( struct ei_event * event)

For an event of type EI_EVENT_KEYBOARD_KEY return true if the event is a key down, false for a release.

◆ ei_event_keyboard_get_xkb_group()

uint32_t ei_event_keyboard_get_xkb_group ( struct ei_event * event)

For an event of type EI_EVENT_KEYBOARD_MODIFIERS, get the current effective group.

This may be passed to xkb_state_update_mask() as either depressed_layout (effectively pretending the user is holding down some key for this group at all times) or locked_layout (treating it as a layout the user has switched to through some mechanism), but never both at the same time. The other two layout arguments must be set to zero.

Note: Because the client only knows the current effective group and not the combination of state from which it was calculated, any attempt to predict how future key presses will impact the group state will necessarily be unreliable.

See ei_device_keyboard_get_keymap() for the corresponding keymap.

◆ ei_event_keyboard_get_xkb_mods_depressed()

uint32_t ei_event_keyboard_get_xkb_mods_depressed ( struct ei_event * event)

For an event of type EI_EVENT_KEYBOARD_MODIFIERS, get the mask of currently logically pressed-down modifiers.

See ei_device_keyboard_get_keymap() for the corresponding keymap.

◆ ei_event_keyboard_get_xkb_mods_latched()

uint32_t ei_event_keyboard_get_xkb_mods_latched ( struct ei_event * event)

For an event of type EI_EVENT_KEYBOARD_MODIFIERS, get the mask of currently logically latched modifiers.

See ei_device_keyboard_get_keymap() for the corresponding keymap.

◆ ei_event_keyboard_get_xkb_mods_locked()

uint32_t ei_event_keyboard_get_xkb_mods_locked ( struct ei_event * event)

For an event of type EI_EVENT_KEYBOARD_MODIFIERS, get the mask of currently logically locked modifiers.

See ei_device_keyboard_get_keymap() for the corresponding keymap.

◆ ei_event_pointer_get_absolute_x()

double ei_event_pointer_get_absolute_x ( struct ei_event * event)

For an event of type EI_EVENT_POINTER_MOTION_ABSOLUTE return the x position in logical pixels or mm, depending on the device type.

◆ ei_event_pointer_get_absolute_y()

double ei_event_pointer_get_absolute_y ( struct ei_event * event)

For an event of type EI_EVENT_POINTER_MOTION_ABSOLUTE return the y position in logical pixels or mm, depending on the device type.

◆ ei_event_pointer_get_dx()

double ei_event_pointer_get_dx ( struct ei_event * event)

For an event of type EI_EVENT_POINTER_MOTION return the relative x movement in logical pixels or mm, depending on the device type.

◆ ei_event_pointer_get_dy()

double ei_event_pointer_get_dy ( struct ei_event * event)

For an event of type EI_EVENT_POINTER_MOTION return the relative y movement in logical pixels or mm, depending on the device type.

◆ ei_event_scroll_get_discrete_dx()

int32_t ei_event_scroll_get_discrete_dx ( struct ei_event * event)

For an event of type EI_EVENT_SCROLL_DISCRETE return the x scroll distance in fractions or multiples of 120.

◆ ei_event_scroll_get_discrete_dy()

int32_t ei_event_scroll_get_discrete_dy ( struct ei_event * event)

For an event of type EI_EVENT_SCROLL_DISCRETE return the y scroll distance in fractions or multiples of 120.

◆ ei_event_scroll_get_dx()

double ei_event_scroll_get_dx ( struct ei_event * event)

For an event of type EI_EVENT_SCROLL_DELTA return the x scroll distance in logical pixels or mm, depending on the device type.

◆ ei_event_scroll_get_dy()

double ei_event_scroll_get_dy ( struct ei_event * event)

For an event of type EI_EVENT_SCROLL_DELTA return the y scroll distance in logical pixels or mm, depending on the device type.

◆ ei_event_scroll_get_stop_x()

bool ei_event_scroll_get_stop_x ( struct ei_event * event)

For an event of type EI_EVENT_SCROLL_CANCEL return whether the x axis has cancelled scrolling.

◆ ei_event_scroll_get_stop_y()

bool ei_event_scroll_get_stop_y ( struct ei_event * event)

For an event of type EI_EVENT_SCROLL_STOP return whether the y axis has stopped scrolling.

◆ ei_event_touch_get_id()

uint32_t ei_event_touch_get_id ( struct ei_event * event)

For an event of type EI_EVENT_TOUCH_DOWN, EI_EVENT_TOUCH_MOTION, or EI_EVENT_TOUCH_UP, return the tracking ID of the touch.

The tracking ID is a unique identifier for a touch and is valid from touch down through to touch up but may be re-used in the future. The tracking ID is randomly assigned to a touch, a client must not expect any specific value.

◆ ei_event_touch_get_is_cancel()

bool ei_event_touch_get_is_cancel ( struct ei_event * event)

For an event of type EI_EVENT_TOUCH_UP return true if the event was cancelled instead of logically released.

Support for touch cancellation requires the EIS implementation and client to support version 2 or later of the ei_touchscreen protocol interface.

◆ ei_event_touch_get_x()

double ei_event_touch_get_x ( struct ei_event * event)

For an event of type EI_EVENT_TOUCH_DOWN, or EI_EVENT_TOUCH_MOTION, return the x coordinate of the touch in logical pixels or mm, depending on the device type.

◆ ei_event_touch_get_y()

double ei_event_touch_get_y ( struct ei_event * event)

For an event of type EI_EVENT_TOUCH_DOWN, or EI_EVENT_TOUCH_MOTION, return the y coordinate of the touch in logical pixels or mm, depending on the device type.