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

Side by Side Diff: chrome/browser/resources/chromeos/keyboard_overlay.js

Issue 10827234: Fix Search key incorrectly recognized as Alt by the keyboard overlay. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | « no previous file | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 src="keyboard_overlay_data.js"/> 5 <include src="keyboard_overlay_data.js"/>
6 <include src="keyboard_overlay_accessibility_helper.js"/> 6 <include src="keyboard_overlay_accessibility_helper.js"/>
7 7
8 var BASE_KEYBOARD = { 8 var BASE_KEYBOARD = {
9 top: 0, 9 top: 0,
10 left: 0, 10 left: 0,
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 */ 170 */
171 function getModifiers(e) { 171 function getModifiers(e) {
172 if (!e) 172 if (!e)
173 return []; 173 return [];
174 174
175 var isKeyDown = (e.type == 'keydown'); 175 var isKeyDown = (e.type == 'keydown');
176 var keyCodeToModifier = { 176 var keyCodeToModifier = {
177 16: 'SHIFT', 177 16: 'SHIFT',
178 17: 'CTRL', 178 17: 'CTRL',
179 18: 'ALT', 179 18: 'ALT',
180 91: 'ALT', // left ALT pressed with SHIFT
181 92: 'ALT', // right ALT pressed with SHIFT
182 }; 180 };
183 var modifierWithKeyCode = keyCodeToModifier[e.keyCode]; 181 var modifierWithKeyCode = keyCodeToModifier[e.keyCode];
184 var isPressed = {'SHIFT': e.shiftKey, 'CTRL': e.ctrlKey, 'ALT': e.altKey}; 182 var isPressed = {'SHIFT': e.shiftKey, 'CTRL': e.ctrlKey, 'ALT': e.altKey};
185 // if e.keyCode is one of Shift, Ctrl and Alt, isPressed should 183 // if e.keyCode is one of Shift, Ctrl and Alt, isPressed should
186 // be changed because the key currently pressed 184 // be changed because the key currently pressed
187 // does not affect the values of e.shiftKey, e.ctrlKey and e.altKey 185 // does not affect the values of e.shiftKey, e.ctrlKey and e.altKey
188 if (modifierWithKeyCode) 186 if (modifierWithKeyCode)
189 isPressed[modifierWithKeyCode] = isKeyDown; 187 isPressed[modifierWithKeyCode] = isKeyDown;
190 188
191 // make the result array 189 // make the result array
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 * Handles click events of the learn more link. 599 * Handles click events of the learn more link.
602 * @param {Event} e Mouse click event. 600 * @param {Event} e Mouse click event.
603 */ 601 */
604 function learnMoreClicked(e) { 602 function learnMoreClicked(e) {
605 chrome.send('openLearnMorePage'); 603 chrome.send('openLearnMorePage');
606 chrome.send('DialogClose'); 604 chrome.send('DialogClose');
607 e.preventDefault(); 605 e.preventDefault();
608 } 606 }
609 607
610 document.addEventListener('DOMContentLoaded', init); 608 document.addEventListener('DOMContentLoaded', init);
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698