| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/event_constants.h" | 5 #include "ui/events/event_constants.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 #include <X11/extensions/XInput.h> | 8 #include <X11/extensions/XInput.h> |
| 9 #include <X11/extensions/XInput2.h> | 9 #include <X11/extensions/XInput2.h> |
| 10 #include <X11/XKBlib.h> | 10 #include <X11/XKBlib.h> |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 if (GetFlingData(native_event, NULL, NULL, NULL, NULL, &is_cancel)) | 435 if (GetFlingData(native_event, NULL, NULL, NULL, NULL, &is_cancel)) |
| 436 return is_cancel ? ET_SCROLL_FLING_CANCEL : ET_SCROLL_FLING_START; | 436 return is_cancel ? ET_SCROLL_FLING_CANCEL : ET_SCROLL_FLING_START; |
| 437 if (devices->IsScrollEvent(native_event)) { | 437 if (devices->IsScrollEvent(native_event)) { |
| 438 return devices->IsTouchpadXInputEvent(native_event) ? ET_SCROLL | 438 return devices->IsTouchpadXInputEvent(native_event) ? ET_SCROLL |
| 439 : ET_MOUSEWHEEL; | 439 : ET_MOUSEWHEEL; |
| 440 } | 440 } |
| 441 if (devices->IsCMTMetricsEvent(native_event)) | 441 if (devices->IsCMTMetricsEvent(native_event)) |
| 442 return ET_UMA_DATA; | 442 return ET_UMA_DATA; |
| 443 if (GetButtonMaskForX2Event(xievent)) | 443 if (GetButtonMaskForX2Event(xievent)) |
| 444 return ET_MOUSE_DRAGGED; | 444 return ET_MOUSE_DRAGGED; |
| 445 if (DeviceDataManagerX11::GetInstance()->HasEventData( |
| 446 xievent, DeviceDataManagerX11::DT_CMT_SCROLL_X) || |
| 447 DeviceDataManagerX11::GetInstance()->HasEventData( |
| 448 xievent, DeviceDataManagerX11::DT_CMT_SCROLL_Y)) { |
| 449 // Don't produce mouse move events for mousewheel scrolls. |
| 450 return ET_UNKNOWN; |
| 451 } |
| 452 |
| 445 return ET_MOUSE_MOVED; | 453 return ET_MOUSE_MOVED; |
| 446 } | 454 } |
| 447 case XI_KeyPress: | 455 case XI_KeyPress: |
| 448 return ET_KEY_PRESSED; | 456 return ET_KEY_PRESSED; |
| 449 case XI_KeyRelease: | 457 case XI_KeyRelease: |
| 450 return ET_KEY_RELEASED; | 458 return ET_KEY_RELEASED; |
| 451 } | 459 } |
| 452 } | 460 } |
| 453 default: | 461 default: |
| 454 break; | 462 break; |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 900 xievent->detail = | 908 xievent->detail = |
| 901 UpdateX11EventButton(event->changed_button_flags(), xievent->detail); | 909 UpdateX11EventButton(event->changed_button_flags(), xievent->detail); |
| 902 break; | 910 break; |
| 903 } | 911 } |
| 904 default: | 912 default: |
| 905 break; | 913 break; |
| 906 } | 914 } |
| 907 } | 915 } |
| 908 | 916 |
| 909 } // namespace ui | 917 } // namespace ui |
| OLD | NEW |