| 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/tablet_event_converter_evdev.h" | 5 #include "ui/events/ozone/evdev/tablet_event_converter_evdev.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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 } | 176 } |
| 177 | 177 |
| 178 bool down = input.value; | 178 bool down = input.value; |
| 179 | 179 |
| 180 dispatcher_->DispatchMouseButtonEvent(MouseButtonEventParams( | 180 dispatcher_->DispatchMouseButtonEvent(MouseButtonEventParams( |
| 181 input_device_.id, cursor_->GetLocation(), button, down, | 181 input_device_.id, cursor_->GetLocation(), button, down, |
| 182 false /* allow_remap */, | 182 false /* allow_remap */, |
| 183 PointerDetails(EventPointerType::POINTER_TYPE_PEN, | 183 PointerDetails(EventPointerType::POINTER_TYPE_PEN, |
| 184 /* radius_x */ 0.0f, /* radius_y */ 0.0f, pressure_, | 184 /* radius_x */ 0.0f, /* radius_y */ 0.0f, pressure_, |
| 185 tilt_x_, tilt_y_), | 185 tilt_x_, tilt_y_), |
| 186 TimeDeltaFromInputEvent(input))); | 186 TimeTicksFromInputEvent(input))); |
| 187 } | 187 } |
| 188 | 188 |
| 189 void TabletEventConverterEvdev::FlushEvents(const input_event& input) { | 189 void TabletEventConverterEvdev::FlushEvents(const input_event& input) { |
| 190 if (!cursor_) | 190 if (!cursor_) |
| 191 return; | 191 return; |
| 192 | 192 |
| 193 // Prevent propagation of invalid data on stylus lift off | 193 // Prevent propagation of invalid data on stylus lift off |
| 194 if (stylus_ == 0) { | 194 if (stylus_ == 0) { |
| 195 abs_value_dirty_ = false; | 195 abs_value_dirty_ = false; |
| 196 return; | 196 return; |
| 197 } | 197 } |
| 198 | 198 |
| 199 if (!abs_value_dirty_) | 199 if (!abs_value_dirty_) |
| 200 return; | 200 return; |
| 201 | 201 |
| 202 UpdateCursor(); | 202 UpdateCursor(); |
| 203 | 203 |
| 204 dispatcher_->DispatchMouseMoveEvent(MouseMoveEventParams( | 204 dispatcher_->DispatchMouseMoveEvent(MouseMoveEventParams( |
| 205 input_device_.id, cursor_->GetLocation(), | 205 input_device_.id, cursor_->GetLocation(), |
| 206 PointerDetails(EventPointerType::POINTER_TYPE_PEN, | 206 PointerDetails(EventPointerType::POINTER_TYPE_PEN, |
| 207 /* radius_x */ 0.0f, /* radius_y */ 0.0f, pressure_, | 207 /* radius_x */ 0.0f, /* radius_y */ 0.0f, pressure_, |
| 208 tilt_x_, tilt_y_), | 208 tilt_x_, tilt_y_), |
| 209 TimeDeltaFromInputEvent(input))); | 209 TimeTicksFromInputEvent(input))); |
| 210 | 210 |
| 211 abs_value_dirty_ = false; | 211 abs_value_dirty_ = false; |
| 212 } | 212 } |
| 213 | 213 |
| 214 } // namespace ui | 214 } // namespace ui |
| OLD | NEW |