#ifndef UI_EVENTS_OZONE_EVDEV_KEY_EVENT_CONVERTER_EVDEV_H_
#define UI_EVENTS_OZONE_EVDEV_KEY_EVENT_CONVERTER_EVDEV_H_
#include "base/files/file_path.h"
#include "base/message_loop/message_pump_libevent.h"
#include "ui/events/event.h"
#include "ui/events/events_export.h"
#include "ui/events/ozone/evdev/event_converter_evdev.h"
#include "ui/events/ozone/evdev/event_modifiers_evdev.h"
struct input_event;
namespace ui {
class EVENTS_EXPORT KeyEventConverterEvdev
: public EventConverterEvdev,
base::MessagePumpLibevent::Watcher {
public:
KeyEventConverterEvdev(int fd,
base::FilePath path,
EventModifiersEvdev* modifiers);
virtual ~KeyEventConverterEvdev();
virtual void Start() OVERRIDE;
virtual void Stop() OVERRIDE;
virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE;
virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE;
void ProcessEvents(const struct input_event* inputs, int count);
private:
int fd_;
base::FilePath path_;
EventModifiersEvdev* modifiers_;
base::MessagePumpLibevent::FileDescriptorWatcher controller_;
void ConvertKeyEvent(int key, int value);
DISALLOW_COPY_AND_ASSIGN(KeyEventConverterEvdev);
};
}
#endif