1 // Copyright 2014 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 #include "ui/events/ozone/evdev/event_converter_evdev.h"
7 #include "base/files/file_path.h"
8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h"
10 #include "ui/events/devices/input_device.h"
14 EventConverterEvdev::EventConverterEvdev(int fd
,
15 const base::FilePath
& path
,
18 : fd_(fd
), path_(path
), id_(id
), type_(type
), ignore_events_(false) {
21 EventConverterEvdev::~EventConverterEvdev() {
25 void EventConverterEvdev::Start() {
26 base::MessageLoopForUI::current()->WatchFileDescriptor(
27 fd_
, true, base::MessagePumpLibevent::WATCH_READ
, &controller_
, this);
30 void EventConverterEvdev::Stop() {
31 controller_
.StopWatchingFileDescriptor();
34 void EventConverterEvdev::OnFileCanWriteWithoutBlocking(int fd
) {
38 bool EventConverterEvdev::HasKeyboard() const {
42 bool EventConverterEvdev::HasMouse() const {
46 bool EventConverterEvdev::HasTouchpad() const {
50 bool EventConverterEvdev::HasTouchscreen() const {
54 gfx::Size
EventConverterEvdev::GetTouchscreenSize() const {
59 void EventConverterEvdev::SetAllowedKeys(
60 scoped_ptr
<std::set
<DomCode
>> allowed_keys
) {
64 void EventConverterEvdev::AllowAllKeys() {