| 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.h" | 5 #include "ui/events/event.h" |
| 6 | 6 |
| 7 #if defined(USE_X11) | 7 #if defined(USE_X11) |
| 8 #include <X11/extensions/XInput2.h> | 8 #include <X11/extensions/XInput2.h> |
| 9 #include <X11/Xlib.h> | 9 #include <X11/Xlib.h> |
| 10 #endif | 10 #endif |
| (...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 | 632 |
| 633 TranslatedKeyEvent::TranslatedKeyEvent(bool is_press, | 633 TranslatedKeyEvent::TranslatedKeyEvent(bool is_press, |
| 634 KeyboardCode key_code, | 634 KeyboardCode key_code, |
| 635 int flags) | 635 int flags) |
| 636 : KeyEvent((is_press ? ET_TRANSLATED_KEY_PRESS : ET_TRANSLATED_KEY_RELEASE), | 636 : KeyEvent((is_press ? ET_TRANSLATED_KEY_PRESS : ET_TRANSLATED_KEY_RELEASE), |
| 637 key_code, | 637 key_code, |
| 638 flags, | 638 flags, |
| 639 false) { | 639 false) { |
| 640 } | 640 } |
| 641 | 641 |
| 642 TranslatedKeyEvent::TranslatedKeyEvent(const KeyEvent& key_event) |
| 643 : KeyEvent(key_event) { |
| 644 SetType(type() == ET_KEY_PRESSED ? |
| 645 ET_TRANSLATED_KEY_PRESS : ET_TRANSLATED_KEY_RELEASE); |
| 646 set_is_char(false); |
| 647 } |
| 648 |
| 642 void TranslatedKeyEvent::ConvertToKeyEvent() { | 649 void TranslatedKeyEvent::ConvertToKeyEvent() { |
| 643 SetType(type() == ET_TRANSLATED_KEY_PRESS ? | 650 SetType(type() == ET_TRANSLATED_KEY_PRESS ? |
| 644 ET_KEY_PRESSED : ET_KEY_RELEASED); | 651 ET_KEY_PRESSED : ET_KEY_RELEASED); |
| 645 } | 652 } |
| 646 | 653 |
| 647 //////////////////////////////////////////////////////////////////////////////// | 654 //////////////////////////////////////////////////////////////////////////////// |
| 648 // ScrollEvent | 655 // ScrollEvent |
| 649 | 656 |
| 650 ScrollEvent::ScrollEvent(const base::NativeEvent& native_event) | 657 ScrollEvent::ScrollEvent(const base::NativeEvent& native_event) |
| 651 : MouseEvent(native_event) { | 658 : MouseEvent(native_event) { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 int GestureEvent::GetLowestTouchId() const { | 724 int GestureEvent::GetLowestTouchId() const { |
| 718 if (touch_ids_bitfield_ == 0) | 725 if (touch_ids_bitfield_ == 0) |
| 719 return -1; | 726 return -1; |
| 720 int i = -1; | 727 int i = -1; |
| 721 // Find the index of the least significant 1 bit | 728 // Find the index of the least significant 1 bit |
| 722 while (!(1 << ++i & touch_ids_bitfield_)); | 729 while (!(1 << ++i & touch_ids_bitfield_)); |
| 723 return i; | 730 return i; |
| 724 } | 731 } |
| 725 | 732 |
| 726 } // namespace ui | 733 } // namespace ui |
| OLD | NEW |