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 | 9 |
10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 code = BTN_FORWARD; | 219 code = BTN_FORWARD; |
220 | 220 |
221 int button_offset = code - BTN_MOUSE; | 221 int button_offset = code - BTN_MOUSE; |
222 if (mouse_button_state_.test(button_offset) == down) | 222 if (mouse_button_state_.test(button_offset) == down) |
223 return; | 223 return; |
224 | 224 |
225 mouse_button_state_.set(button_offset, down); | 225 mouse_button_state_.set(button_offset, down); |
226 | 226 |
227 dispatcher_->DispatchMouseButtonEvent(MouseButtonEventParams( | 227 dispatcher_->DispatchMouseButtonEvent(MouseButtonEventParams( |
228 input_device_.id, cursor_->GetLocation(), code, down, | 228 input_device_.id, cursor_->GetLocation(), code, down, |
229 /* allow_remap */ true, timestamp)); | 229 /* allow_remap */ true, |
| 230 PointerDetails(EventPointerType::POINTER_TYPE_MOUSE), timestamp)); |
230 } | 231 } |
231 | 232 |
232 void EventConverterEvdevImpl::FlushEvents(const input_event& input) { | 233 void EventConverterEvdevImpl::FlushEvents(const input_event& input) { |
233 if (!cursor_ || (x_offset_ == 0 && y_offset_ == 0)) | 234 if (!cursor_ || (x_offset_ == 0 && y_offset_ == 0)) |
234 return; | 235 return; |
235 | 236 |
236 cursor_->MoveCursor(gfx::Vector2dF(x_offset_, y_offset_)); | 237 cursor_->MoveCursor(gfx::Vector2dF(x_offset_, y_offset_)); |
237 | 238 |
238 dispatcher_->DispatchMouseMoveEvent( | 239 dispatcher_->DispatchMouseMoveEvent( |
239 MouseMoveEventParams(input_device_.id, cursor_->GetLocation(), | 240 MouseMoveEventParams(input_device_.id, cursor_->GetLocation(), |
| 241 PointerDetails(EventPointerType::POINTER_TYPE_MOUSE), |
240 TimeDeltaFromInputEvent(input))); | 242 TimeDeltaFromInputEvent(input))); |
241 | 243 |
242 x_offset_ = 0; | 244 x_offset_ = 0; |
243 y_offset_ = 0; | 245 y_offset_ = 0; |
244 } | 246 } |
245 | 247 |
246 } // namespace ui | 248 } // namespace ui |
OLD | NEW |