libevdev-uinput.h
Go to the documentation of this file.
/*
* Copyright © 2013 Red Hat, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that copyright
* notice and this permission notice appear in supporting documentation, and
* that the name of the copyright holders not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no representations
* about the suitability of this software for any purpose. It is provided "as
* is" without express or implied warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*/
#ifndef LIBEVDEV_UINPUT_H
#define LIBEVDEV_UINPUT_H
#ifdef __cplusplus
extern "C" {
#endif
#include <libevdev/libevdev.h>
struct libevdev_uinput;
enum libevdev_uinput_open_mode {
/* intentionally -2 to avoid to avoid code like the below from accidentally working:
fd = open("/dev/uinput", O_RDWR); // fails, fd is -1
libevdev_uinput_create_from_device(dev, fd, &uidev); // may hide the error */
LIBEVDEV_UINPUT_OPEN_MANAGED = -2
};
int libevdev_uinput_create_from_device(const struct libevdev *dev,
int uinput_fd,
struct libevdev_uinput **uinput_dev);
void libevdev_uinput_destroy(struct libevdev_uinput *uinput_dev);
int libevdev_uinput_get_fd(const struct libevdev_uinput *uinput_dev);
const char* libevdev_uinput_get_syspath(struct libevdev_uinput *uinput_dev);
const char* libevdev_uinput_get_devnode(struct libevdev_uinput *uinput_dev);
int libevdev_uinput_write_event(const struct libevdev_uinput *uinput_dev,
unsigned int type,
unsigned int code,
int value);
#ifdef __cplusplus
}
#endif
#endif /* LIBEVDEV_UINPUT_H */
libevdev.h
libevdev_uinput_get_devnode
const char * libevdev_uinput_get_devnode(struct libevdev_uinput *uinput_dev)
libevdev_uinput_create_from_device
int libevdev_uinput_create_from_device(const struct libevdev *dev, int uinput_fd, struct libevdev_uinput **uinput_dev)
LIBEVDEV_UINPUT_OPEN_MANAGED
@ LIBEVDEV_UINPUT_OPEN_MANAGED
let libevdev open and close /dev/uinput
Definition: libevdev-uinput.h:113
libevdev_uinput_get_syspath
const char * libevdev_uinput_get_syspath(struct libevdev_uinput *uinput_dev)
libevdev_uinput_destroy
void libevdev_uinput_destroy(struct libevdev_uinput *uinput_dev)
libevdev_uinput_open_mode
libevdev_uinput_open_mode
Definition: libevdev-uinput.h:109
libevdev_uinput_get_fd
int libevdev_uinput_get_fd(const struct libevdev_uinput *uinput_dev)
libevdev_uinput_write_event
int libevdev_uinput_write_event(const struct libevdev_uinput *uinput_dev, unsigned int type, unsigned int code, int value)