EventReaderLibevdevCros::EventReaderLibevdevCros(int fd,
const base::FilePath& path,
scoped_ptr<Delegate> delegate)
- : path_(path), delegate_(delegate.Pass()) {
+ : EventConverterEvdev(fd, path), delegate_(delegate.Pass()) {
memset(&evdev_, 0, sizeof(evdev_));
evdev_.log = OnLogMessage;
evdev_.log_udata = this;
EventReaderLibevdevCros::Delegate::~Delegate() {}
-void EventReaderLibevdevCros::Start() {
- base::MessageLoopForUI::current()->WatchFileDescriptor(
- evdev_.fd,
- true,
- base::MessagePumpLibevent::WATCH_READ,
- &controller_,
- this);
-}
-
-void EventReaderLibevdevCros::Stop() {
- controller_.StopWatchingFileDescriptor();
-}
-
void EventReaderLibevdevCros::OnFileCanReadWithoutBlocking(int fd) {
if (EvdevRead(&evdev_)) {
if (errno == EINTR || errno == EAGAIN)
}
}
-void EventReaderLibevdevCros::OnFileCanWriteWithoutBlocking(int fd) {
- NOTREACHED();
-}
-
// static
void EventReaderLibevdevCros::OnSynReport(void* data,
EventStateRec* evstate,