diff options
author | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-23 02:06:48 +0000 |
---|---|---|
committer | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-23 02:06:48 +0000 |
commit | 36c094f5ee00af6d6dc9cbda3caf85f1b754a6ac (patch) | |
tree | 0126c4cd9d0768700fbd0aee3ea3e3bea60c2b91 /ui/base/keycodes | |
parent | a9fc170eb598692eb378340515f0d50c0529e1ee (diff) | |
download | chromium_src-36c094f5ee00af6d6dc9cbda3caf85f1b754a6ac.zip chromium_src-36c094f5ee00af6d6dc9cbda3caf85f1b754a6ac.tar.gz chromium_src-36c094f5ee00af6d6dc9cbda3caf85f1b754a6ac.tar.bz2 |
Add VKEY_POWER to the POSIX KeyboardCode enum.
I'm mapping XF86XK_PowerOff to VKEY_POWER on X. Otherwise,
power button events on Chrome OS are mapped to VKEY_UNKNOWN
and get thrown on the floor before we can interpret them as
user activity.
BUG=chromium:144295
TEST=power button undims the screen on chrome os
Review URL: https://chromiumcodereview.appspot.com/10879023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152921 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/base/keycodes')
-rw-r--r-- | ui/base/keycodes/keyboard_code_conversion_x.cc | 4 | ||||
-rw-r--r-- | ui/base/keycodes/keyboard_codes_posix.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/ui/base/keycodes/keyboard_code_conversion_x.cc b/ui/base/keycodes/keyboard_code_conversion_x.cc index 2bfedb8..3548dcf 100644 --- a/ui/base/keycodes/keyboard_code_conversion_x.cc +++ b/ui/base/keycodes/keyboard_code_conversion_x.cc @@ -388,6 +388,8 @@ KeyboardCode KeyboardCodeFromXKeysym(unsigned int keysym) { return VKEY_MEDIA_LAUNCH_APP2; case XF86XK_WLAN: return VKEY_WLAN; + case XF86XK_PowerOff: + return VKEY_POWER; case XF86XK_MonBrightnessDown: return VKEY_BRIGHTNESS_DOWN; case XF86XK_MonBrightnessUp: @@ -744,6 +746,8 @@ int XKeysymForWindowsKeyCode(KeyboardCode keycode, bool shift) { return XF86XK_LaunchB; case VKEY_WLAN: return XF86XK_WLAN; + case VKEY_POWER: + return XF86XK_PowerOff; case VKEY_BRIGHTNESS_DOWN: return XF86XK_MonBrightnessDown; case VKEY_BRIGHTNESS_UP: diff --git a/ui/base/keycodes/keyboard_codes_posix.h b/ui/base/keycodes/keyboard_codes_posix.h index 697a9f3..1d2ab41 100644 --- a/ui/base/keycodes/keyboard_codes_posix.h +++ b/ui/base/keycodes/keyboard_codes_posix.h @@ -209,6 +209,7 @@ enum KeyboardCode { // POSIX specific VKEYs. Note that as of Windows SDK 7.1, 0x97-9F, 0xD8-DA, // and 0xE8 are unassigned. VKEY_WLAN = 0x97, + VKEY_POWER = 0x98, VKEY_BRIGHTNESS_DOWN = 0xD8, VKEY_BRIGHTNESS_UP = 0xD9, VKEY_KBD_BRIGHTNESS_DOWN = 0xDA, |