OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/events/ozone/evdev/event_converter_evdev_impl.h" | 5 #include "ui/events/ozone/evdev/event_converter_evdev_impl.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <linux/input.h> | 8 #include <linux/input.h> |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 | 10 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 ssize_t read_size = read(fd, inputs, sizeof(inputs)); | 63 ssize_t read_size = read(fd, inputs, sizeof(inputs)); |
64 if (read_size < 0) { | 64 if (read_size < 0) { |
65 if (errno == EINTR || errno == EAGAIN) | 65 if (errno == EINTR || errno == EAGAIN) |
66 return; | 66 return; |
67 if (errno != ENODEV) | 67 if (errno != ENODEV) |
68 PLOG(ERROR) << "error reading device " << path_.value(); | 68 PLOG(ERROR) << "error reading device " << path_.value(); |
69 Stop(); | 69 Stop(); |
70 return; | 70 return; |
71 } | 71 } |
72 | 72 |
73 if (!enabled_) | 73 if (!IsEnabled()) |
74 return; | 74 return; |
75 | 75 |
76 DCHECK_EQ(read_size % sizeof(*inputs), 0u); | 76 DCHECK_EQ(read_size % sizeof(*inputs), 0u); |
77 ProcessEvents(inputs, read_size / sizeof(*inputs)); | 77 ProcessEvents(inputs, read_size / sizeof(*inputs)); |
78 } | 78 } |
79 | 79 |
80 bool EventConverterEvdevImpl::HasKeyboard() const { | 80 bool EventConverterEvdevImpl::HasKeyboard() const { |
81 return has_keyboard_; | 81 return has_keyboard_; |
82 } | 82 } |
83 | 83 |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 dispatcher_->DispatchMouseMoveEvent( | 251 dispatcher_->DispatchMouseMoveEvent( |
252 MouseMoveEventParams(input_device_.id, EF_NONE, cursor_->GetLocation(), | 252 MouseMoveEventParams(input_device_.id, EF_NONE, cursor_->GetLocation(), |
253 PointerDetails(EventPointerType::POINTER_TYPE_MOUSE), | 253 PointerDetails(EventPointerType::POINTER_TYPE_MOUSE), |
254 TimeTicksFromInputEvent(input))); | 254 TimeTicksFromInputEvent(input))); |
255 | 255 |
256 x_offset_ = 0; | 256 x_offset_ = 0; |
257 y_offset_ = 0; | 257 y_offset_ = 0; |
258 } | 258 } |
259 | 259 |
260 } // namespace ui | 260 } // namespace ui |
OLD | NEW |