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/touch_event_converter_evdev.h" | 5 #include "ui/events/ozone/evdev/touch_event_converter_evdev.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <fcntl.h> | 8 #include <fcntl.h> |
9 #include <linux/input.h> | 9 #include <linux/input.h> |
10 #include <poll.h> | 10 #include <poll.h> |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 } | 285 } |
286 } | 286 } |
287 | 287 |
288 void TouchEventConverterEvdev::ReportEvents(base::TimeDelta delta) { | 288 void TouchEventConverterEvdev::ReportEvents(base::TimeDelta delta) { |
289 for (int i = 0; i < MAX_FINGERS; i++) { | 289 for (int i = 0; i < MAX_FINGERS; i++) { |
290 if (altered_slots_[i]) { | 290 if (altered_slots_[i]) { |
291 // TODO(rikroege): Support elliptical finger regions. | 291 // TODO(rikroege): Support elliptical finger regions. |
292 TouchEvent evt(events_[i].type_, | 292 TouchEvent evt(events_[i].type_, |
293 gfx::PointF(events_[i].x_, events_[i].y_), | 293 gfx::PointF(events_[i].x_, events_[i].y_), |
294 /* flags */ 0, | 294 /* flags */ 0, |
295 /* touch_id */ events_[i].finger_, | 295 /* touch_id */ i, |
296 delta, | 296 delta, |
297 /* radius_x */ events_[i].radius_x_, | 297 /* radius_x */ events_[i].radius_x_, |
298 /* radius_y */ events_[i].radius_y_, | 298 /* radius_y */ events_[i].radius_y_, |
299 /* angle */ 0., | 299 /* angle */ 0., |
300 events_[i].pressure_); | 300 events_[i].pressure_); |
301 DispatchEventToCallback(&evt); | 301 DispatchEventToCallback(&evt); |
302 | 302 |
303 // Subsequent events for this finger will be touch-move until it | 303 // Subsequent events for this finger will be touch-move until it |
304 // is released. | 304 // is released. |
305 events_[i].type_ = ET_TOUCH_MOVED; | 305 events_[i].type_ = ET_TOUCH_MOVED; |
306 } | 306 } |
307 } | 307 } |
308 altered_slots_.reset(); | 308 altered_slots_.reset(); |
309 } | 309 } |
310 | 310 |
311 } // namespace ui | 311 } // namespace ui |
OLD | NEW |