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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 TouchEventConverterEvdev::TouchEventConverterEvdev( | 73 TouchEventConverterEvdev::TouchEventConverterEvdev( |
74 int fd, | 74 int fd, |
75 base::FilePath path, | 75 base::FilePath path, |
76 int id, | 76 int id, |
77 const EventDispatchCallback& callback) | 77 const EventDispatchCallback& callback) |
78 : EventConverterEvdev(fd, path, id), | 78 : EventConverterEvdev(fd, path, id), |
79 callback_(callback), | 79 callback_(callback), |
80 syn_dropped_(false), | 80 syn_dropped_(false), |
81 is_type_a_(false), | 81 is_type_a_(false), |
82 current_slot_(0), | 82 current_slot_(0), |
83 is_internal_(IsTouchscreenInternal(path)) { | 83 is_internal_(GetInputDeviceTypeFromPath(path) == INPUT_DEVICE_INTERNAL) { |
84 } | 84 } |
85 | 85 |
86 TouchEventConverterEvdev::~TouchEventConverterEvdev() { | 86 TouchEventConverterEvdev::~TouchEventConverterEvdev() { |
87 Stop(); | 87 Stop(); |
88 close(fd_); | 88 close(fd_); |
89 } | 89 } |
90 | 90 |
91 void TouchEventConverterEvdev::Initialize(const EventDeviceInfo& info) { | 91 void TouchEventConverterEvdev::Initialize(const EventDeviceInfo& info) { |
92 pressure_min_ = info.GetAbsMinimum(ABS_MT_PRESSURE); | 92 pressure_min_ = info.GetAbsMinimum(ABS_MT_PRESSURE); |
93 pressure_max_ = info.GetAbsMaximum(ABS_MT_PRESSURE); | 93 pressure_max_ = info.GetAbsMaximum(ABS_MT_PRESSURE); |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 | 305 |
306 // Subsequent events for this finger will be touch-move until it | 306 // Subsequent events for this finger will be touch-move until it |
307 // is released. | 307 // is released. |
308 events_[i].type_ = ET_TOUCH_MOVED; | 308 events_[i].type_ = ET_TOUCH_MOVED; |
309 } | 309 } |
310 } | 310 } |
311 altered_slots_.reset(); | 311 altered_slots_.reset(); |
312 } | 312 } |
313 | 313 |
314 } // namespace ui | 314 } // namespace ui |
OLD | NEW |