libevdev  0.1
A wrapper library for evdev devices
 All Files Functions Typedefs Enumerations Enumerator Groups
libevdev.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_H
24 #define libevdev_H
25 
26 #include <linux/input.h>
27 #include <stdarg.h>
28 
281 struct libevdev;
282 
290 };
291 
306 struct libevdev* libevdev_new(void);
307 
330 int libevdev_new_from_fd(int fd, struct libevdev **dev);
331 
342 void libevdev_free(struct libevdev *dev);
343 
353 typedef void (*libevdev_log_func_t)(const char *format, va_list args);
354 
365 void libevdev_set_log_handler(struct libevdev *dev, libevdev_log_func_t logfunc);
366 
367 
371 };
372 
389 int libevdev_grab(struct libevdev *dev, int grab);
390 
414 int libevdev_set_fd(struct libevdev* dev, int fd);
415 
436 int libevdev_change_fd(struct libevdev* dev, int fd);
437 
444 int libevdev_get_fd(const struct libevdev* dev);
445 
479 int libevdev_next_event(struct libevdev *dev, unsigned int flags, struct input_event *ev);
480 
491 const char* libevdev_get_name(const struct libevdev *dev);
492 
504 const char * libevdev_get_phys(const struct libevdev *dev);
505 
515 const char * libevdev_get_uniq(const struct libevdev *dev);
516 
526 int libevdev_get_product_id(const struct libevdev *dev);
527 
537 int libevdev_get_vendor_id(const struct libevdev *dev);
538 
548 int libevdev_get_bustype(const struct libevdev *dev);
549 
559 int libevdev_get_version(const struct libevdev *dev);
560 
570 int libevdev_get_driver_version(const struct libevdev *dev);
571 
582 int libevdev_has_property(const struct libevdev *dev, unsigned int prop);
583 
594 int libevdev_has_event_type(const struct libevdev *dev, unsigned int type);
595 
607 int libevdev_has_event_code(const struct libevdev *dev, unsigned int type, unsigned int code);
608 
619 int libevdev_get_abs_min(const struct libevdev *dev, unsigned int code);
630 int libevdev_get_abs_max(const struct libevdev *dev, unsigned int code);
641 int libevdev_get_abs_fuzz(const struct libevdev *dev, unsigned int code);
652 int libevdev_get_abs_flat(const struct libevdev *dev, unsigned int code);
663 int libevdev_get_abs_resolution(const struct libevdev *dev, unsigned int code);
664 
676 const struct input_absinfo* libevdev_get_abs_info(const struct libevdev *dev, unsigned int code);
677 
696 int libevdev_get_event_value(const struct libevdev *dev, unsigned int type, unsigned int code);
697 
723 int libevdev_fetch_event_value(const struct libevdev *dev, unsigned int type, unsigned int code, int *value);
724 
745 int libevdev_get_slot_value(const struct libevdev *dev, unsigned int slot, unsigned int code);
746 
772 int libevdev_fetch_slot_value(const struct libevdev *dev, unsigned int slot, unsigned int code, int *value);
773 
787 int libevdev_get_num_slots(const struct libevdev *dev);
788 
802 int libevdev_get_current_slot(const struct libevdev *dev);
803 
821 int libevdev_enable_event_type(struct libevdev *dev, unsigned int type);
822 
848 int libevdev_disable_event_type(struct libevdev *dev, unsigned int type);
849 
877 int libevdev_enable_event_code(struct libevdev *dev, unsigned int type, unsigned int code, const void *data);
878 
906 int libevdev_disable_event_code(struct libevdev *dev, unsigned int type, unsigned int code);
907 
922 int libevdev_kernel_set_abs_value(struct libevdev *dev, unsigned int code, const struct input_absinfo *abs);
923 
942 int libevdev_is_event_type(const struct input_event *ev, unsigned int type);
943 
964 int libevdev_is_event_code(const struct input_event *ev, unsigned int type, unsigned int code);
965 
977 const char * libevdev_get_event_type_name(unsigned int type);
990 const char * libevdev_get_event_code_name(unsigned int type, unsigned int code);
991 
1005 const char * libevdev_get_input_prop_name(unsigned int prop);
1006 
1019 int libevdev_get_event_type_max(unsigned int type);
1020 
1034 int libevdev_get_repeat(struct libevdev *dev, int *delay, int *period);
1035 
1036 #endif /* libevdev_H */