summaryrefslogtreecommitdiffstats
path: root/views/event.h
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-29 00:33:35 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-29 00:33:35 +0000
commitbc1407f95bae3d7472ee0c85ef83ee10610b3f1f (patch)
treeeeb1e01423fefc13afe5738d809df200b5e50623 /views/event.h
parent62525634a6f5727216828f8e05a4f563be90dfeb (diff)
downloadchromium_src-bc1407f95bae3d7472ee0c85ef83ee10610b3f1f.zip
chromium_src-bc1407f95bae3d7472ee0c85ef83ee10610b3f1f.tar.gz
chromium_src-bc1407f95bae3d7472ee0c85ef83ee10610b3f1f.tar.bz2
Relanding keyboard code refactoring:
http://codereview.chromium.org/248010/show Changing the KeyboardEvent to use a KeyboardCode instead of a w_char. Led to several places where I had to switch from VK_ to VKEY_. Also cleaned-up the table view OnKeyDown method. Since TableView is a NativeControl it can use the NativeControl::OnKeyDown directly. BUG=None TEST=Make sure short-cuts works as expected, especially in the omnibox. Review URL: http://codereview.chromium.org/251020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27444 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/event.h')
-rw-r--r--views/event.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/views/event.h b/views/event.h
index 5a6efd9..138327d 100644
--- a/views/event.h
+++ b/views/event.h
@@ -7,6 +7,7 @@
#include "base/basictypes.h"
#include "base/gfx/point.h"
+#include "base/keyboard_codes.h"
#if defined(OS_LINUX)
typedef struct _GdkEventKey GdkEventKey;
@@ -242,7 +243,10 @@ class KeyEvent : public Event {
public:
#if defined(OS_WIN)
// Create a new key event
- KeyEvent(EventType type, int ch, int repeat_count, int message_flags);
+ KeyEvent(EventType type,
+ base::KeyboardCode key_code,
+ int repeat_count,
+ int message_flags);
#elif defined(OS_LINUX)
explicit KeyEvent(GdkEventKey* event);
#endif
@@ -251,8 +255,8 @@ class KeyEvent : public Event {
// the Windows value.
// On GTK, you can use the methods in keyboard_code_conversion_gtk.cc to
// convert this value back to a GDK value if needed.
- int GetCharacter() const {
- return character_;
+ base::KeyboardCode GetKeyCode() const {
+ return key_code_;
}
#if defined(OS_WIN)
@@ -268,7 +272,7 @@ class KeyEvent : public Event {
int GetKeyStateFlags() const;
#endif
- int character_;
+ base::KeyboardCode key_code_;
int repeat_count_;
int message_flags_;