1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_EVENTS_OZONE_EVDEV_KEY_EVENT_CONVERTER_EVDEV_H_
6 #define UI_EVENTS_OZONE_EVDEV_KEY_EVENT_CONVERTER_EVDEV_H_
8 #include "base/files/file_path.h"
9 #include "ui/events/event.h"
10 #include "ui/events/events_export.h"
11 #include "ui/events/ozone/evdev/event_modifiers.h"
12 #include "ui/events/ozone/event_converter_ozone.h"
18 class EVENTS_EXPORT KeyEventConverterEvdev : public EventConverterOzone {
20 KeyEventConverterEvdev(int fd,
22 EventModifiersEvdev* modifiers);
23 virtual ~KeyEventConverterEvdev();
25 // Overidden from base::MessagePumpLibevent::Watcher.
26 virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE;
27 virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE;
29 void ProcessEvents(const struct input_event* inputs, int count);
32 // File descriptor for the /dev/input/event* instance.
35 // Path to input device.
38 // Shared modifier state.
39 EventModifiersEvdev* modifiers_;
41 void ConvertKeyEvent(int key, int value);
43 DISALLOW_COPY_AND_ASSIGN(KeyEventConverterEvdev);
48 #endif // UI_EVENTS_OZONE_EVDEV_KEY_EVENT_CONVERTER_EVDEV_H_