Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: ui/events/ozone/evdev/event_converter_evdev_impl.cc

Issue 2248933002: Support pen in TouchEventConverterEvdev (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/event_converter_evdev_impl.h" 5 #include "ui/events/ozone/evdev/event_converter_evdev_impl.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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 else if (code == BTN_EXTRA) 219 else if (code == BTN_EXTRA)
220 code = BTN_FORWARD; 220 code = BTN_FORWARD;
221 221
222 int button_offset = code - BTN_MOUSE; 222 int button_offset = code - BTN_MOUSE;
223 if (mouse_button_state_.test(button_offset) == down) 223 if (mouse_button_state_.test(button_offset) == down)
224 return; 224 return;
225 225
226 mouse_button_state_.set(button_offset, down); 226 mouse_button_state_.set(button_offset, down);
227 227
228 dispatcher_->DispatchMouseButtonEvent(MouseButtonEventParams( 228 dispatcher_->DispatchMouseButtonEvent(MouseButtonEventParams(
229 input_device_.id, cursor_->GetLocation(), code, down, 229 input_device_.id, EF_NONE, cursor_->GetLocation(), code, down,
230 /* allow_remap */ true, 230 /* allow_remap */ true,
231 PointerDetails(EventPointerType::POINTER_TYPE_MOUSE), timestamp)); 231 PointerDetails(EventPointerType::POINTER_TYPE_MOUSE), timestamp));
232 } 232 }
233 233
234 void EventConverterEvdevImpl::FlushEvents(const input_event& input) { 234 void EventConverterEvdevImpl::FlushEvents(const input_event& input) {
235 if (!cursor_ || (x_offset_ == 0 && y_offset_ == 0)) 235 if (!cursor_ || (x_offset_ == 0 && y_offset_ == 0))
236 return; 236 return;
237 237
238 cursor_->MoveCursor(gfx::Vector2dF(x_offset_, y_offset_)); 238 cursor_->MoveCursor(gfx::Vector2dF(x_offset_, y_offset_));
239 239
240 dispatcher_->DispatchMouseMoveEvent( 240 dispatcher_->DispatchMouseMoveEvent(
241 MouseMoveEventParams(input_device_.id, cursor_->GetLocation(), 241 MouseMoveEventParams(input_device_.id, EF_NONE, cursor_->GetLocation(),
242 PointerDetails(EventPointerType::POINTER_TYPE_MOUSE), 242 PointerDetails(EventPointerType::POINTER_TYPE_MOUSE),
243 TimeTicksFromInputEvent(input))); 243 TimeTicksFromInputEvent(input)));
244 244
245 x_offset_ = 0; 245 x_offset_ = 0;
246 y_offset_ = 0; 246 y_offset_ = 0;
247 } 247 }
248 248
249 } // namespace ui 249 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698