summaryrefslogtreecommitdiffstats
path: root/base/win
diff options
context:
space:
mode:
authornona@chromium.org <nona@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-27 05:22:51 +0000
committernona@chromium.org <nona@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-27 05:22:51 +0000
commit4d11593da862bdbf5f647b6fee7744370c7236f3 (patch)
tree6b2bc1c7c837a11b1e874f9259bc619555a9991e /base/win
parent5537605dae110a8759e58e54855775fe797d5edf (diff)
downloadchromium_src-4d11593da862bdbf5f647b6fee7744370c7236f3.zip
chromium_src-4d11593da862bdbf5f647b6fee7744370c7236f3.tar.gz
chromium_src-4d11593da862bdbf5f647b6fee7744370c7236f3.tar.bz2
Do not handle AltGr modifier as system key.
Alt + Ctrl is handled as AltGr on Windows and there is no specific key code or modifier flags for AltGr. And we should not handle AltGr as SystemKey otherwise Blink will reject event. This change does not affect for LinuxAura or Chrome OS. BUG=275699 TEST=AltGr+Q become @ on Turkish keyboard and no effect for other port. Review URL: https://chromiumcodereview.appspot.com/23072045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@219699 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/win')
-rw-r--r--base/win/win_util.cc5
-rw-r--r--base/win/win_util.h5
2 files changed, 10 insertions, 0 deletions
diff --git a/base/win/win_util.cc b/base/win/win_util.cc
index 11398bf..813af31 100644
--- a/base/win/win_util.cc
+++ b/base/win/win_util.cc
@@ -115,6 +115,11 @@ bool IsAltPressed() {
return (::GetKeyState(VK_MENU) & 0x8000) == 0x8000;
}
+bool IsAltGrPressed() {
+ return (::GetKeyState(VK_MENU) & 0x8000) == 0x8000 &&
+ (::GetKeyState(VK_CONTROL) & 0x8000) == 0x8000;
+}
+
bool UserAccountControlIsEnabled() {
// This can be slow if Windows ends up going to disk. Should watch this key
// for changes and only read it once, preferably on the file thread.
diff --git a/base/win/win_util.h b/base/win/win_util.h
index a91183a..903fcf9 100644
--- a/base/win/win_util.h
+++ b/base/win/win_util.h
@@ -50,6 +50,11 @@ BASE_EXPORT bool IsCtrlPressed();
// Returns true if the alt key is currently pressed.
BASE_EXPORT bool IsAltPressed();
+// Returns true if the altgr key is currently pressed.
+// Windows does not have specific key code and modifier bit and Alt+Ctrl key is
+// used as AltGr key in Windows.
+BASE_EXPORT bool IsAltGrPressed();
+
// Returns false if user account control (UAC) has been disabled with the
// EnableLUA registry flag. Returns true if user account control is enabled.
// NOTE: The EnableLUA registry flag, which is ignored on Windows XP