Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Unified Diff: ui/base/keycodes/keyboard_code_conversion.cc

Issue 19776016: Add files. Does not compile yet! (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: gtk links, may not work correctly Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/keycodes/keyboard_code_conversion.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/keycodes/keyboard_code_conversion.cc
diff --git a/ui/base/keycodes/keyboard_code_conversion.cc b/ui/base/keycodes/keyboard_code_conversion.cc
index 1a4d92aa4cff6a0a066b4ed5f5598139c54d6ed7..09fa70b9707ed15d93a78be09ca14b644c7941dd 100644
--- a/ui/base/keycodes/keyboard_code_conversion.cc
+++ b/ui/base/keycodes/keyboard_code_conversion.cc
@@ -112,4 +112,37 @@ uint16 GetCharacterFromKeyCode(KeyboardCode key_code, int flags) {
}
}
+KeyboardCode GetWindowsKeyCodeWithoutLocation(KeyboardCode key_code) {
+ switch (key_code) {
+ case VKEY_LCONTROL:
+ case VKEY_RCONTROL:
+ return VKEY_CONTROL;
+ case VKEY_LSHIFT:
+ case VKEY_RSHIFT:
+ return VKEY_SHIFT;
+ case VKEY_LMENU:
+ case VKEY_RMENU:
+ return VKEY_MENU;
+ default:
+ return key_code;
+ }
+}
+
+int GetLocationModifiersFromWindowsKeyCode(KeyboardCode key_code) {
+ switch (key_code) {
+ case VKEY_LCONTROL:
+ case VKEY_LSHIFT:
+ case VKEY_LMENU:
+ case VKEY_LWIN:
+ return 1 << 11; // WebInputEvent::IsLeft;
jamesr 2013/07/23 00:04:32 this is clearly not right. we could either: 1.) M
+ case VKEY_RCONTROL:
+ case VKEY_RSHIFT:
+ case VKEY_RMENU:
+ case VKEY_RWIN:
+ return 1 << 12; // WebInputEvent::IsRight;
+ default:
+ return 0;
+ }
+}
+
} // namespace ui
« no previous file with comments | « ui/base/keycodes/keyboard_code_conversion.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698