11 #include <sys/types.h> 16 #include <boost/exception/errinfo_file_name.hpp> 17 #include <boost/exception/errinfo_errno.hpp> 20 namespace duds {
namespace os {
namespace linux {
35 boost::errinfo_file_name(path)
38 int result = libevdev_new_from_fd(
fd, &
dev);
42 boost::errinfo_errno(-result) <<
45 boost::errinfo_file_name(path)
77 return libevdev_get_name(
dev);
81 return libevdev_grab(
dev, LIBEVDEV_GRAB) == 0;
85 return libevdev_has_event_type(
dev, et) == 1;
89 return libevdev_has_event_code(
dev, etc.
type, etc.
code) == 1;
93 return libevdev_get_num_slots(
dev);
98 if (!libevdev_fetch_event_value(
dev, etc.
type, etc.
code, &val)) {
107 return libevdev_has_event_pending(
dev) > 0;
114 result = libevdev_next_event(
116 LIBEVDEV_READ_FLAG_NORMAL | LIBEVDEV_READ_FLAG_BLOCKING,
119 if (result == LIBEVDEV_READ_STATUS_SUCCESS) {
126 }
while ((result >= 0) && (libevdev_has_event_pending(
dev) > 0));
134 p.
add(shared_from_this(),
fd);
138 const input_absinfo *ia = libevdev_get_abs_info(
dev, absEc);
151 boost::placeholders::_1,
152 boost::placeholders::_2
153 ).track_foreign(ihs));
The specified event type or code is not supported by the input device.
boost::error_info< struct Info_EvdevEventType, unsigned int > EvdevEventType
The event type integer involved in an EvdevError.
move_impl move(unsigned int c, unsigned int r)
Display stream manipulator that moves the display cursor to the given location.
The input device file could not be opened.
std::uint16_t code
An event code, such as KEY_A, ABS_X, or REL_Y.
A simple C++ interface to using Linux's epoll functions.
std::shared_ptr< InputHandlers > InputHandlersSptr
Shared pointer to a InputHandlers class.
Combines an event type and an event code, as defined by libevdev, for the purpose of using a combinat...
std::uint16_t type
An event type, such as EV_KEY, EV_ABS, or EV_REL.
boost::error_info< struct Info_EvdevEventCode, unsigned int > EvdevEventCode
The event code integer involved in an EvdevError.
void add(const PollResponderSptr &prs, int fd, int events=EPOLLIN)
Adds a PollResponder to check for events on a file descriptor.
An attempt was made to open a device file when one was already open.
#define DUDS_THROW_EXCEPTION(x)
Works like BOOST_THROW_EXCEPTION, but includes a stack trace if DUDS_ERRORS_VERBOSE is defined...
Initializing use of the input device failed.