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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 touch_logging_enabled_ = enabled; | 295 touch_logging_enabled_ = enabled; |
296 } | 296 } |
297 | 297 |
298 void TouchEventConverterEvdev::SetPalmSuppressionCallback( | 298 void TouchEventConverterEvdev::SetPalmSuppressionCallback( |
299 const base::Callback<void(bool)>& callback) { | 299 const base::Callback<void(bool)>& callback) { |
300 enable_palm_suppression_callback_ = callback; | 300 enable_palm_suppression_callback_ = callback; |
301 } | 301 } |
302 | 302 |
303 void TouchEventConverterEvdev::ProcessMultitouchEvent( | 303 void TouchEventConverterEvdev::ProcessMultitouchEvent( |
304 const input_event& input) { | 304 const input_event& input) { |
305 if (touch_logging_enabled_) | 305 if (touch_logging_enabled_ && !has_pen_) |
306 touch_evdev_debug_buffer_.ProcessEvent(current_slot_, &input); | 306 touch_evdev_debug_buffer_.ProcessEvent(current_slot_, &input); |
307 | 307 |
308 if (input.type == EV_SYN) { | 308 if (input.type == EV_SYN) { |
309 ProcessSyn(input); | 309 ProcessSyn(input); |
310 } else if (dropped_events_) { | 310 } else if (dropped_events_) { |
311 // Do nothing. This branch indicates we have lost sync with the driver. | 311 // Do nothing. This branch indicates we have lost sync with the driver. |
312 } else if (input.type == EV_ABS) { | 312 } else if (input.type == EV_ABS) { |
313 if (events_.size() <= current_slot_) { | 313 if (events_.size() <= current_slot_) { |
314 LOG(ERROR) << "current_slot_ (" << current_slot_ | 314 LOG(ERROR) << "current_slot_ (" << current_slot_ |
315 << ") >= events_.size() (" << events_.size() << ")"; | 315 << ") >= events_.size() (" << events_.size() << ")"; |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 if (pressure_max_ - pressure_min_) | 587 if (pressure_max_ - pressure_min_) |
588 pressure /= pressure_max_ - pressure_min_; | 588 pressure /= pressure_max_ - pressure_min_; |
589 return pressure; | 589 return pressure; |
590 } | 590 } |
591 | 591 |
592 int TouchEventConverterEvdev::NextTrackingId() { | 592 int TouchEventConverterEvdev::NextTrackingId() { |
593 return next_tracking_id_++ & kMaxTrackingId; | 593 return next_tracking_id_++ & kMaxTrackingId; |
594 } | 594 } |
595 | 595 |
596 } // namespace ui | 596 } // namespace ui |
OLD | NEW |