summaryrefslogtreecommitdiffstats
path: root/views/controls/button/custom_button.cc
diff options
context:
space:
mode:
Diffstat (limited to 'views/controls/button/custom_button.cc')
-rw-r--r--views/controls/button/custom_button.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/views/controls/button/custom_button.cc b/views/controls/button/custom_button.cc
index e507d93..348e527 100644
--- a/views/controls/button/custom_button.cc
+++ b/views/controls/button/custom_button.cc
@@ -175,10 +175,10 @@ bool CustomButton::OnKeyPressed(const KeyEvent& e) {
// Space sets button state to pushed. Enter clicks the button. This matches
// the Windows native behavior of buttons, where Space clicks the button
// on KeyRelease and Enter clicks the button on KeyPressed.
- if (e.GetCharacter() == base::VKEY_SPACE) {
+ if (e.GetKeyCode() == base::VKEY_SPACE) {
SetState(BS_PUSHED);
return true;
- } else if (e.GetCharacter() == base::VKEY_RETURN) {
+ } else if (e.GetKeyCode() == base::VKEY_RETURN) {
SetState(BS_NORMAL);
NotifyClick(e);
return true;
@@ -189,7 +189,7 @@ bool CustomButton::OnKeyPressed(const KeyEvent& e) {
bool CustomButton::OnKeyReleased(const KeyEvent& e) {
if (state_ != BS_DISABLED) {
- if (e.GetCharacter() == base::VKEY_SPACE) {
+ if (e.GetKeyCode() == base::VKEY_SPACE) {
SetState(BS_NORMAL);
NotifyClick(e);
return true;