libevdev  0.4
A wrapper library for evdev devices
 All Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
libevdev-uinput.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2013 Red Hat, Inc.
3  *
4  * Permission to use, copy, modify, distribute, and sell this software and its
5  * documentation for any purpose is hereby granted without fee, provided that
6  * the above copyright notice appear in all copies and that both that copyright
7  * notice and this permission notice appear in supporting documentation, and
8  * that the name of the copyright holders not be used in advertising or
9  * publicity pertaining to distribution of the software without specific,
10  * written prior permission. The copyright holders make no representations
11  * about the suitability of this software for any purpose. It is provided "as
12  * is" without express or implied warranty.
13  *
14  * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16  * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
20  * OF THIS SOFTWARE.
21  */
22 
23 #ifndef libevdev_uinput_H
24 #define libevdev_uinput_H
25 
26 #include <libevdev/libevdev.h>
27 
28 struct libevdev_uinput;
29 
100  /* intentionally -2 to avoid to avoid code like the below from accidentally working:
101  fd = open("/dev/uinput", O_RDWR); // fails, fd is -1
102  libevdev_uinput_create_from_device(dev, fd, &uidev); // may hide the error */
104 };
105 
140 int libevdev_uinput_create_from_device(const struct libevdev *dev,
141  int uinput_fd,
142  struct libevdev_uinput **uinput_dev);
143 
157 void libevdev_uinput_destroy(struct libevdev_uinput *uinput_dev);
158 
172 int libevdev_uinput_get_fd(const struct libevdev_uinput *uinput_dev);
173 
192 const char*libevdev_uinput_get_syspath(struct libevdev_uinput *uinput_dev);
193 
209 const char* libevdev_uinput_get_devnode(struct libevdev_uinput *uinput_dev);
210 
225 int libevdev_uinput_write_event(const struct libevdev_uinput *uinput_dev,
226  unsigned int type,
227  unsigned int code,
228  int value);
229 
230 #endif /* libevdev_uinput_H */