| 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 abs_value_dirty_ = false; | 182 abs_value_dirty_ = false; |
| 183 } | 183 } |
| 184 | 184 |
| 185 bool down = input.value; | 185 bool down = input.value; |
| 186 | 186 |
| 187 dispatcher_->DispatchMouseButtonEvent(MouseButtonEventParams( | 187 dispatcher_->DispatchMouseButtonEvent(MouseButtonEventParams( |
| 188 input_device_.id, EF_NONE, cursor_->GetLocation(), button, down, | 188 input_device_.id, EF_NONE, cursor_->GetLocation(), button, down, |
| 189 false /* allow_remap */, | 189 false /* allow_remap */, |
| 190 PointerDetails(GetToolType(stylus_), | 190 PointerDetails(GetToolType(stylus_), |
| 191 /* radius_x */ 0.0f, /* radius_y */ 0.0f, pressure_, | 191 /* radius_x */ 0.0f, /* radius_y */ 0.0f, pressure_, |
| 192 tilt_x_, tilt_y_), | 192 tilt_x_, tilt_y_, 0.0f, 0), |
| 193 TimeTicksFromInputEvent(input))); | 193 TimeTicksFromInputEvent(input))); |
| 194 } | 194 } |
| 195 | 195 |
| 196 void TabletEventConverterEvdev::FlushEvents(const input_event& input) { | 196 void TabletEventConverterEvdev::FlushEvents(const input_event& input) { |
| 197 if (!cursor_) | 197 if (!cursor_) |
| 198 return; | 198 return; |
| 199 | 199 |
| 200 // Prevent propagation of invalid data on stylus lift off | 200 // Prevent propagation of invalid data on stylus lift off |
| 201 if (stylus_ == 0) { | 201 if (stylus_ == 0) { |
| 202 abs_value_dirty_ = false; | 202 abs_value_dirty_ = false; |
| 203 return; | 203 return; |
| 204 } | 204 } |
| 205 | 205 |
| 206 if (!abs_value_dirty_) | 206 if (!abs_value_dirty_) |
| 207 return; | 207 return; |
| 208 | 208 |
| 209 UpdateCursor(); | 209 UpdateCursor(); |
| 210 | 210 |
| 211 dispatcher_->DispatchMouseMoveEvent(MouseMoveEventParams( | 211 dispatcher_->DispatchMouseMoveEvent(MouseMoveEventParams( |
| 212 input_device_.id, EF_NONE, cursor_->GetLocation(), | 212 input_device_.id, EF_NONE, cursor_->GetLocation(), |
| 213 PointerDetails(GetToolType(stylus_), | 213 PointerDetails(GetToolType(stylus_), |
| 214 /* radius_x */ 0.0f, /* radius_y */ 0.0f, pressure_, | 214 /* radius_x */ 0.0f, /* radius_y */ 0.0f, pressure_, |
| 215 tilt_x_, tilt_y_), | 215 tilt_x_, tilt_y_, 0.0f, 0), |
| 216 TimeTicksFromInputEvent(input))); | 216 TimeTicksFromInputEvent(input))); |
| 217 | 217 |
| 218 abs_value_dirty_ = false; | 218 abs_value_dirty_ = false; |
| 219 } | 219 } |
| 220 | 220 |
| 221 } // namespace ui | 221 } // namespace ui |
| OLD | NEW |