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 #ifndef UI_EVENTS_EVENT_H_ | 5 #ifndef UI_EVENTS_EVENT_H_ |
6 #define UI_EVENTS_EVENT_H_ | 6 #define UI_EVENTS_EVENT_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/event_types.h" | 10 #include "base/event_types.h" |
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
534 | 534 |
535 // This allows an I18N virtual keyboard to fabricate a keyboard event that | 535 // This allows an I18N virtual keyboard to fabricate a keyboard event that |
536 // does not have a corresponding KeyboardCode (example: U+00E1 Latin small | 536 // does not have a corresponding KeyboardCode (example: U+00E1 Latin small |
537 // letter A with acute, U+0410 Cyrillic capital letter A). | 537 // letter A with acute, U+0410 Cyrillic capital letter A). |
538 void set_character(uint16 character) { character_ = character; } | 538 void set_character(uint16 character) { character_ = character; } |
539 | 539 |
540 // Gets the character generated by this key event. It only supports Unicode | 540 // Gets the character generated by this key event. It only supports Unicode |
541 // BMP characters. | 541 // BMP characters. |
542 uint16 GetCharacter() const; | 542 uint16 GetCharacter() const; |
543 | 543 |
544 // Gets the platform key code. For XKB, this is the xksym value. | |
545 uint32 platform_keycode() const { return platform_keycode_; } | |
544 KeyboardCode key_code() const { return key_code_; } | 546 KeyboardCode key_code() const { return key_code_; } |
545 bool is_char() const { return is_char_; } | 547 bool is_char() const { return is_char_; } |
546 | 548 |
547 // This is only intended to be used externally by classes that are modifying | 549 // This is only intended to be used externally by classes that are modifying |
548 // events in EventFilter::PreHandleKeyEvent(). set_character() should also be | 550 // events in EventFilter::PreHandleKeyEvent(). set_character() should also be |
549 // called. | 551 // called. |
550 void set_key_code(KeyboardCode key_code) { key_code_ = key_code; } | 552 void set_key_code(KeyboardCode key_code) { key_code_ = key_code; } |
551 | 553 |
552 // Returns true for [Alt]+<num-pad digit> Unicode alt key codes used by Win. | 554 // Returns true for [Alt]+<num-pad digit> Unicode alt key codes used by Win. |
553 // TODO(msw): Additional work may be needed for analogues on other platforms. | 555 // TODO(msw): Additional work may be needed for analogues on other platforms. |
(...skipping 23 matching lines...) Expand all Loading... | |
577 // http://www.w3.org/TR/uievents/#keyboard-key-codes. | 579 // http://www.w3.org/TR/uievents/#keyboard-key-codes. |
578 // | 580 // |
579 // This value represents the physical position in the keyboard and can be | 581 // This value represents the physical position in the keyboard and can be |
580 // converted from / to keyboard scan code like XKB. | 582 // converted from / to keyboard scan code like XKB. |
581 std::string code_; | 583 std::string code_; |
582 | 584 |
583 // True if this is a translated character event (vs. a raw key down). Both | 585 // True if this is a translated character event (vs. a raw key down). Both |
584 // share the same type: ET_KEY_PRESSED. | 586 // share the same type: ET_KEY_PRESSED. |
585 bool is_char_; | 587 bool is_char_; |
586 | 588 |
589 // The platform related keycode value. For XKB, it's keysym value. | |
590 // For now, this is used for CharacterComposer in ChromeOS. | |
591 // Note: for XKB, the keysym vlaue is modifiered value. But for other | |
sadrul
2014/06/16 15:19:20
*value
Shu Chen
2014/06/16 15:22:24
I've removed the comments after "Note:" which caus
| |
592 // platforms, it may be unmodifiered value. | |
593 uint32 platform_keycode_; | |
594 | |
595 // String of 'key' defined in DOM KeyboardEvent (e.g. 'a', 'รข') | |
596 // http://www.w3.org/TR/uievents/#keyboard-key-codes. | |
597 // | |
598 // This value represents the text that the key event will insert to input | |
599 // field. For key with modifier key, it may have specifial text. | |
600 // e.g. CTRL+A has '\x01'. | |
587 uint16 character_; | 601 uint16 character_; |
588 | 602 |
589 static bool IsRepeated(const KeyEvent& event); | 603 static bool IsRepeated(const KeyEvent& event); |
590 | 604 |
591 static KeyEvent* last_key_event_; | 605 static KeyEvent* last_key_event_; |
592 }; | 606 }; |
593 | 607 |
594 class EVENTS_EXPORT ScrollEvent : public MouseEvent { | 608 class EVENTS_EXPORT ScrollEvent : public MouseEvent { |
595 public: | 609 public: |
596 explicit ScrollEvent(const base::NativeEvent& native_event); | 610 explicit ScrollEvent(const base::NativeEvent& native_event); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
673 // The set of indices of ones in the binary representation of | 687 // The set of indices of ones in the binary representation of |
674 // touch_ids_bitfield_ is the set of touch_ids associate with this gesture. | 688 // touch_ids_bitfield_ is the set of touch_ids associate with this gesture. |
675 // This value is stored as a bitfield because the number of touch ids varies, | 689 // This value is stored as a bitfield because the number of touch ids varies, |
676 // but we currently don't need more than 32 touches at a time. | 690 // but we currently don't need more than 32 touches at a time. |
677 const unsigned int touch_ids_bitfield_; | 691 const unsigned int touch_ids_bitfield_; |
678 }; | 692 }; |
679 | 693 |
680 } // namespace ui | 694 } // namespace ui |
681 | 695 |
682 #endif // UI_EVENTS_EVENT_H_ | 696 #endif // UI_EVENTS_EVENT_H_ |
OLD | NEW |