Chromium Code Reviews| Index: views/events/event.h |
| diff --git a/views/events/event.h b/views/events/event.h |
| index 4173d5382cacc0d3b7dd744cb39121192cb06077..6965b133b519467a861be9e9aa20b1136edbfa46 100644 |
| --- a/views/events/event.h |
| +++ b/views/events/event.h |
| @@ -289,14 +289,28 @@ class KeyEvent : public Event { |
| // Creates a new KeyEvent synthetically (i.e. not in response to an input |
| // event from the host environment). This is typically only used in testing as |
| // some metadata obtainable from the underlying native event is not present. |
| - // TODO(beng): see if we can kill this. |
| + // It's also used by input methods to fabricate keyboard events. |
| KeyEvent(ui::EventType type, |
| ui::KeyboardCode key_code, |
| int event_flags); |
| ui::KeyboardCode key_code() const { return key_code_; } |
| + // Gets the character generated by this key event. It only supports Unicode |
| + // BMP characters. |
|
oshima
2011/03/21 18:35:42
What do we do for non-BMP?
James Su
2011/03/21 18:59:22
non-BMP characters could be input via TextInputCli
|
| + uint16 GetCharacter() const; |
| + |
| + // Gets the character generated by this key event ignoring concurrently-held |
| + // modifiers (except shift). |
| + uint16 GetUnmodifiedCharacter() const; |
| + |
| private: |
| + // A helper function to get the character generated by a key event in a |
| + // platform independent way. It supports control characters as well. |
| + // It assumes a US keyboard layout is used, so it may only be used when there |
| + // is no native event or no better way to get the character. |
|
oshima
2011/03/21 18:35:42
I indeed assume us keyboard, but it's still not cl
James Su
2011/03/21 18:59:22
Key events generated by virtual keyboard or input
|
| + static uint16 GetCharacterFromKeyCode(ui::KeyboardCode key_code, int flags); |
| + |
| ui::KeyboardCode key_code_; |
| DISALLOW_COPY_AND_ASSIGN(KeyEvent); |