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/libgestures_glue/gesture_interpreter_libevdev_cr
os.h" | 5 #include "ui/events/ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cr
os.h" |
6 | 6 |
7 #include <gestures/gestures.h> | 7 #include <gestures/gestures.h> |
8 #include <libevdev/libevdev.h> | 8 #include <libevdev/libevdev.h> |
9 #include <linux/input.h> | 9 #include <linux/input.h> |
10 | 10 |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 move->dx, | 265 move->dx, |
266 move->dy, | 266 move->dy, |
267 move->ordinal_dx, | 267 move->ordinal_dx, |
268 move->ordinal_dy); | 268 move->ordinal_dy); |
269 if (!cursor_) | 269 if (!cursor_) |
270 return; // No cursor! | 270 return; // No cursor! |
271 | 271 |
272 cursor_->MoveCursor(gfx::Vector2dF(move->dx, move->dy)); | 272 cursor_->MoveCursor(gfx::Vector2dF(move->dx, move->dy)); |
273 // TODO(spang): Use move->ordinal_dx, move->ordinal_dy | 273 // TODO(spang): Use move->ordinal_dx, move->ordinal_dy |
274 dispatcher_->DispatchMouseMoveEvent( | 274 dispatcher_->DispatchMouseMoveEvent( |
275 MouseMoveEventParams(id_, cursor_->GetLocation(), | 275 MouseMoveEventParams(id_, EF_NONE, cursor_->GetLocation(), |
276 PointerDetails(EventPointerType::POINTER_TYPE_MOUSE), | 276 PointerDetails(EventPointerType::POINTER_TYPE_MOUSE), |
277 StimeToTimeTicks(gesture->end_time))); | 277 StimeToTimeTicks(gesture->end_time))); |
278 } | 278 } |
279 | 279 |
280 void GestureInterpreterLibevdevCros::OnGestureScroll( | 280 void GestureInterpreterLibevdevCros::OnGestureScroll( |
281 const Gesture* gesture, | 281 const Gesture* gesture, |
282 const GestureScroll* scroll) { | 282 const GestureScroll* scroll) { |
283 DVLOG(3) << base::StringPrintf("Gesture Scroll: (%f, %f) [%f, %f]", | 283 DVLOG(3) << base::StringPrintf("Gesture Scroll: (%f, %f) [%f, %f]", |
284 scroll->dx, | 284 scroll->dx, |
285 scroll->dy, | 285 scroll->dy, |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 } | 436 } |
437 | 437 |
438 void GestureInterpreterLibevdevCros::DispatchMouseButton(unsigned int button, | 438 void GestureInterpreterLibevdevCros::DispatchMouseButton(unsigned int button, |
439 bool down, | 439 bool down, |
440 stime_t time) { | 440 stime_t time) { |
441 if (!SetMouseButtonState(button, down)) | 441 if (!SetMouseButtonState(button, down)) |
442 return; // No change. | 442 return; // No change. |
443 | 443 |
444 bool allow_remap = is_mouse_; | 444 bool allow_remap = is_mouse_; |
445 dispatcher_->DispatchMouseButtonEvent(MouseButtonEventParams( | 445 dispatcher_->DispatchMouseButtonEvent(MouseButtonEventParams( |
446 id_, cursor_->GetLocation(), button, down, allow_remap, | 446 id_, EF_NONE, cursor_->GetLocation(), button, down, allow_remap, |
447 PointerDetails(EventPointerType::POINTER_TYPE_MOUSE), | 447 PointerDetails(EventPointerType::POINTER_TYPE_MOUSE), |
448 StimeToTimeTicks(time))); | 448 StimeToTimeTicks(time))); |
449 } | 449 } |
450 | 450 |
451 void GestureInterpreterLibevdevCros::DispatchChangedKeys( | 451 void GestureInterpreterLibevdevCros::DispatchChangedKeys( |
452 unsigned long* new_key_state, | 452 unsigned long* new_key_state, |
453 stime_t timestamp) { | 453 stime_t timestamp) { |
454 unsigned long key_state_diff[EVDEV_BITS_TO_LONGS(KEY_CNT)]; | 454 unsigned long key_state_diff[EVDEV_BITS_TO_LONGS(KEY_CNT)]; |
455 | 455 |
456 // Find changed keys. | 456 // Find changed keys. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 | 505 |
506 void GestureInterpreterLibevdevCros::ReleaseMouseButtons(stime_t timestamp) { | 506 void GestureInterpreterLibevdevCros::ReleaseMouseButtons(stime_t timestamp) { |
507 DispatchMouseButton(BTN_LEFT, false /* down */, timestamp); | 507 DispatchMouseButton(BTN_LEFT, false /* down */, timestamp); |
508 DispatchMouseButton(BTN_MIDDLE, false /* down */, timestamp); | 508 DispatchMouseButton(BTN_MIDDLE, false /* down */, timestamp); |
509 DispatchMouseButton(BTN_RIGHT, false /* down */, timestamp); | 509 DispatchMouseButton(BTN_RIGHT, false /* down */, timestamp); |
510 DispatchMouseButton(BTN_BACK, false /* down */, timestamp); | 510 DispatchMouseButton(BTN_BACK, false /* down */, timestamp); |
511 DispatchMouseButton(BTN_FORWARD, false /* down */, timestamp); | 511 DispatchMouseButton(BTN_FORWARD, false /* down */, timestamp); |
512 } | 512 } |
513 | 513 |
514 } // namespace ui | 514 } // namespace ui |
OLD | NEW |