| 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 | 9 |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 void GestureInterpreterLibevdevCros::OnGestureButtonsChange( | 247 void GestureInterpreterLibevdevCros::OnGestureButtonsChange( |
| 248 const Gesture* gesture, | 248 const Gesture* gesture, |
| 249 const GestureButtonsChange* buttons) { | 249 const GestureButtonsChange* buttons) { |
| 250 DVLOG(3) << base::StringPrintf("Gesture Button Change: down=0x%02x up=0x%02x", | 250 DVLOG(3) << base::StringPrintf("Gesture Button Change: down=0x%02x up=0x%02x", |
| 251 buttons->down, | 251 buttons->down, |
| 252 buttons->up); | 252 buttons->up); |
| 253 | 253 |
| 254 if (!cursor_) | 254 if (!cursor_) |
| 255 return; // No cursor! | 255 return; // No cursor! |
| 256 | 256 |
| 257 // HACK for disabling TTC (actually, all clicks) on hidden cursor. |
| 258 // This is normally plumbed via properties and can be removed soon. |
| 259 // TODO(spang): Remove this. |
| 260 if (buttons->down == GESTURES_BUTTON_LEFT && |
| 261 buttons->up == GESTURES_BUTTON_LEFT && |
| 262 !cursor_->IsCursorVisible()) |
| 263 return; |
| 264 |
| 257 // TODO(spang): Use buttons->start_time, buttons->end_time | 265 // TODO(spang): Use buttons->start_time, buttons->end_time |
| 258 if (buttons->down & GESTURES_BUTTON_LEFT) | 266 if (buttons->down & GESTURES_BUTTON_LEFT) |
| 259 DispatchMouseButton(EVDEV_MODIFIER_LEFT_MOUSE_BUTTON, true); | 267 DispatchMouseButton(EVDEV_MODIFIER_LEFT_MOUSE_BUTTON, true); |
| 260 if (buttons->down & GESTURES_BUTTON_MIDDLE) | 268 if (buttons->down & GESTURES_BUTTON_MIDDLE) |
| 261 DispatchMouseButton(EVDEV_MODIFIER_MIDDLE_MOUSE_BUTTON, true); | 269 DispatchMouseButton(EVDEV_MODIFIER_MIDDLE_MOUSE_BUTTON, true); |
| 262 if (buttons->down & GESTURES_BUTTON_RIGHT) | 270 if (buttons->down & GESTURES_BUTTON_RIGHT) |
| 263 DispatchMouseButton(EVDEV_MODIFIER_RIGHT_MOUSE_BUTTON, true); | 271 DispatchMouseButton(EVDEV_MODIFIER_RIGHT_MOUSE_BUTTON, true); |
| 264 if (buttons->up & GESTURES_BUTTON_LEFT) | 272 if (buttons->up & GESTURES_BUTTON_LEFT) |
| 265 DispatchMouseButton(EVDEV_MODIFIER_LEFT_MOUSE_BUTTON, false); | 273 DispatchMouseButton(EVDEV_MODIFIER_LEFT_MOUSE_BUTTON, false); |
| 266 if (buttons->up & GESTURES_BUTTON_MIDDLE) | 274 if (buttons->up & GESTURES_BUTTON_MIDDLE) |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 modifiers_->UpdateModifier(modifier, down); | 393 modifiers_->UpdateModifier(modifier, down); |
| 386 MouseEvent event(type, loc, loc, modifiers_->GetModifierFlags() | flag, flag); | 394 MouseEvent event(type, loc, loc, modifiers_->GetModifierFlags() | flag, flag); |
| 387 | 395 |
| 388 // This hack is necessary to trigger setting the repeat count. | 396 // This hack is necessary to trigger setting the repeat count. |
| 389 // TODO(spang): Fix it. | 397 // TODO(spang): Fix it. |
| 390 MouseEvent event2(&event); | 398 MouseEvent event2(&event); |
| 391 Dispatch(&event2); | 399 Dispatch(&event2); |
| 392 } | 400 } |
| 393 | 401 |
| 394 } // namespace ui | 402 } // namespace ui |
| OLD | NEW |