libevdev
0.6
A wrapper library for evdev devices
Main Page
Related Pages
Modules
Files
File List
Globals
All
Files
Functions
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
libevdev
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
#ifdef __cplusplus
27
extern
"C"
{
28
#endif
29
30
#include <
libevdev/libevdev.h
>
31
32
struct
libevdev_uinput;
33
103
enum
libevdev_uinput_open_mode
{
104
/* intentionally -2 to avoid to avoid code like the below from accidentally working:
105
fd = open("/dev/uinput", O_RDWR); // fails, fd is -1
106
libevdev_uinput_create_from_device(dev, fd, &uidev); // may hide the error */
107
LIBEVDEV_UINPUT_OPEN_MANAGED
= -2
108
};
109
144
int
libevdev_uinput_create_from_device
(
const
struct
libevdev *dev,
145
int
uinput_fd,
146
struct
libevdev_uinput **uinput_dev);
147
161
void
libevdev_uinput_destroy
(
struct
libevdev_uinput *uinput_dev);
162
176
int
libevdev_uinput_get_fd
(
const
struct
libevdev_uinput *uinput_dev);
177
196
const
char
*
libevdev_uinput_get_syspath
(
struct
libevdev_uinput *uinput_dev);
197
213
const
char
*
libevdev_uinput_get_devnode
(
struct
libevdev_uinput *uinput_dev);
214
229
int
libevdev_uinput_write_event
(
const
struct
libevdev_uinput *uinput_dev,
230
unsigned
int
type,
231
unsigned
int
code,
232
int
value);
233
#ifdef __cplusplus
234
}
235
#endif
236
237
#endif
/* LIBEVDEV_UINPUT_H */
libevdev_uinput_get_fd
int libevdev_uinput_get_fd(const struct libevdev_uinput *uinput_dev)
Return the file descriptor used to create this uinput device.
libevdev_uinput_create_from_device
int libevdev_uinput_create_from_device(const struct libevdev *dev, int uinput_fd, struct libevdev_uinput **uinput_dev)
Create a uinput device based on the libevdev device given.
libevdev_uinput_destroy
void libevdev_uinput_destroy(struct libevdev_uinput *uinput_dev)
Destroy a previously created uinput device and free associated memory.
libevdev_uinput_get_syspath
const char * libevdev_uinput_get_syspath(struct libevdev_uinput *uinput_dev)
Return the syspath representing this uinput device.
LIBEVDEV_UINPUT_OPEN_MANAGED
let libevdev open and close /dev/uinput
Definition:
libevdev-uinput.h:107
libevdev_uinput_get_devnode
const char * libevdev_uinput_get_devnode(struct libevdev_uinput *uinput_dev)
Return the device node representing this uinput device.
libevdev_uinput_write_event
int libevdev_uinput_write_event(const struct libevdev_uinput *uinput_dev, unsigned int type, unsigned int code, int value)
Post an event through the uinput device.
libevdev.h
libevdev_uinput_open_mode
libevdev_uinput_open_mode
Definition:
libevdev-uinput.h:103
Generated on Mon Dec 23 2013 17:45:55 for libevdev by
1.8.5