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

Side by Side Diff: ui/base/keycodes/keyboard_code_conversion.cc

Issue 10917075: events: Move some files into ui/base/events/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 3 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/ime/mock_input_method.cc ('k') | ui/base/win/events_win.cc » ('j') | 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.h" 7 #include "ui/base/events/event_constants.h"
8 8
9 namespace ui { 9 namespace ui {
10 10
11 uint16 GetCharacterFromKeyCode(KeyboardCode key_code, int flags) { 11 uint16 GetCharacterFromKeyCode(KeyboardCode key_code, int flags) {
12 const bool ctrl = (flags & EF_CONTROL_DOWN) != 0; 12 const bool ctrl = (flags & EF_CONTROL_DOWN) != 0;
13 const bool shift = (flags & EF_SHIFT_DOWN) != 0; 13 const bool shift = (flags & EF_SHIFT_DOWN) != 0;
14 const bool upper = shift ^ ((flags & EF_CAPS_LOCK_DOWN) != 0); 14 const bool upper = shift ^ ((flags & EF_CAPS_LOCK_DOWN) != 0);
15 15
16 // Following Windows behavior to map ctrl-a ~ ctrl-z to \x01 ~ \x1A. 16 // Following Windows behavior to map ctrl-a ~ ctrl-z to \x01 ~ \x1A.
17 if (key_code >= VKEY_A && key_code <= VKEY_Z) 17 if (key_code >= VKEY_A && key_code <= VKEY_Z)
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 } // namespace ui 115 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/ime/mock_input_method.cc ('k') | ui/base/win/events_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698