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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/base/keycodes/keyboard_code_conversion.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/base/keycodes/keyboard_code_conversion.h" 5 #include "ui/base/keycodes/keyboard_code_conversion.h"
6 6
7 #include "ui/base/events/event_constants.h" 7 #include "ui/base/events/event_constants.h"
8 8
9 namespace ui { 9 namespace ui {
10 10
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 return shift ? '|' : '\\'; 105 return shift ? '|' : '\\';
106 case VKEY_OEM_6: 106 case VKEY_OEM_6:
107 return shift ? '}' : ']'; 107 return shift ? '}' : ']';
108 case VKEY_OEM_7: 108 case VKEY_OEM_7:
109 return shift ? '"' : '\''; 109 return shift ? '"' : '\'';
110 default: 110 default:
111 return 0; 111 return 0;
112 } 112 }
113 } 113 }
114 114
115 KeyboardCode GetWindowsKeyCodeWithoutLocation(KeyboardCode key_code) {
116 switch (key_code) {
117 case VKEY_LCONTROL:
118 case VKEY_RCONTROL:
119 return VKEY_CONTROL;
120 case VKEY_LSHIFT:
121 case VKEY_RSHIFT:
122 return VKEY_SHIFT;
123 case VKEY_LMENU:
124 case VKEY_RMENU:
125 return VKEY_MENU;
126 default:
127 return key_code;
128 }
129 }
130
131 int GetLocationModifiersFromWindowsKeyCode(KeyboardCode key_code) {
132 switch (key_code) {
133 case VKEY_LCONTROL:
134 case VKEY_LSHIFT:
135 case VKEY_LMENU:
136 case VKEY_LWIN:
137 return 1 << 11; // WebInputEvent::IsLeft;
jamesr 2013/07/23 00:04:32 this is clearly not right. we could either: 1.) M
138 case VKEY_RCONTROL:
139 case VKEY_RSHIFT:
140 case VKEY_RMENU:
141 case VKEY_RWIN:
142 return 1 << 12; // WebInputEvent::IsRight;
143 default:
144 return 0;
145 }
146 }
147
115 } // namespace ui 148 } // namespace ui
OLDNEW
« 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