libei: The keymap API

libei 1.5.0 A library for Emulated Input

The keymap API
🥚 EI - The client API

The API to query a struct ei_keymap for information. More...

## Functions
size_t | ei_keymap_get_size (struct ei_keymap *keymap)
enum ei_keymap_type | ei_keymap_get_type (struct ei_keymap *keymap)
| Returns the type for this keymap.
int | ei_keymap_get_fd (struct ei_keymap *keymap)
| Return a memmap-able file descriptor pointing to the keymap used by the device.
struct ei_device * | ei_keymap_get_device (struct ei_keymap *keymap)
| Return the device this keymap belongs to, or NULL if it has not yet been assigned to a device.
struct ei_keymap * | ei_keymap_ref (struct ei_keymap *keymap)
| Increase the refcount of this struct by one.
struct ei_keymap * | ei_keymap_unref (struct ei_keymap *keymap)
| Decrease the refcount of this struct by one.
void | ei_keymap_set_user_data (struct ei_keymap *keymap, void *user_data)
void * | ei_keymap_get_user_data (struct ei_keymap *keymap)
struct ei_device * | ei_keymap_get_context (struct ei_keymap *keymap)
| Return the struct ei_device this keymap is associated with.

## Detailed Description

The API to query a struct ei_keymap for information.

## Function Documentation

## ◆ ei_keymap_get_context()

struct ei_device * ei_keymap_get_context | ( | struct ei_keymap * | keymap | ) |

Return the struct ei_device this keymap is associated with.

## ◆ ei_keymap_get_device()

struct ei_device * ei_keymap_get_device | ( | struct ei_keymap * | keymap | ) |

Return the device this keymap belongs to, or NULL if it has not yet been assigned to a device.

After processing and if the server changed the keymap or set the keymap to NULL, this keymap may no longer be in use by the device and future calls to this function return NULL.

## ◆ ei_keymap_get_fd()

int ei_keymap_get_fd | ( | struct ei_keymap * | keymap | ) |

Return a memmap-able file descriptor pointing to the keymap used by the device.

The keymap is constant for the lifetime of the device and assigned to this device individually.

## ◆ ei_keymap_get_size()

size_t ei_keymap_get_size | ( | struct ei_keymap * | keymap | ) |

Returns
  the size of the keymap in bytes

## ◆ ei_keymap_get_type()

enum ei_keymap_type ei_keymap_get_type | ( | struct ei_keymap * | keymap | ) |

Returns the type for this keymap.

The type specifies how to interpret the data at the file descriptor returned by ei_keymap_get_fd().

## ◆ ei_keymap_get_user_data()

void * ei_keymap_get_user_data | ( | struct ei_keymap * | keymap | ) |

## ◆ ei_keymap_ref()

struct ei_keymap * ei_keymap_ref | ( | struct ei_keymap * | keymap | ) |

Increase the refcount of this struct by one.

Use ei_keymap_unref() to decrease the refcount.

Returns
  the argument passed into the function

## ◆ ei_keymap_set_user_data()

void ei_keymap_set_user_data | ( | struct ei_keymap * | keymap,
|  | void * | user_data )

## ◆ ei_keymap_unref()

struct ei_keymap * ei_keymap_unref | ( | struct ei_keymap * | keymap | ) |

Decrease the refcount of this struct by one.

When the refcount reaches zero, all allocated resources for this struct are released.

Returns
  always NULL